User:Egm6341.s10.Team4/HW2

= Problem 1: Lagrange Basis Approximation =

Given
Refer Lecture slide 9-1 for problem statement.

From Lecture slide 8-3,


 * {| style="width:90%" border="0" align="center"



p_2(x) = c_2 x^2 + c_1 x + c_0 $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)$$
 * }.
 * }.

Find
We need to approximate Equation (1) using,


 * {| style="width:90%" border="0" align="center"



p_2(x) = \sum_{i=0}^{2} l_i(x_j)f(x_i) $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)$$
 * }.
 * }.

where,


 * {| style="width:90%" border="0" align="center"



l_i(x) = \prod_{j=0,i \ne j}^{2} \frac{x-x_j}{x_i-x_j} $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (3)$$
 * }.
 * }.

and find $$\displaystyle c_0, c_1 \ and\ c_2 $$ in terms of the given points,


 * {| style="width:90%" border="0" align="center"



(x_i,f(x_i)), \ i = 0,1,2 $$
 * $$\displaystyle


 * }.
 * }.

Solution
Equation (3) is given by the following 3 Equations,


 * {| style="width:90%" border="0" align="center"



l_0(x) = \frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)} $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (4)$$
 * }.
 * }.


 * {| style="width:90%" border="0" align="center"



l_1(x) = \frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)} $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (5)$$
 * }.
 * }.


 * {| style="width:90%" border="0" align="center"



l_2(x) = \frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)} $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (6)$$
 * }.
 * }.

Substituting Equations (4), (5) and (6) in (2),


 * {| style="width:90%" border="0" align="center"



p_2(x) = \frac{(x^2-(x_1+x_2)x+x_1x_2)}{(x_0-x_1)(x_0-x_2)} f(x_0) + \frac{(x^2-(x_0+x_2)x+x_0x_2)}{(x_1-x_0)(x_1-x_2)} f(x_1) + \frac{(x^2-(x_0+x_1)x+x_0x_1)}{(x_2-x_0)(x_2-x_1)} f(x_2) $$
 * $$\displaystyle


 * }.
 * }.

Rearranging,


 * {| style="width:90%" border="0" align="center"



\begin{align} \Rightarrow p_2(x) =  & x^2 \underbrace{\left [\frac{f(x_0)}{(x_0-x_1)(x_0-x_2)}  + \frac{f(x_1)}{(x_1-x_0)(x_1-x_2)}  + \frac{f(x_2)}{(x_2-x_0)(x_2-x_1)} \right]}_{c_2} +  \\ & x \underbrace{\left [\frac{-f(x_0)(x_1+x_2)}{(x_0-x_1)(x_0-x_2)}  + \frac{-f(x_1)(x_0+x_2)}{(x_1-x_0)(x_1-x_2)}  + \frac{-f(x_2)(x_0+x_1)}{(x_2-x_0)(x_2-x_1)} \right]}_{c_1}+ \\ & \underbrace{\left [\frac{f(x_0)(x_1x_2)}{(x_0-x_1)(x_0-x_2)} + \frac{f(x_1)(x_0x_2)}{(x_1-x_0)(x_1-x_2)}  + \frac{f(x_2)(x_0x_1)}{(x_2-x_0)(x_2-x_1)} \right]}_{c_0}
 * $$\displaystyle

\end{align} $$


 * }.
 * }.

So,


 * {| style="width:90%" border="0" align="center"

$$\displaystyle
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |

\Rightarrow c_0 = \frac{f(x_0)(x_1x_2)}{(x_0-x_1)(x_0-x_2)}  + \frac{f(x_1)(x_0x_2)}{(x_1-x_0)(x_1-x_2)}  + \frac{f(x_2)(x_0x_1)}{(x_2-x_0)(x_2-x_1)}

$$


 * style= |


 * }.
 * }.


 * {| style="width:90%" border="0" align="center"

$$\displaystyle
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |

\Rightarrow c_1 = \frac{-f(x_0)(x_1+x_2)}{(x_0-x_1)(x_0-x_2)} + \frac{-f(x_1)(x_0+x_2)}{(x_1-x_0)(x_1-x_2)}  + \frac{-f(x_2)(x_0+x_1)}{(x_2-x_0)(x_2-x_1)}

$$
 * style= |
 * }.
 * }.


 * {| style="width:90%" border="0" align="center"

$$\displaystyle \Rightarrow c_2 = \frac{f(x_0)}{(x_0-x_1)(x_0-x_2)} + \frac{f(x_1)}{(x_1-x_0)(x_1-x_2)}  + \frac{f(x_2)}{(x_2-x_0)(x_2-x_1)} $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.
 * }.

Author
Solved and Typed by - Egm6341.s10.Team4.andy 21:55, 17 February 2010 (UTC) .

= Problem 2: Proof of simple simpson's rule =

Given
Use equation (4) on slide [[media:Egm6341.s10.mtg8.pdf|8-3]], which is:


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

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle P_2(x_j)=\sum_{k=0}^2 l_i(x_j)f(x_i)=f(x_j)


 * }.
 * }.

Find
to derive equation (simple simpson's rule Use following Integration (2) on slide [[media:Egm6341.s10.mtg7.pdf|7-2]], which is:


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

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle I_2=\dfrac{h}{3}[f(x_0)+4f(x_1)+f(x_2)]              ;             h=\dfrac{b-a}{2}


 * }.
 * }.

Solution
The primary equation is following polynomial:



P_2(x)=\sum_{i=0}^2 l_i(x)f(x_i)=f_n(x) $$

From the lagrange equation we have:



l_i(x)=\prod_{i=1}^{N} \dfrac{x-x_j}{x_i-x_j} \Rightarrow l_0(x)=\dfrac{x-x_1}{x_0-x_1}\times\dfrac{x-x_2}{x_0-x_2} $$



\Rightarrow I_2=\int\limits_{x_0}^{x_2} P_2(x)\, dx=\int\limits_{x_0}^{x_2} \sum_{i=0}^2 l_i(x)f(x_i)\, dx=\int\limits_{x_0}^{x_2} [l_0(x)f(x_0)+l_1(x)f(x_1)+l_2(x)f(x_2)]\, dx $$

Similarly for other $$ l_i(x) $$ we can write:



l_1(x)=\dfrac{x-x_0}{x_1-x_0}\times\dfrac{x-x_2}{x_1-x_2} $$



l_2(x)=\dfrac{x-x_0}{x_2-x_0}\times\dfrac{x-x_1}{x_2-x_1} $$



\Rightarrow I_2=\int\limits_{x_0}^{x_2} [\dfrac{x-x_1}{x_0-x_1}\times\dfrac{x-x_2}{x_0-x_2}f(x_0)+\dfrac{x-x_0}{x_1-x_0}\times\dfrac{x-x_2}{x_1-x_2}f(x_1)+\dfrac{x-x_0}{x_2-x_0}\times\dfrac{x-x_1}{x_2-x_1}f(x_2)]\, dx $$



=\int\limits_{x_0}^{x_2} \dfrac{x-x_1}{x_0-x_1}\times\dfrac{x-x_2}{x_0-x_2}f(x_0)\, dx+\int\limits_{x_0}^{x_2} \dfrac{x-x_0}{x_1-x_0}\times\dfrac{x-x_2}{x_1-x_2}f(x_1)\, dx+\int\limits_{x_0}^{x_2} \dfrac{x-x_0}{x_2-x_0}\times\dfrac{x-x_1}{x_1-x_2}f(x_2)\, dx= $$



=\dfrac{f(x_0)}{(x_0-x_1)(x_0-x_2)}\int\limits_{x_0}^{x_2} (x^2-x_2x-x_1x+x_1x_2)\, dx+\dfrac{f(x_1)}{(x_1-x_0)(x_1-x_2)}\int\limits_{x_0}^{x_2} (x^2-x_2x-x_0x+x_0x_2)\, dx+\dfrac{f(x_2)}{(x_2-x_0)(x_2-x_1)}\int\limits_{x_0}^{x_2} (x^2-x_0x-x_1x+x_0x_1)\, dx= $$



=\dfrac{f(x_0)}{(x_0-x_1)(x_0-x_2)}[\dfrac{x^3}{3}-x_2\dfrac{x^2}{2}-x_1\dfrac{x^2}{2}+x_1x_2x]+\dfrac{f(x_1)}{(x_1-x_0)(x_1-x_2)}[\dfrac{x^3}{3}-x_2\dfrac{x^2}{2}-x_0\dfrac{x^2}{2}+x_0x_2x]+\dfrac{f(x_2)}{(x_2-x_0)(x_2-x_1)}[\dfrac{x^3}{3}-x_0\dfrac{x^2}{2}-x_1\dfrac{x^2}{2}+x_0x_1x] $$

If we name these three terms by u, v and w, respectively:



u=\dfrac{f(x_0)}{(x_0-x_1)(x_0-x_2)}[\dfrac{x_2^3}{3}-\dfrac{x_2^3}{2}-x_1\dfrac{x_2^2}{2}+x_1x_2^2-\dfrac{x_0^3}{3}+x_2\dfrac{x_0^2}{2}+x_1\dfrac{x_0^2}{2}-x_0x_1x_2] $$

Since,



x_0=a; x_1=\dfrac{a+b}{2}; x_2=b $$

And since,



(x_0-x_1)=-h;(x_0-x_2)=-2h; $$

We can rewrite the value of u as follows:



u=\dfrac{f(x_0)}{2h^2}[\dfrac{-b^3}{6}+(\dfrac{b+a}{4})b^2-\dfrac{a^3}{3}+\dfrac{a^2}{2}(\dfrac{3b+a}{2})-ab(\dfrac{b+a}{2})]= $$



u=\dfrac{f(x_0)}{2h^2}[\dfrac{b^3}{12}-\dfrac{a^3}{12}-\dfrac{ab^2}{4}+\dfrac{ba^2}{4}]=\dfrac{f(x_0)}{24h^2}(b^3-a^3-3ab^2+3ba^2)=\dfrac{f(x_0)}{24h^2}(b-a)^3=\dfrac{f(x_0)}{24h^2}\times(2h)^3=\dfrac{f(x_0)}{24h^2}\times8h^3 $$



\Rightarrow u=\dfrac{h\times f(x_0)}{3} $$

Similarly, for v and w we obtain:



v=\dfrac{f(x_1)}{-h^2}[\dfrac{-b^3}{6}+\dfrac{ab^2}{2}+\dfrac{a^3}{6}-\dfrac{ba^2}{2}]=\dfrac{f(x_1)}{6h^2}(b-a)^3=\dfrac{f(x_1)}{6h^2}(2h)^3=\dfrac{f(x_1)}{6h^2}8h^3 $$



\Rightarrow v=\dfrac{h\times 4f(x_1)}{3} $$



w=\dfrac{f(x_2)}{2h^2}[\dfrac{b^3}{3}-a\dfrac{b^2}{2}-\dfrac{a+b}{2}(\dfrac{b^2}{2})+a(\dfrac{a+b}{2})b-\dfrac{a^3}{3}+\dfrac{a^3}{2}+\dfrac{a+b}{2}(\dfrac{a^2}{2})-\dfrac{a+b}{2}a^2]= $$



w=\dfrac{f(x_2)}{2h^2}[\dfrac{b^3}{12}-\dfrac{a^3}{12}-\dfrac{ab^2}{4}+\dfrac{ba^2}{4}]=\dfrac{f(x_2)}{24h^2}(b^3-a^3-3ab^2+3ba^2)=\dfrac{f(x_0)}{24h^2}(b-a)^3=\dfrac{f(x_2)}{24h^2}\times(2h)^3=\dfrac{f(x_2)}{24h^2}\times8h^3 $$



\Rightarrow u=\dfrac{h\times f(x_2)}{3} $$

Eventually, by adding u, v and w, we gain the entire equation:


 * {| style="width:60%" border="0"

$$ I_2=\dfrac{h}{3}[f(x_0)+4f(x_1)+f(x_2)] $$
 * style="width:30%; padding:10px; border:1px solid #8888aa" |
 * style="width:30%; padding:10px; border:1px solid #8888aa" |
 * style= |
 * }.

Author
Solved and Typed by - Egm6341.s10.Team4.nimaa&amp;m 02:37, 18 February 2010 (UTC) .

=Problem 3: Newton Cotes Application=

Given

 * {| style="width:70%" border="0" align="center"



f(x) = \frac{e^x - 1}{x}$$ on the interval [0,1].
 * $$\displaystyle

Consider n=0,1,2,4,8,16.
 * $$\displaystyle $$
 * }.
 * }.

Find

 * {| style="width:70%" border="0" align="center"



Construct $$ \displaystyle f_n(x)= \sum_{i=0}^n l_{i,n}(x)f(x_i)$$ a) Plot $$ \displaystyle f,f_n, n=1,2,4,8,16. $$ b) Compute $$ I_n= \int_{a}^{b}f_n(x)dx, n=1,2,4,8,16. $$ c) Plot $$ \displaystyle l_0, l_1, l_2, for n=4 $$
 * $$\displaystyle $$
 * }.
 * }.

Solution
From Newton Cotes formula, we have $$ \displaystyle f_n(x)= \sum_{i=0}^n l_{i,n}(x)f(x_i)$$                                                       $$\displaystyle  l_{i,n}(x)= \displaystyle\prod_{\underset{j\neq i}{j=0}}^{N}\frac{x-x_j}{x_i-x_j}$$

fn(x) has been constructed using matlab and its plots are shown below

Matlab Code: Plots: .

The function f(x) has been plotted and the plot is shown below: Plot of f(x) .

The value of In has been computed for different values of n in matlab and the details are tabulated below: $$\begin{array}{|c||c|c|c|c|c|c|c|c|c|c|c}\hline n & 1 & 2 & 4 & 8 & 16 \\ \hline I_n&1.3591&1.3180&1.3179&1.3179&1.3179\\ \hline \end{array} $$.

For n=4, the plots of $$l_0,l_1,l_2$$ are shown below including the matlab code: Matlab Code:

Plots: . . . Plot for $$\displaystyle l_3$$:

..

Plot for $$\displaystyle l_4$$:

.

The plots of $$\displaystyle l_3,l_4 $$ need not be looked at, since they are just the mirror images about $$\displaystyle x = 0.5$$, of the plots of $$\displaystyle l_1,l_0 $$ respectively.

Author
Solved and Typed by - Egm6341.s10.team4.anandankala 13:43, 19 February 2010 (UTC) .

= Problem 4: From simple Trap. rule and simple Simpson's rule to the composite types =

Given
The simple Trapezoidal rule equation is written as follows:


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

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

Also, the simple Simpson's rule equation is written as: $$
 * $$\displaystyle I_2=\dfrac{h}{3}[f(x_0)+4f(x_1)+f(x_2)]
 * $$\displaystyle I_2=\dfrac{h}{3}[f(x_0)+4f(x_1)+f(x_2)]


 * }
 * }

Find
Show that from these two simple forms of equations we can develop composite forms of them respectively, as below:
 * {| style="width:100%" border="0" align="left"

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

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


 * }
 * }

Solution
Part 1: For Trapezoidal rule, for one interval (n=1) and h equal to width of the interval (a is start point and b is the end point), we have:



I_1=\dfrac{x_1-x_0}{2}(f(x_0)+f(x_1)) $$

When we take two intervals (n=2) and h equal to width of each interval:



I_2=\dfrac{x_1-x_0}{2}(f(x_0)+f(x_1))+\dfrac{x_2-x_1}{2}(f(x_1)+f(x_2)) $$



\Rightarrow I_2=\dfrac{h}{2}(f(x_0)+2f(x_1)+f(x_2)) $$

By continuing this procedure for 4 intervals, we gain:



I_4=\dfrac{x_1-x_0}{2}(f(x_0)+f(x_1))+\dfrac{x_2-x_1}{2}(f(x_1)+f(x_2))+\dfrac{x_3-x_2}{2}(f(x_2)+f(x_3))+\dfrac{x_4-x_3}{2}(f(x_3)+f(x_4)) $$



\Rightarrow I_4=\dfrac{h}{2}(f(x_0)+2f(x_1)+2f(x_2)+2f(x_3)+f(x_4)) $$

Thus, when n intervals are selected, this procedure can be resulted in:



\Rightarrow I_n=h(\dfrac{1}{2}f(x_0)+f(x_1)+f(x_2)+...+f(x_{n-1})+\dfrac{1}{2}f(x_{n})) $$

Part 2: Similarly, when we have 2 intervals for Simpson's rule (trivially h is the width of each one), we can write following from the simple case:



I_2=\dfrac{h}{3}(f(x_0)+4f(x_1)+f(x_2)) $$

For 4 intervals, we can extend the above equation to:



I_4=\dfrac{h}{3}(f(x_0)+4f(x_1)+f(x_2))+\dfrac{h}{3}(f(x_2)+4f(x_3)+f(x_4)) $$



\Rightarrow I_4=\dfrac{h}{3}(f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+f(x_4)) $$

For 6 intervals, we can extend the above equation to:



I_6=\dfrac{h}{3}(f(x_0)+4f(x_1)+f(x_2))+\dfrac{h}{3}(f(x_2)+4f(x_3)+f(x_4))+\dfrac{h}{3}(f(x_4)+4f(x_5)+f(x_6)) $$



\Rightarrow I_6=\dfrac{h}{3}(f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+4f(x_5)+f(x_6)) $$

Thus, when n intervals are selected, this pattern can be translated in:



I_n=\dfrac{h}{3}(f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+...+2f(x_{n-2})+4f(x_{n-1})+f(x_n)) $$

Author
Solved by ---Egm6341.s10.Team4.roni 05:11, 18 February 2010 (UTC)

Typed and reviewed by - Egm6341.s10.Team4.nimaa&amp;m 02:38, 18 February 2010 (UTC) .

= Problem 5: Comparison of Error between Taylor series and Newton-Cotes formula =

Given
Refer Lecture slide 11-1 for problem statement
 * {| style="width:100%" border="0" align="left"

f(x) = \sin(x) $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle x \in [0,\pi] $$
 * $$\displaystyle \longrightarrow (1)$$
 * }.
 * }.

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

\left | f^T_n\Big(\frac{7\pi}{8}\Big)-f\Big(\frac{7\pi}{8}\Big) \right | \le \underbrace{\left | f^L_4\Big(\frac{7\pi}{8}\Big)-f\Big(\frac{7\pi}{8}\Big) \right |}_{\left | E^L_4(\frac{7\pi}{8})\right |} \le \frac{\left | q_5(\frac{7\pi}{8}) \right |}{5!} $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)$$
 * }.
 * }.

Solution
$$\displaystyle f^L_4\Big(\frac{7\pi}{8}\Big)$$, $$\displaystyle \left | E^L_4(\frac{7\pi}{8})\right |$$, $$\displaystyle \frac{\left | q_5(\frac{7\pi}{8}) \right |}{5!}$$, is claculated using Matlab.


 * $$\displaystyle f^L_4\Big(\frac{7\pi}{8}\Big) = \sum_{i=0}^4 l_{i,4}\Big(\frac{7\pi}{8}\Big)\sin(x_i)= 0.3812$$
 * $$\displaystyle \left | E^L_4(\frac{7\pi}{8})\right | = 0.0014808$$
 * $$\displaystyle \frac{\left | q_5(\frac{7\pi}{8}) \right |}{5!} = 0.0081716$$

At first, we can confirm that the seconde inequality of Equation(2)


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

\left | E^L_4(\frac{7\pi}{8})\right | = 0.0014808 \le \displaystyle \frac{\left | q_5(\frac{7\pi}{8}) \right |}{5!} = 0.0081716 $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (3)$$
 * }.
 * }.

Then, the Taylor series were calculated until the Error or taylor become smaller than that of Newton-Cotes formula at n=4. the result is like that

$$ \begin{array}{|c||c|c|} n & E^T_n(t) & E^T_n(t) - E^L_4(t) \\ \hline 1&1.7128&1.7113\\ 2&0.34976&0.3483\\	3&0.54236&0.5409\\ 4&0.10444&0.1030\\ 5&0.067533&0.0661\\	6&0.011256&0.0098\\	7&0.0045295&0.0030\\	8&0.00065513&-0.0008\\ \hline \end{array} $$

Matlab Code: .

Author
Solved and Typed by - Egm6341.s10.Team4.yunseok 02:03, 18 February 2010 (UTC) .

= Problem 6: Evaluation of (n+1)$$^{th}$$ Derivative of E(x) =

Given
We know that E(x) is defined as $$ \displaystyle\ E(x)=f(x)-f_n(x)$$.

Find
We are asked to show that the $$(n+1)^{th}$$ derivative of our error $$ \displaystyle\ E(x)=f(x)-f_n(x)$$ is $$\displaystyle\ E^{(n+1)}(x)=f^{(n+1)}(x)$$.

Solution
Assuming that $$ \displaystyle\ f_n(x)$$ is n+1 times differentiable, then $$ \displaystyle\ E_n^{(n+1)}(x)=f^{(n+1)}(x)-f_n^{(n+1)}(x)$$.

Let us assume because $$ \displaystyle\ f_n(x) \epsilon P_n$$, $$ \displaystyle\ f_n(x)$$ takes the form $$ \displaystyle\ f_n(x)=a_nx^n+a_{n-1}x^{n-1}+...+a_1x+a_0$$.

We also know that $$ \displaystyle\ f_n(x) \epsilon P_n $$. Taking the $$n^{th}$$ derivative of $$ \displaystyle\ f_n(x)$$, we see that $$ \displaystyle\ f^{(n)}_n(x)=(n!)a_n$$, a constant. Taking the $$(n+1)^{th}$$ derivative of $$ \displaystyle\ f_n(x)$$, we see that $$ \displaystyle\ f^{(n+1)}_n(x)=0$$.

Substituting this back into our equation for $$ \displaystyle\ E^{(n+1)}_n(x)$$, we see that $$ \displaystyle\ E^{(n+1)}(x)=f^{(n+1)}-f^{(n+1)}_n(x)=f^{(n+1)}(x)-(0)=f^{(n+1)}(x)$$.

Author
Solved and Typed by - Egm6341.s10.Team4.riherd 14:56, 18 February 2010 (UTC) .

= Problem 7: Lagrange Error Term =

Given
Refer Lecture slide 12-3 for problem statement.

From Equation 4 of Lecture slide 10-1,


 * {| style="width:90%" border="0" align="center"



q_{n+1}(x) := (x - x_0)(x - x_1)(x - x_2)(x - x_3)\cdots(x - x_n) $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)$$
 * }.
 * }.

Find
Show that the $$\displaystyle (n+1)^{th} $$ derivative of $$\displaystyle q_{n+1}(x) $$ is $$\displaystyle (n+1)! $$, i.e.,


 * {| style="width:90%" border="0" align="center"



q_{n+1}^{(n+1)}(x) = (n+1)! $$
 * $$\displaystyle


 * }.
 * }.

Solution
Clearly from Equation (1),


 * {| style="width:90%" border="0" align="center"



q_{n+1}(x) \in \mathcal{P}_{n+1} $$
 * $$\displaystyle


 * }.
 * }.

where $$\displaystyle \mathcal{P}_{n+1} $$ is a set of polynomials of order $$\displaystyle \le n+1 $$.

So, Equation (1) can be written as,


 * {| style="width:90%" border="0" align="center"



q_{n+1}(x) = a_{n+1} x^{n+1} + a_{n} x^{n} + a_{n-1} x^{n-1} + \cdots + a_{0} x^{0} $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)$$
 * }.
 * }.

Please note that $$\displaystyle a_{n+1} = 1 $$ in Equation (2).

On differentiating Equation (2), 1 time,


 * {| style="width:90%" border="0" align="center"



q_{n+1}^{1}(x) = (n+1) x^{n} + na_{n} x^{n-1} + (n-1)a_{n-1} x^{n-2} + \cdots + a_{1} $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (3)$$
 * }.
 * }.

On differentiating Equation (2), 2 times,


 * {| style="width:90%" border="0" align="center"



q_{n+1}^{2}(x) = (n+1)(n) x^{n-1} + n(n-1)a_{n} x^{n-2} + (n-1)(n-2)a_{n-1} x^{n-3} + \cdots + 2a_{2} $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (4)$$
 * }.
 * }.

On differentiating Equation (2), n times,


 * {| style="width:90%" border="0" align="center"



q_{n+1}^{n}(x) = (n+1)(n)\cdots(2) x^{1} + n(n-1)\cdots(2)a_{n}x^0 $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (5)$$
 * }.
 * }.

This can be realized by induction [in Equation (3), the constant term is $$\displaystyle a_1 $$ after differentiating 1 time; the constant term is $$\displaystyle 2a_2 $$ after differentiating 2 times;].

Differentiating Equation (5) one more time,


 * {| style="width:90%" border="0" align="center"



\begin{align} \Rightarrow q_{n+1}^{(n+1)}(x) &= (n+1)(n)\cdots(2)(1) \cancelto{1}{x^{1}} + n(n-1)\cdots(2)a_{n}\cancelto{0}{x^0} \\ &= (n+1)(n)\cdots(2)(1) \end{align} $$
 * $$\displaystyle


 * }.
 * }.

So,


 * {| style="width:90%" border="0" align="center"

$$\displaystyle
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |

\Rightarrow q_{n+1}^{(n+1)}(x) = (n+1)!

$$


 * style= |


 * }.
 * }.

Author
Solved and Typed by - Egm6341.s10.Team4.andy 21:56, 17 February 2010 (UTC) .

= Problem 8: Lagrange Interpolation of the Natural Logarithm =

Given
Let function $$\displaystyle f(x)$$ and $$\displaystyle t=2, x_0=3, x_1=4, ..., x_6=9$$


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

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


 * }
 * }

Find
Plot 3 figures similar to plotted graphs on slide [[media:Egm6341.s10.mtg11.pdf|11-2]] showing following 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 primary function f(x) and estimated function by Newton-Cotes formula will be 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 is introduced with below equation for i=3:



l_{i,n}(x)=\prod_{i=1}^{n} \dfrac{x-x_j}{x_i-x_j} \Rightarrow l_{3,6}(x)=\dfrac{x-x_0}{x_3-x_0}\times\dfrac{x-x_1}{x_3-x_1}\times\dfrac{x-x_2}{x_3-x_2}\times\dfrac{x-x_4}{x_3-x_4}\times\dfrac{x-x_5}{x_3-x_5}\times\dfrac{x-x_6}{x_3-x_6} $$


 * $$\displaystyle

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

Constructing these fucntions by the Matlab codes, facilitate us to attain following graphs:

Ultimately, the error of interpolation error theorem can be attained as following for this problems for at t=2 and x=5.5 by n=1000.

$$ \begin{array}{|c||c|c|} x & q_{n+1}(t) & f(t) - f_n(t) \\ \hline t=2&-5040&0.003887\\ x=5.5&12.30469&-4.1086E^{-6}\\ \hline \end{array} $$

Matlab Code: .

Author
Solved and Typed by - Egm6341.s10.Team4.nimaa&amp;m 02:39, 18 February 2010 (UTC) .

= Problem 9: Proof of error for simple trapezoidal rule =

Given
Refer to Lecture slide 13-2 for problem statement
 * {| style="width:100%" border="0" align="left"

\begin{align} n=1, \\ & q_2(x)=(x-x_o)(x-x_1)\\ & x_o=a, x_1=b, \end{align} $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

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

\left | E_1 \right | = \frac{M_2}{2!}\int_{a}^{b}\left|q_2(x) \right |\, dx = \frac{M_2}{2!}\int_{a}^{b}\left|(x-x_o)(x-x_1) \right |\frac{(b-a)^3}{12}M_2 $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

Solution

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

\begin{align} \dfrac {M_2}{2!}\int\limits_{a}^{b} (x-a)(b-x)\, dx=\dfrac{M_2}{2!}\int\limits_{a}^{b} (bx-x^2-ab+ax)\, dx=\dfrac{M_2}{2!}[\dfrac{bx^2}{2}-\dfrac{x^3}{3}-abx+\dfrac{ax^2}{2}]\, \Big |^b_a\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.



\dfrac{M_2}{2!}[\dfrac{b^3}{2}-\dfrac{b^3}{3}-ab^2+\dfrac{ab^2}{2}-\dfrac{ba^2}{2}+\dfrac{a^3}{3}+a^2b-\dfrac{a^3}{2}]=\dfrac{M_2}{2!}[\dfrac{b^3}{6}-\dfrac{a^3}{6}-\dfrac{ab^2}{2}+\dfrac{a^2b}{2}]=\dfrac{M_2}{12}[b^3-a^3-3ab^2+3a^2b]=\dfrac{M_2}{12}(b-a)^3=\dfrac{M^2}{12}h^3 $$


 * {| style="width:30%" border="0"

$$ \Rightarrow \left | E_1 \right | = \frac{M_2}{2!}\int_{a}^{b}\left|q_2(x) \right |\, dx=\dfrac{M^2}{12}h^3 $$
 * style="width:10%; padding:10px; border:1px solid #8888aa" |
 * style="width:10%; padding:10px; border:1px solid #8888aa" |
 * style= |
 * }.

Author
Solved by --Egm6341.s10.Team4.roni 05:13, 18 February 2010 (UTC) and

Typed by - Egm6341.s10.Team4.nimaa&amp;m 02:40, 18 February 2010 (UTC) .

= Problem 10: Proof of Error of Simple simpson's rule=

Given
Refer Lecture slide 13-2 for problem statement
 * {| style="width:100%" border="0" align="left"

\begin{align} n=2, \\ & q_3(x)=(x-x_o)(x-x_1)(x-x_2)\\ & 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 | \le \frac{M_3}{3!}\int_{a}^{b}\left|(x-x_o)(x-x_1)(x-x_2) \right |\, dx = \frac{(b-a)^4}{192}M_3 $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (1)$$
 * }.
 * }.

Solution

 * {| 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{3(a+b)}{2}x^2+\frac{1}{2}(a^2+4ab+b^2)x - \frac{1}{2}ab(a+b)\, 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\\ &=\underbrace{\frac{1}{2}\Bigg(\Big(\frac{a+b}{2}\Big)^4-a^4\Bigg)}_{1st}-\underbrace{(a+b)\Bigg(\Big(\frac{a+b}{2}\Big)^3-a^3\Bigg)}_{2nd}+\underbrace{\frac{1}{2}(a^2+4ab+b^2)\Bigg(\Big(\frac{a+b}{2}\Big)^2-a^2\Bigg)}_{3rd} - \underbrace{ab(a+b)\Big(\frac{a+b}{2}-a\Big)}_{4th} \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

1st and 3rd term can be bundled by $$\displaystyle \frac{1}{2}\Bigg(\Big(\frac{a+b}{2}\Big)^2-a^2\Bigg)$$


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

\begin{align} &=\frac{1}{2}\Bigg(\Big(\frac{a+b}{2}\Big)^2-a^2\Bigg)\Bigg(\Big(\frac{a+b}{2}\Big)^2+a^2+(a^2+4ab+b^2)\Bigg)\\ &=\frac{1}{2}\Bigg(\Big(\frac{a+b}{2}\Big)+a\Bigg)\Bigg(\Big(\frac{a+b}{2}\Big)-a\Bigg)\Big(\frac{a^2+2ab+b^2}{4}+2a^2+4ab+b^2\Bigg)\\ &=\frac{1}{32}(3a+b)(b-a)(9a^2+18ab+5b^2)\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * {| style="width:１０0%" border="0" align="left"
 * {| style="width:１０0%" border="0" align="left"

$$\displaystyle =\frac{1}{32}(b-a)(27a^3+63a^2b+33ab^2+5b^3) $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (2)$$
 * style= |
 * }.
 * }.

2nd and 4th term can be bundled by $$\displaystyle -(a+b)\Big(\frac{a+b}{2}-a\Big)$$
 * {| style="width:100%" border="0" align="left"

\begin{align} &=-(a+b)\Big(\frac{a+b}{2}-a\Big)\Bigg(\Big(\frac{a+b}{2}\Big)^2+\frac{a+b}{2}a + a^2 + ab \Bigg)\\ &=-\frac{1}{8}(a+b)(b-a)(7a^2+8ab+b^2)\\ &=-\frac{1}{8}(b-a)(7a^3+15a^2b+9ab^2+b^3)\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * {| style="width:100%" border="0" align="left"

$$\displaystyle =-\frac{1}{32}(b-a)(28a^3+60a^2b+36ab^2+4b^3) $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (3)$$
 * style= |
 * }.
 * }.

Then, (2) + (3),
 * {| style="width:100%" border="0" align="left"

\begin{align} &\int_{a}^{b}\left|(x-a)(x-\frac{a+b}{2})(x-b) \right |\, dx\\ &=\frac{1}{32}(b-a)(27a^3+63a^2b+33ab^2+5b^3)-\frac{1}{32}(b-a)(28a^3+60a^2b+36ab^2+4b^3)\\ &=\frac{1}{32}(b-a)\Big((27a^3+63a^2b+33ab^2+5b^3)-(28a^3+60a^2b+36ab^2+4b^3)\Big)\\ &=\frac{1}{32}(b-a)(-a^3+3a^2b-3ab^2+b^3)\\ &=\frac{1}{32}(b-a)(b-a)^3\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

$$\displaystyle = \frac{1}{32}(b-a)^4 $$
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (4)$$
 * style= |
 * }.
 * }.

So, plug in (4) to (1) equation.


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

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

Author
Solved and Typed by - Egm6341.s10.Team4.yunseok 02:04, 18 February 2010 (UTC) .

= Problem 11: Comparison of $$I $$ and $$I_2$$ of 3rd order polynomial =

Given
Refer Lecture slide 13-3 for problem statement
 * {| style="width:70%" border="0" align="left"

f(x)=6x^3-2x^2+8x+3 $$ x \in [0,1] $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

Find
Find $$\displaystyle I, I_2$$ (simpson's rule) and compare them.


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

\begin{align} &I=\int_{0}^{1} 6x^3-2x^2+8x+3,\ dx\\ &I_2=\frac{h}{3}\Big[f(x_0)+4f(x_1)+f(x_2)\Big] \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Solution
$$\displaystyle I $$ is integrated like that
 * {| style="width:100%" border="0" align="left"

\begin{align} I&=\int_{0}^{1} 6x^3-2x^2+8x+3,\ dx\\ &= \frac{6}{4}x^4-\frac{2}{3}x^3+\frac{8}{2}x^2+3x \Big|^1_0 \\ &= \frac{3}{2}(1^4-0^4)-\frac{2}{3}(1^3-0^3)+4(1^2-0^2)+3(1-0)\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

$$\displaystyle I= \frac{3}{2}-\frac{2}{3}+4+3= \frac{47}{6} $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (1)$$
 * style= |
 * }.
 * }.

$$\displaystyle I_2 $$ is,
 * {| style="width:100%" border="0" align="left"

I_2=\frac{h}{3}\Big[f(x_0)+4f(x_1)+f(x_2)\Big] $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

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

\begin{align} &h=\frac{1}{2}\\ &f(x_0)=f(0)=3\\ &f(x_1)=f(\frac{1}{2})=6(\frac{1}{2})^3-2(\frac{1}{2})^2+8(\frac{1}{2})+3 = \frac{6}{8} - \frac{2}{4} + \frac{8}{2}+3 = \frac{29}{4}\\ &f(x_2)=f(1)=6(1)^3-2(1)^2+8(1)+3 =6-2+8+3 = 15\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

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

$$\displaystyle I_2=\frac{h}{3}\Big[f(x_0)+4f(x_1)+f(x_2)\Big] = \frac{(\frac{1}{2})}{3}\Big[3+4\frac{29}{4}+15\Big]=\frac{47}{6} $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (2)$$
 * style= |
 * }.
 * }.

in coclusion, From equation $$\displaystyle (1) ,\ (2)$$,

$$\displaystyle I$$ and $$\displaystyle I_2$$ is same for 3rd polynomial equation


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

$$\displaystyle I=I_2=\frac{47}{6} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.
 * }.

Author
Solved and Typed by - Egm6341.s10.Team4.yunseok 02:10, 18 February 2010 (UTC) .

=Problem 12: Evaluation of $$ \alpha^{(1)}(t)$$=

Given
$$ \displaystyle\ \alpha(t)=\int_{-t}^{t} f(x(t'))dt'$$ where $$ \displaystyle\ f(x(t))=F(t)$$.

Find
Show that $$ \displaystyle\ \alpha^{(1)}(t)=F(-t)+F(t) $$.

Solution
We are asked to show that for $$ \displaystyle\ \alpha(t)=\int_{-t}^{t} f(x(t'))dt'=\int_{-t}^{t} F(t')dt',\alpha^{(1)}(t)=F(-t)+F(t)$$, where $$ \displaystyle\ f(x(t))=F(t)$$.

Using The Fundamental Theorem of Calculus (Second Part), we know that for some differentiable function $$ \displaystyle\ G(t)$$ with with derivative $$ \displaystyle\ g(t)=G'(t)$$, $$ \displaystyle\ \int_a^b g(t)dt=G(b)-G(a)$$.

Allowing $$ \displaystyle\ f(x(t))=F(t)$$ and $$ \displaystyle\ G'(t)=F(t)$$, then $$ \displaystyle\ \alpha(t)=\int_{-t}^{t} F(t')dt'=G(t)-G(-t)$$.

If the derivative of $$ \displaystyle \alpha $$ is now taken, the $$ \displaystyle\ \alpha^{(1)}(t)=\frac{d}{dt}(G(t)-G(-t))=G'(t)+G'(-t)$$.

Substituting in our definitions $$ \displaystyle\ F(t)=G'(t)$$ we see that

$$ \displaystyle\ \alpha^{(1)}(t)=F(-t)+F(t) $$.

Author
Solved and Typed by - Egm6341.s10.Team4.riherd 14:55, 18 February 2010 (UTC) .

= Problem 13: Evaluation of $$ G^{2}(0) $$ =

Given
Refer Lecture slide 15-2 for problem statement

From Lecture slide 15-1,


 * {| style="width:90%" border="0" align="center"



G^{1}(t) = e^{1}(t) - 5t^4e(1) $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (1)$$
 * }
 * }

where,


 * {| style="width:90%" border="0" align="center"



e(t) := \alpha(t) - \alpha_{2}(t) $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (2)$$
 * }
 * }

where $$\displaystyle \alpha(t), \alpha_{2}(t) $$ are given by,


 * {| style="width:90%" border="0" align="center"



\alpha(t) := \int_{-t}^{t}F(t)dt $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (3)$$
 * }
 * }


 * {| style="width:90%" border="0" align="center"



\alpha^{2}(t) := \frac{t}{3} \left[F(-t) + 4F(0)+ F(t)\right] $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (4)$$
 * }
 * }

and,


 * {| style="width:90%" border="0" align="center"



F(t) := f(x(t)) $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (5)$$
 * }.
 * }.

Find
Show that,


 * {| style="width:90%" border="0" align="center"



G^{2}(0) = 0 $$
 * $$\displaystyle


 * }.
 * }.

Solution
On differentiating Equation (3) [Please refer differentiating an integral and Problem 14 Solution below],


 * {| style="width:90%" border="0" align="center"



\alpha^{1}(t) = F(-t) + F(t) $$.
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (6)$$
 * }
 * }

Again differentiating Equation (6),


 * {| style="width:90%" border="0" align="center"



\alpha^{2}(t) = -F(-t) + F(t) $$.
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (7)$$
 * }
 * }

On differentiating Equation (4),
 * {| style="width:90%" border="0" align="center"



\begin{align} \Rightarrow \alpha_{2}^{1}(t) &= \frac{1}{3} \left[ F(-t) + 4F(0) + F(t) \right] + \frac{t}{3} \left[-F^{1}(-t) + \cancelto{0}{4F^{1}(0)} + F^{1}(t)\right] \\ &= \frac{1}{3} \left[ F(-t) + 4F(0) + F(t) \right] + \frac{t}{3} \left[-F^{1}(-t) + F^{1}(t)\right] \end{align} $$
 * $$\displaystyle


 * }.
 * }.

Again on differentiating the above equation,


 * {| style="width:90%" border="0" align="center"



\begin{align} \Rightarrow \alpha_{2}^{2}(t) &= \frac{1}{3} \left[ -F^{1}(-t) + \cancelto{0}{4F^{1}(0)} + F^{1}(t) \right] + \frac{1}{3} \left[-F^{1}(-t) + F^{1}(t)\right] + \frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right]\\ &= \frac{2}{3} \left[ -F^{1}(-t) + F^{1}(t) \right] + \frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right] \end{align} $$
 * $$\displaystyle


 * }.
 * }.

So,


 * {| style="width:90%" border="0" align="center"




 * $$\displaystyle

\Rightarrow \alpha_{2}^{2}(t) = -\frac{2}{3} F^{1}(-t) + \frac{2}{3} F^{1}(t) + \frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right]

$$
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (8)$$
 * }.
 * }.

On differentiating Equation (1) we get,


 * {| style="width:90%" border="0" align="center"



G^{2}(t) = e^{2}(t) - 20t^3e(1) $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (9)$$
 * }.
 * }.

At point $$\displaystyle t = 0 $$,


 * {| style="width:90%" border="0" align="center"



G^{2}(0) = e^{2}(0) - \cancelto{0}{20(t)^3e(1)} \Rightarrow G^{2}(0) = e^{2}(0) $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (10)$$
 * }.
 * }.

$$\displaystyle e^{2}(t) $$ is given by differentiating Equation (2) twice,


 * {| style="width:90%" border="0" align="center"



e^{2}(t) = \alpha^{2}(t) - \alpha_{2}^{2}(t) $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (11)$$
 * }.
 * }.

Substituting Equations (7) and (8) in (11),


 * {| style="width:90%" border="0" align="center"



\Rightarrow e^{2}(t) = -F(-t) + F(t) +\frac{2}{3} F^{1}(-t) - \frac{2}{3} F^{1}(t) - \frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right] $$
 * $$\displaystyle


 * }.
 * }.

At point $$\displaystyle t = 0 $$,


 * {| style="width:90%" border="0" align="center"



\begin{align} \Rightarrow e^{2}(0) &= -F(-0) + F(0) +\frac{2}{3} F^{1}(-0) - \frac{2}{3} F^{1}(0) - \cancelto{0}{\frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right]} \\ &= -\frac{1}{3} F^{1}(-0) + \frac{1}{3} F^{1}(0) \\ &= \frac{1}{3} \left[ -F^{1}(0) + F^{1}(0) \right] \end{align} $$
 * $$\displaystyle


 * }.
 * }.

So,


 * {| style="width:90%" border="0" align="center"




 * $$\displaystyle

\Rightarrow e^{2}(0) = 0

$$


 * }.
 * }.

which means from Equation (10),


 * {| style="width:90%" border="0" align="center"

$$\displaystyle
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |

\Rightarrow G^{2}(0) = 0

$$


 * style= |


 * }.
 * }.

Author
Solved and Typed by - Egm6341.s10.Team4.andy 21:56, 17 February 2010 (UTC) .

= Problem 14: Third derivative of e(t) in Lagrange Intp. Error =

Given
If we define function e(t) as the following,


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

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


 * }
 * }

Find
Show that:


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

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


 * }
 * }

Solution
Let e(t) be,


 * $$\displaystyle

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

Basically, we have the following in the calculus for differentiating an integral:



\left({\int\limits_{g(x)}^{h(x)} f(x)\, dx}\right)'=\dfrac{d}{dx}\int\limits_{g(x)}^{h(x)} f(x)\, dx=f(h(x)).h'(x)-f(g(x)).g'(x) $$ Assuming k a point in the [-t,t] interval:



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



\Rightarrow \alpha^{(1)}(t)=[F(k)\times0-F(-t)\times(-1)]+[F(t)\times 1-F(k)\times 0]=F(-t)+F(t) $$



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



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



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



\Rightarrow \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) $$



\Rightarrow \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)] $$



\Rightarrow 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)]= $$



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


 * {| style="width:60%" border="0"

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

Author
Solved and Typed by - Egm6341.s10.Team4.nimaa&amp;m 02:42, 18 February 2010 (UTC) .

= Problem 15: Relationship between $$ \xi$$ and $$ \zeta_4$$=

Given

 * {| style="width:70%" border="0" align="center"




 * $$ \displaystyle x=\alpha + ht$$.


 * }.
 * }.

where,


 * {| style="width:70%" border="0" align="center"




 * $$ \displaystyle h= \frac{(b-a)}{2}$$.


 * }.
 * }.

Find
Prove that
 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle \frac{-F^4(\zeta_4)}{90}= \frac{-(b-a)^4}{1440}f^4(\xi) $$


 * }.
 * }.

and hence deduce a relationship between $$\displaystyle \xi$$ and $$\displaystyle \zeta_4$$

Solution
We have F(t)= f(x(t))= f(x). Given


 * {| style="width:70%" border="0" align="center"




 * $$ \displaystyle x=\alpha + ht$$.


 * }.
 * }.

where,


 * {| style="width:70%" border="0" align="center"




 * $$ \displaystyle h= \frac{(b-a)}{2}$$.


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle F^'(t)= \frac{dF(t)}{dt}= \frac{df(x(t))}{dt}= \frac{df(x)}{dt}= \frac{df(x)}{dx}\cdot\frac{dx}{dt}= f^'(x)\cdot h$$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle F^{}(t)= \frac{d}{dt}\cdot \frac{dF(t)}{dt}= \frac{d}{dt}\cdot(f^'(x)h) = h\cdot \frac{df^'(x)}{dt}= h\cdot \frac{df^'(x)}{dx}\cdot \frac{dx}{dt}= h^2\cdot f^{}(x)$$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle F^{}(t)= \frac{d}{dt}\cdot (F^{}(t))= \frac{d}{dt}\cdot(h^2\cdot f^{}(x)) = h^2\cdot \frac{df^{}(x)}{dt}= h^2\cdot \frac{df^{}(x)}{dx}\cdot \frac{dx}{dt}= h^3\cdot f^{}(x)$$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle F^{'}(t)= \frac{d}{dt}\cdot (F^{}(t))= \frac{d}{dt}\cdot(h^3\cdot f^{}(x)) = h^3\cdot \frac{df^{}(x)}{dt}= h^3\cdot \frac{df^{}(x)}{dx}\cdot \frac{dx}{dt}= h^4\cdot f^{'}(x)$$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\Rightarrow \displaystyle F^4(t)=h^4\cdot f^4(x)$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\Rightarrow \displaystyle F^4(t)=\frac{(b-a)}{16} ^4\cdot f^4(x)$$
 * }.
 * }.

Substituting $$\displaystyle \xi$$ for $$\displaystyle x$$ and $$\displaystyle \zeta_4$$ for $$\displaystyle t$$


 * {| style="width:70%" border="0" align="center"




 * $$\Rightarrow \displaystyle F^4(\zeta_4)=\frac{(b-a)}{16} ^4\cdot f^4(\xi)$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\Rightarrow \displaystyle \frac{-F^4(\zeta_4)}{90}= \frac{-(b-a)^4}{1440}f^4(\xi) $$
 * }.
 * }.

Since $$ \displaystyle x=\alpha + ht$$, We have $$ \displaystyle \xi=\alpha + h\zeta_4$$ This is the required relation between $$\displaystyle \xi$$ and $$\displaystyle \zeta_4$$. Hence proved.

Author
Solved and Typed by - Egm6341.s10.team4.anandankala 13:43, 19 February 2010 (UTC) .

= Problem 16: Runge phenomenon =

Given
Refer Lecture slide 16-1 for problem statement
 * {| style="width:100%" border="0" align="left"

I = \int^{5}_{-5} \frac{1}{1+x^2} dx $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (1)$$
 * }.
 * }.

Find
(1) Find $$\displaystyle I_n$$ using Newton-Cotes for n=1, 2,. . ., 15

(2) Plot $$\displaystyle f, f_n $$ $$\mbox{,  }$$ for n=1, 2, 3, 8, 12

(3) Plot $$\displaystyle I_n$$ vs. $$\displaystyle n$$ and observe that $$\displaystyle I_n$$ does not converge as $$\displaystyle n \rightarrow \infty $$

(4) Observe weight $$\displaystyle W_{i,n}:=\int^{b}_{a} l_{i,n}(x),\ dx$$ are not all positive for n $$ \ge $$ 8. Plot $$\displaystyle l_{i,n}(x)$$ for i=1, 2, ... ,8 & n=8.


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


 * $$\displaystyle
 * $$\displaystyle

$$


 * }.
 * }.

Solution
(1) Find $$\displaystyle I_n$$ using Newton-Cotes for n=1, 2,. . ., 15

Newton-cotes formula $$\displaystyle P_n$$,


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

P_n = \sum_{i=0}^n l_{i,n}(x)f(x_i)$$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

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

l_{i,n}(x) = \prod_{j=0,j\ne i}^n \frac{x-x_j}{x_i-x_j}$$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.


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

I_n = \int^{5}_{-5}P_n(x) dx = \sum_{i=0}^n \underbrace{\int^{5}_{-5}l_{i,n}(x) dx}_{W_i} f(x_i) = \sum_{i=0}^n w_i f(x_i) $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (2)$$
 * }.
 * }.

From the lecture slide 13-1,

Although this integration can be done numerically, there ia an another approach(analyitical solution) that derive the w(i) weight values directly.

the Error of integration of Newton-Cotes formula


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

\left | E_n(f(x)) \right | = \left | I-I_n \right | \le \int^{b}_{a} \left | f(x)-P_n(x)\right |  dx \le \frac {\int^{b}_{a}\left | q_{n+1}(x) \right| dx}{(n+1)!}\Big( max f^{(n+1)}(\xi), \xi \in [a,b] \Big)$$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (3)$$
 * }.
 * }.

From the equation (2),

We know the error is zero when the $$\displaystyle f(x) $$ is the polynomial of degree less than $$n$$


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

E_n(f(x)) = 0 $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

because, for the polynomial of degree less than $$\displaystyle n (\mathcal P_n)$$


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

if\quad f(x) \in \mathcal P_n, \qquad f^{(n+1)}(x)=0 $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

In order to find the $$\displaystyle w_i$$ in equation (2), we can use n equations and solve using matrix method like below,

for the $$\displaystyle f(x)=1,\; x, \; x^2, \; ...... \; x^n$$ (simplist and representative polynomial less than nth order), plug f(x) into equation(3)


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

E_n(f(x))= E_n(1)=E_n(x)=E_n(x^2)=......=E_n(x^n)=0 $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.


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



\begin{align} &E_n(1)= \int^{5}_{-5}1 dx -[w_1(1)+w_2(1)+w_3(1)+......+w_n(1)] =0\\ &E_n(x)= \int^{5}_{-5}x dx -[w_1(x_0)+w_2(x_2)+w_3(x_3)+......+w_n(x_n)] =0\\ &E_n(x^2)= \int^{5}_{-5}x^2 dx -[w_1(x_0^2)+w_2(x_1^2)+w_3(x_3^2)+......+w_n(x_n^2)] =0\\ &E_n(x^3)= \int^{5}_{-5}x^3 dx -[w_1(x_0^3)+w_2(x_1^3)+w_3(x_3^3)+......+w_n(x_n^3)] =0\\ &.......................\\ &..............................\\ &......................................\\ &E_n(x^n)= \int^{5}_{-5}x^n dx -[w_1(x_0^n)+w_2(x_1^n)+w_3(x_3^n)+......+w_n(x_n^n)] =0 \end{align} $$
 * $$\displaystyle
 * }.
 * }.

Hence, the $$\displaystyle w_i$$ may be determined from


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



\underbrace{ \begin{bmatrix} 1 & 1 & 1 & 1 & ...... & 1\\ x_0 & x_1 & x_2 & x_3 & ...... & x_n\\ x_0^2 & x_1^2 & x_2^2 & x_3^2 & ...... & x_n^2\\ x_0^3 & x_1^3 & x_2^3 & x_3^3 & ...... & x_n^3\\ \vdots & \vdots& \vdots& \vdots& \vdots & \vdots \\ x_0^n & x_1^n & x_2^n & x_3^n & ...... & x_n^n\\ \end{bmatrix} }_{A} \underbrace{ \begin{bmatrix} w_0\\ w_1\\ w_2\\ w_3\\ \vdots\\ w_n\\ \end{bmatrix} }_{W} = \underbrace{ \begin{bmatrix} \int^{5}_{-5}1 dx\\ \int^{5}_{-5}x dx\\ \int^{5}_{-5}x^2dx\\ \int^{5}_{-5}x^3dx\\ \vdots \\ \int^{5}_{-5}x^ndx\\ \end{bmatrix} = \begin{bmatrix} (b-a)\\ \frac{(b^2-a^2)}{2}\\ \frac{(b^3-a^3)}{3}\\ \frac{(b^4-a^4)}{4}\\ \vdots \\ \frac{(b^{n+1}-a^{n+1})}{n+1} \end{bmatrix} }_{B} $$
 * $$\displaystyle
 * }.
 * }.

$$\displaystyle W_i$$ can be obtained like this,
 * {| style="width:100%" border="0" align="left"

\begin{align} &AW=B\\ &W_i=A^{-1}B \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

plug obtained $$\displaystyle W_i$$ and \displaystyle f(x)=\frac{1}{1+x^2} into equation(2), $$\displaystyle I_n$$ can be calculated,
 * {| style="width:100%" border="0" align="left"

I_n = \sum_{i=0}^n w_i f(x_i) $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

$$ \begin{array}{|c||c|c|} n & I_n \\ \hline 1&0.384615\\ 2&6.794872\\	3&2.081448\\ 4&2.374005\\ 5&2.307692\\ 6&3.870449\\	7&2.898994\\	8&1.500489\\ 9&2.398618\\ 10&4.673301\\ 11&3.244773\\ 12&-0.31294\\ 13&1.919797\\ 14&7.899545\\ 15&4.155559\\ \hline \end{array} $$

Matlab Code:

(2) Plot $$\displaystyle f, f_n $$ $$\mbox{,  }$$ for n=1, 2, 3, 8, 12

$$\displaystyle f, f_n $$ were plotted by below matlab code.

Matlab Code:

(3) Plot $$\displaystyle I_n$$ vs. $$\displaystyle n$$ and observe that $$\displaystyle I_n$$ does not converge as $$\displaystyle n \rightarrow \infty $$



(4) Observe weight $$\displaystyle W_{i,n}:=\int^{b}_{a} l_{i,n}(x),\ dx$$ are not all positive for n $$ \ge $$ 8. Plot $$\displaystyle l_{i,n}(x)$$ for i=1, 2, ... ,8 & n=8.

This is the table that show the $$\displaystyle W_{i,n}:=\int^{b}_{a} l_{i,n}(x),\ dx$$ for n=8


 * Plot $$\displaystyle l_{i,n}(x)$$ for i=1, 2, ... ,8 & n=8.
 * Plot $$\displaystyle l_{i,n}(x)$$ for i=1, 2, ... ,8 & n=8.


 * Matlab Code:

.

Author
Solved - --Egm6341.s10.Team4.roni 05:15, 18 February 2010 (UTC)

Typed and reviewed by - Egm6341.s10.Team4.yunseok 02:06, 18 February 2010 (UTC) .

= Contributing Team Members =

Egm6341.s10.Team4.andy 21:57, 17 February 2010 (UTC) - Author of Problems:1,7,13 ; Proof Read: 2,3,4,10,14,15

Egm6341.s10.Team4.riherd 03:16, 10 February 2010 (UTC) - Author of Problems: 6,12

Egm6341.s10.Team4.nimaa&amp;m 13:51, 19 February 2010 (UTC) 09:35, 10 February 2010 (UTC) - Author of Problems: 2, 8, 9, 14; Proof Read: 4

Egm6341.s10.team4.anandankala 3:25, 10 February 2010 (UTC)- Author of Problems: 3,15; Proof Read: 1,7,9.

Egm6341.s10.Team4.roni 05:54, 10 February 2010 (UTC) Author of Problems:4,9,16 ; Proof Read: 4,9,16

Egm6341.s10.Team4.yunseok 16:00, 10 February 2010 (UTC) Author of Problems:5,10,11 ; Proof Read: 16