User:Egm6341.s10.team3.sa/Mtg9

Mtg 9: Tue, 19 Jan 10 [[media: Egm6341.s10.mtg9.djvu | Page 9-1]] 

LAGRANGE BASIS FUNCTIONS (Continued): In the previous lecture we saw the general form for the Lagrange Basis functions. Continuing with the special case of Simpson's rule, $$\displaystyle l_1(x) $$ is given by $$\displaystyle l_1(x) = \prod_{j=0, j \neq i, i=1}^{2} \frac{x-x_j}{x_i - x_j} = \bigg(\frac{x-x_0}{x_1 - x_0}\bigg) \bigg( \frac{x-x_2}{x_1 - x_2}\bigg)$$  where,

$$\displaystyle l_1 \in \mathbb p_2$$, where $$\displaystyle \mathbb P_2 $$ denotes polynomial of order $$\displaystyle \leq $$ 2 Note: The suffix 1 denotes the node number.

Since we have three points $$\displaystyle x_0, x_1, x_2$$ we can pass a parabola. Also recall, $$\displaystyle l_i(x_j) = \delta_{ij} $$ Hence, $$\displaystyle l_1(x_1) = 1 \; l_1(x_0) = l_1(x_2) = 0$$ 

Figure: $$\displaystyle l_1(x)$$

Note here that the parabola is inverted because the coefficient of $$\displaystyle x^2$$ is negative. $$\displaystyle l^{''}(x_1) = 0$$ 


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

HW:
 * style="width:100%; padding:10px; border:2px solid #8888aa" |
 * style="width:100%; padding:10px; border:2px solid #8888aa" |


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

$$\displaystyle \color{blue} where\, c_0,\, c_1\,and\,  c_2\,  are\, constants.$$  $$\displaystyle \color{blue} P_2(x) = \sum_{i=0}^{2} l_i(x) f(x_i)$$  $$\displaystyle \color{blue} Find\, the\,  coefficients\,  c_i\, in\, terms\,  of\,  x_i\, and\,  f(x_i)\;\; i=0,1,2. $$
 * $$\displaystyle \color{blue} f_2(x) = P_2(x) = c_0 + c_1x + c_2x^2 $$
 * $$\displaystyle \color{blue} f_2(x) = P_2(x) = c_0 + c_1x + c_2x^2 $$
 * }
 * }


 * style = |
 * }
 * }


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

HW:
 * style="width:100%; padding:10px; border:2px solid #8888aa" |
 * style="width:100%; padding:10px; border:2px solid #8888aa" |

Starting from $$\displaystyle \color{blue} p_2(x_j) = \sum_{i=0}^2 l_i(x_j) f(x_i)$$ derive the Simple Simpson's rule Use Eqn(4) in [[media:Egm6341.s10.mtg8.djvu|Page 8-3]] to derive the Simple Simpson's rule Eqn (2) [[media:Egm6341.s10.mtg7.djvu|Page 7-2]]


 * style = |
 * }
 * }

<p style="text-align:left;">[[media: Egm6341.s10.mtg9.djvu | Page 9-2]]  We have now seen how Trapezoidal and Simpson's rule are special cases of Newton-Cotes. Now if we look at Eqn(1) and Eqn(2) on [[media: Egm6341.s10.mtg7.djvu | Page 7-3]], they are nothing but the a general form of Newton-Cotes method with n+1 data points $$\displaystyle x_0, x_1, \dots x_n$$ i.e, $$\displaystyle f_n(x) = p_n(x) \in \mathbb P_n$$ : set of polynomials of order $$\displaystyle \leq $$ n $$\displaystyle l_{i,n} \in \mathbb P_n$$ where, i denotes the node number and n denotes the order of the polynomial.<br\>


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

HW:
 * style="width:100%; padding:10px; border:2px solid #8888aa" |
 * style="width:100%; padding:10px; border:2px solid #8888aa" |

Consider $$ \color{blue} f(x)=\frac{e^{x}-1}{x} $$ on $$ \color{blue} x\in[0,1], \quad  x_{0}=a=0, \quad x_{n}=b=1 $$.

(i) Construct $$ \color{blue} f_{n}(x)= \sum_{i=0}^{n}l_{i,n}(x)f(x_{i}) $$ for n = 1, 2, 4, 8, 16.

(ii) Plot $$\displaystyle \color{blue} f(x) $$ and $$\displaystyle \color{blue} f_{n}(x) $$ for n = 1, 2, 4, 8, 16.

(iii) Compute $$ \color{blue} I_{n}=\int_{b}^{b}f_{n}(x)dx $$ for n = 1, 2, 4, 8 and compare to $$\displaystyle \color{blue} I $$.

(iv) For n = 4, plot $$\displaystyle \color{blue} l_{0}, l_{1}, l_{2} $$.

(v) Why don't we have to take a look at $$\displaystyle \color{blue} l_{3}, l_{4} $$ for n = 4?

<br\><br\>
 * style = |
 * }
 * }

<p style="text-align:left;">[[media: Egm6341.s10.mtg9.djvu | Page 9-3]] 


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

HW:
 * style="width:100%; padding:10px; border:2px solid #8888aa" |
 * style="width:100%; padding:10px; border:2px solid #8888aa" |

Derive composite Trapezoidal rule [[media:Egm6341.s10.mtg7.djvu|Page 7-1]] from Simple Trapezoidal rule [[media:Egm6341.s10.mtg7.djvu|Page.7-1]]

and

Derive composite Simpson's rule [[media:Egm6341.s10.mtg7.djvu|Page7-2]] from simple Simpson's rule [[media:Egm6341.s10.mtg7.djvu|Page 7-2]]

<br\><br\>
 * style = |
 * }
 * }