User:EGM6341.s10.Team1.toddmock/HW2

= Problem 13-2: Error =

Given
Given that
 * {| style="width:100%" border="0" align="left"

\begin{align} n=2, \\ & q_3(x)=(x-x_o)(x-x_1)(x-x_2)\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle

Where:
 * }.
 * }.
 * {| style="width:100%" border="0" align="left"

\begin{align} \\ & x_o=a, x_2=b, x_1=\frac{a+b}{2} \end{align} $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

Find
Show that
 * {| style="width:100%" border="0" align="left"

\left | E_2 \right | = \frac{M_3}{3!}\int_{a}^{b}\left|(x-a)(x-\frac{a+b}{2})(x-b) \right |\, dx = \frac{(b-a)^4}{192}M_3 $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

Solution
To capture positive region it is necessary to change the limits and multiply by two


 * {| style="width:100%" border="0" align="left"

\begin{align} \int_{a}^{b}\left|(x-a)(x-\frac{a+b}{2})(x-b) \right |\, dx &= 2\int_{a}^{\frac{a+b}{2}}(x-a)\Big(x-\frac{a+b}{2}\Big)(x-b)\, dx\\ &=2\int_{a}^{\frac{a+b}{2}}x^3-\frac{a^2b}{2}-\frac{ab^2}{2}+\frac{a^2x}{2} + 2abx + \frac{b^2x}{2}-\frac{3ax^2}{2}-\frac{3bx^2}{2}, dx\\ &=\frac{1}{2}x^4-(a+b)x^3+\frac{1}{2}(a^2+4ab+b^2)x^2 - ab(a+b)x\, \Big |^{\frac{a+b}{2}}_a\\
 * $$\displaystyle
 * $$\displaystyle

\end{align} $$
 * }.
 * }.

Evaluating at the limits gives


 * {| style="width:100%" border="0" align="left"

\begin{align} &=\frac{1}{2}\Bigg(\Big(\frac{a+b}{2}\Big)^4-a^4\Bigg)-(a+b)\Bigg(\Big(\frac{a+b}{2}\Big)^3-a^3\Bigg)+\frac{1}{2}(a^2+4ab+b^2)\Bigg(\Big(\frac{a+b}{2}\Big)^2-a^2\Bigg) - ab(a+b)\Bigg(\Big(\frac{a+b}{2}\Big)-a\Bigg)\
 * $$\displaystyle
 * $$\displaystyle

\end{align} $$
 * }.
 * }.

Simplifying leads to


 * {| style="width:100%" border="0" align="left"

= \frac{1}{32}(b-a)^4 $$
 * $$\displaystyle
 * $$\displaystyle


 * style= |
 * }.
 * }.

Thus the solution becomes


 * {| style="width:100%" border="0" align="left"

$$\displaystyle \left | E_2 \right | = \frac{M_3}{3!}\Bigg(\frac{1}{32}(b-a)^4\Bigg) = \frac{(b-a)^4}{196}M_3 $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.
 * }.

= Problem 15-2(b): Lagrange Error, e(t) =

Given
e(t) is given as:


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle e(t)=\int\limits_{-t}^{t} F(t)\, dt-\dfrac{-t}{3}[F(-t)+fF(t)+F(t)]


 * }
 * }

Find
Determine the third derivative of e(t) which is known to be:


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle e^{(3)}(t)=\dfrac{-t}{3}[F^{(3)}(t)-F^{(3)}(-t)]


 * }
 * }

Solution
e(t) is the summation of two terms:


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle e(t)=\alpha(t)-\alpha_2(t)


 * }
 * }

We must use Leibniz integral rule,

For a monovariant function $$g$$:


 * $$ {d\over dx}\, \int_{f_1(x)}^{f_2(x)} g(t) \,dt = g(f_2(x)) {f_2'(x)} - g(f_1(x)) {f_1'(x)} $$

Using a point k that lies somewhere in the interval [-t,t]:

\alpha (t)=\int\limits_{-t}^{k} F(t)\, dt+\int\limits_{k}^{t} F(t)\, dt $$

Then evaluation of the first term is:


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \alpha^{(1)}(t)=[F(k)+F(-t)]+[F(t)-F(k)]=F(-t)+F(t)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \alpha^{(2)}(t)=[-F^{(1)}(-t)+F^{(1)}(t)]=F^{(1)}(-t)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \alpha^{(3)}(t)=F^{(2)}(t)+F^{(2)}(-t)
 * }
 * }

Evaluation of the second term:



\alpha_2^{(1)}=\dfrac{-1}{3}[F(-t)+4F(0)+F(t)]+\dfrac{t}{3}F^{(1)}(-t)-\dfrac{t}{3}F^{(1)}(t) $$



\alpha_2^{(2)}(t)=\dfrac{1}{3}F^{(1)}(-t)-\dfrac{1}{3}F^{(1)}(t)+\dfrac{1}{3}F^{(1)}(-t)-\dfrac{t}{3}F^{(2)}(-t)-\dfrac{1}{3}F^{(1)}(t)-\dfrac{t}{3}F^{(2)}(t) $$



=\dfrac{2}{3}F^{(1)}(-t)-\dfrac{2}{3}F^{(1)}(t)-\dfrac{-t}{3}F^{(2)}(-t)-\dfrac{t}{3}F^{(2)}(t) $$



\alpha_2^{(3)}(t)=\dfrac{-2}{3}F^{(2)}(-t)-\dfrac{2}{3}F^{(2)}(t)-\dfrac{1}{3}F^{(2)}(-t)+\dfrac{t}{3}F^{(3)}(-t)-\dfrac{1}{3}F^{(2)}(t)-\dfrac{t}{3}F^{(3)}(t) $$



=-F^{(2)}(-t)-F^{(2)}(t)+\dfrac{t}{3}[F^{(3)}(-t)-F^{(3)}(t)] $$

All that remains is to add the two functions $$\alpha_1^{(3)}$$ and $$\alpha_2^{(3)}$$ :



e{(3)}(t)=\alpha^{(3)}(t)+\alpha_2^{(3)}(t)=F^{(2)}(t)+F^{(2)}(-t)-F^{(2)}(-t)-F^{(2)}(t)+\dfrac{t}{3}[F^{(3)}(-t)-F^{(3)}(t)] $$


 * {| style="width:100%" border="0" align="left"

$$ e^{(3)}(t)=\dfrac{-t}{3}[F^{(3)}(t)-F^{(3)}(-t)] $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.

= Problem 9-3(a): Simple to Composite Trapezoidal and Simpson Rules =

Given
Given the simple Trapezoidal:


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I_1=\dfrac{b-a}{2}[f(a)+f(b)]


 * }
 * }

Find
Find the Composite Trapezoidal rule


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I_n=\dfrac{b-a}{n}[\dfrac{1}{2}f_1+f_2+f_3+...+f_{n-1}+\dfrac{1}{2}f_n]


 * }
 * }

Where:



f_1=f(a), $$



f_n=f(b) $$

Solution
Simple trapezoidal rule uses only one trapezoid to calculate area underneath a function extending this principle to more than one trapezoid leads to the composite function.

The area of a trapezoid is:


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle Area=(b-a)\dfrac{h_1+h_2}{2}


 * }
 * }

Where $$h_1$$ and $$h_2$$ would be $$f(a)$$ and $$f(b)$$ respectively

Assuming five equal width trapezoids the base of each would be $$\dfrac{b-a}{5}$$:


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \Rightarrow I_5=\dfrac{b-a}{5}(\dfrac{f_1+f_2}{2}+\dfrac{f_2+f_3}{2}+\dfrac{f_3+f_4}{2}+\dfrac{f_4+f_5}{2})


 * }
 * }

Collecting like terms


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I_5=\dfrac{b-a}{5}(\dfrac{1}{2}f_1+f_2+f_3+f_4+\dfrac{1}{2}f_5)


 * }
 * }

Which displays a recognizable patter


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I_n=\dfrac{b-a}{n}(\dfrac{1}{2}f_1+f_2+...+f_{n-1}+\dfrac{1}{2}f_n)


 * }.
 * }.

= Problem 9-3(b): Simple to Composite Trapezoidal and Simpson Rules =

Given
The simple Simpson's rule:


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I_2=\dfrac{h}{3}[f_0+4f_1+f_2]


 * }.
 * }.

where $$h=\dfrac{b-a}{n}$$ in this case $$n=2$$

Find
Find the composite Simpson's rule known to be


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I_2=\dfrac{h}{3}[f_0+4f_1+2f_2+4f_3+2f_4+...2f_{n-2}+4f_{n-1}+f_n]


 * }.
 * }.

where $$h=\dfrac{b-a}{n}$$

Solution
The simple Simpson's rule comes from calculation of the area underneath a polynomial using two sections

Repeating the pattern of the simple Simpson's rule will yield the composite rule. So if the same function from above is instead split into 5 equal sections then we have the following.



calculation for 2 sets of the sections $$[x_0,x_2]$$ and $$[x_2,x_4]$$ we will obtain


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I([x_0,x_2])=\dfrac{h}{3}[f_0+4f_1+f_2]


 * }
 * }

and


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I([x_2,x_4])=\dfrac{h}{3}[f_2+4f_3+f_4]
 * }
 * }

Combining them gives
 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I([x_0,x_4])=\dfrac{h}{3}[f_0+4f_1+2f_2+4f_3+f_4]
 * }
 * }

Thus producing the obvious pattern


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I_n=\dfrac{h}{3}[f_0+4f_1+2f_2+4f_3+...+2f_{n-2}+4f_{n-1}+f_n]
 * }
 * }

= Problem 12-3(2): =

Given
Given the function:


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle f(x)=log(x)
 * $$\displaystyle f(x)=log(x)
 * $$\displaystyle


 * }
 * }

and


 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle t=2, x_0=3, x_1=4, ..., x_6=9
 * $$\displaystyle t=2, x_0=3, x_1=4, ..., x_6=9
 * $$\displaystyle


 * }
 * }

Find
Plot 3 figures like those on slide [[media:Egm6341.s10.mtg11.pdf|11-2]] for the functions

$$\displaystyle f(x),f_n(x), l_{i,n}(x), q_{n+1}(x)$$

for $$\displaystyle i=3 (x_3=6)$$

and

$$\displaystyle x=5.5$$

Solution
The function f(x) and approximated function are defined as:


 * $$\displaystyle

f(x)=log(x) $$



f_n(x)=\sum_{i=0}^6 l_{i,n}(x)f(x_i)=\sum_{i=0}^6 l_{i,n}(x)log(x_i) $$

Where the Lagrange equation for i=3:



l_{i,n}(x)=\prod_{i=1}^{n} \dfrac{x-x_j}{x_i-x_j} $$

therefore



l_{3,6}(x)=\Big(\frac{x-x_0}{x_3-x_0}\Big)\Big(\dfrac{x-x_1}{x_3-x_1}\Big)\Big(\dfrac{x-x_2}{x_3-x_2}\Big)\Big(\dfrac{x-x_4}{x_3-x_4}\Big)\Big(\dfrac{x-x_5}{x_3-x_5}\Big)\Big(\dfrac{x-x_6}{x_3-x_6}\Big) $$


 * $$\displaystyle

q_{n+1}(t)=(t-x_0)(t-x_1)(t-x_2)...(t-x_n) $$