User:Egm6341.s11.team5/HW2

=Problem 1 - Taylor Series= From (meeting 6 page 3)

Given
The Taylor series expansion: $$f(x)=f(x_{0})+ \frac{(x+x_{0})^1}{1!}f^{1}(x_{o})+\int_{x_{0}}^{x}(x-t)f^{(2)}(t)dt$$

Find
1. Do integration by parts on the last term to reveal 3 more terms in the Taylor series and the remainder. 2. Use IMVT to express the remainder in terms of $$f^{5}(\xi)$$ for $$ \xi \in[x_{0},x]$$. 3. Assuming equations (3) and (4) on page 3-3 are correct, do integration by parts once more on $$R_{n+1}$$ to verify that (3) and (4)remain correct. 4. Use IMVT on 4 from meeting 3 page 3 to show (5) in page 3-3.

Solution
'''We solved this problem on our own. '''

1. Finding next 3 terms
Starting with the Taylor Series, $$f(x)=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\int_{x_{0}}^{x}(x-t)f^{(2)}(t)dt$$ we will evaluate the integral using integration by parts. Let $$u=(x-t)dt$$ and $$v=f^{(2)}$$. Then, $$u=\frac{-1}{2}(x-t)^{2}$$ and $$v=f^{(3)}(t)dt$$. Integrating by parts we obtain: $$\left[ uv \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}uv'$$ $$=\frac{-1}{2}\left[ (x-t)^{2}f^{(2)}(t) \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}\frac{-1}{2}(x-t)^{2}f^{(3)}(t)dt$$ Evaluating we then get the third term in the series: $$\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})+\frac{1}{2}\int_{x_{0}}^{x}(x-t)^{2}f^{(3)}(t)dt$$ Once again, integrating by parts: $$\int_{x_{0}}^{x}(x-t)^{2}f^{(3)}(t)dt$$ Let $$u=(x-t)^{2}dt$$ and $$v=f^{(3)}(t)$$. Then, $$u=\frac{-1}{3}(x-t)^{3}$$ and $$v=f^{(4)}(t)dt$$. Integrating by parts: $$\left[ \frac{-1}{3}(x-t)^{3}f^{(3)}(t) \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}\frac{-1}{3}(x-t)^{3}f^{(4)}(t)dt$$ Evaluating: $$\frac{(x-x_{0})^{3}}{3}f^{(3)}(x_{0})+\frac{1}{3}\int_{x_{0}}^{x}(x-t)^{3}f^{(4)}(t)dt$$ Plugging back into the series: $$f(x)=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})+ \frac{(x-x_{0})^{3}}{3!}f^{(3)}(x_{0})+\frac{1}{3!}\int_{x_{0}}^{x}(x-t)^{3}f^{(4)}(t)dt$$ Lastly, integration by parts once more on the term: $$\int_{x_{0}}^{x}(x-t)^{3}f^{(4)}(t)dt$$ Let $$u=(x-t)^3dt$$ and $$v=f^{(4)}(t)$$. Then, $$ u=\frac{-1}{4}(x-t)^{4}$$ and $$v=f^{(5)}(t)dt$$. Integrating by parts: $$\left[ \frac{-1}{4}(x-t)^{4}f^{(4)}(t) \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}\frac{-1}{4}(x-t)^{4}f^{(5)}(t)dt$$ Evaluating: $$ \frac{1}{4}(x-x_{0})^{4}f^{(4)}(x_{0})+\frac{1}{4}\int_{x_{0}}^{x}(x-t)^{4}f^{(5)}(t)dt$$ Plugging back in:
 * {| style="width:100%" border="0" align="left"

$$f(x)=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})+ \frac{(x-x_{0})^{3}}{3!}f^{(3)}(x_{0})+ \frac{(x-x_{0})^{4}}{4!}f^{(4)}(x_{0})+\frac{1}{4!}\int_{x_{0}}^{x}(x-t)^{4}f^{(5)}(t)dt$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

2. Remainder
Starting with the remainder: $$\frac{1}{4!}\int_{x_{0}}^{x}(x-t)^{4}f^{(5)}(t)dt$$ Using IMVT $$\int_{a}^{b}w(x)f(x)dx=f(\xi)\int_{a}^{b}w(x)dx$$, where $$\xi \in [a,b]$$. $$\frac{1}{4!}\int_{x_{0}}^{x}(x-t)^{4}f^{(5)}(t)dt = \frac{1}{4!(5)}f^{(5)}(\xi)\left[ (x-t)^{5} \right]_{x_{0}}^{x}$$
 * {| style="width:100%" border="0" align="left"

$$ \therefore R_{5}=\frac{1}{5!}f^{5}(\xi)(x-x_{0})^{5}$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

3. $$R_{n+2}$$
Equation 4 from pg. 3-3 is as follows: $$ R_{n+1}(x)=\frac{1}{n!}\int_{x_{0}}^{x}(x-t)^{n}f^{n+1}(t)dt$$ Doing integration by parts: Let $$u=(x-t)^{n}dt$$ and $$v=f^{n+1}(t)$$ Then, $$ u=\frac{-1}{n+1}(x-t)^{n+1}$$ and $$ v=f^{n}(t)dt$$ $$ \left[ \frac{1}{n+1}(x-t)^{n+1}f^{n+1}(t) \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}\frac{1}{n+1}(x-t)^{n+1}f^{n}(t)dt$$ Evaluating:
 * {| style="width:100%" border="0" align="left"

$$R_{n+2}=\frac{1}{(n+1)!}(x-x_{0})^{n+1}f^{n+1}(x_{0})+\frac{1}{(n+1)!}\int_{x_{0}}^{x}(x-t)^{n+1}f^{n}(t)dt$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

4. IMVT
Starting with equation 3 on page 3-3: $$R_{n+1}(x)=\frac{1}{n!}\int_{x_{0}}^{x}(x-t)^{n}f^{n+1}(t)dt$$ Apply IMVT: $$\frac{f^{n+1}(\xi)}{n!}\int_{x_{0}}^{x}(x-t)^{n}dt$$ Integrate: $$\frac{f^{n+1}(\xi)}{n!}\frac{1}{n+1}\left[ (x-t)^{n+1} \right]_{x_{0}}^{x}$$ Simplifying:
 * {| style="width:100%" border="0" align="left"

$$R_{n+1}=\frac{(x-x_{0})^{n+1}}{(n+1)!}f^{(n+1)}(\xi)$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

Author and proof-reader
 cavalcanti

[Proof-reader]

=Problem 2 - Construct Taylor series = From (meeting 6 page 3)

Problem statement
$$ f(x)=sin x, \ x \in [0,\pi] $$ (i)Construct a Taylor series of $$f(x)$$ around $$x_0 = \frac{3 \pi}{8}$$ for $$\displaystyle n=0,1,2......,10.$$ (ii)Plot the series for each $$\displaystyle n $$ (iii)Estimate the maximum $$\displaystyle R(x)$$ at $$ x=\frac{3 \pi}{4}$$

Solution
 We refered to Egm6341.s10.team3 but solve by ourselves again with s11 values 

Part 1. Construct

 * $$\displaystyle n^{th}$$ order polynomial is given by,
 * $$\displaystyle P_n(x) = f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + ........+ \frac{(x-x_0)^n}{n!}f^n(x_0) $$

(a)$$\displaystyle P_n(x)$$ for $$\displaystyle n=0 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$


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


 * $$ \displaystyle P_0(x)= f(x_0) $$
 * }
 * }
 * }


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

$$\displaystyle P_0(x) = sin (\frac{3 \pi}{8})$$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(b)$$\displaystyle P_n(x)$$ for $$\displaystyle n=1 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_1(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) $$
 * }
 * }
 * }


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

$$ \displaystyle P_1(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) $$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(c)$$\displaystyle P_n(x)$$ for $$\displaystyle n=2 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_2(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) $$
 * }
 * }
 * }


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

$$ \displaystyle P_2(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^2}{2!} sin(\frac{3 \pi}{8})$$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(d)$$\displaystyle P_n(x)$$ for $$\displaystyle n=3 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_3(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0)$$
 * }
 * }
 * }


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

$$ \displaystyle P_3(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^2}{2!} sin(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^3}{3!} cos(\frac{3 \pi}{8}) $$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(e)$$\displaystyle P_n(x)$$ for $$\displaystyle n=4 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_4(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) $$
 * }
 * }
 * }


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

$$ \displaystyle P_4(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^2}{2!} sin(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^3}{3!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^4}{4!} sin(\frac{3 \pi}{8}) $$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(f)$$\displaystyle P_n(x)$$ for $$\displaystyle n=5 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_5(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0)$$
 * }
 * }
 * }


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

$$ \displaystyle P_5(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^2}{2!} sin(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^3}{3!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^4}{4!} sin(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^5}{5!} cos(\frac{3 \pi}{8}) $$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(g)$$\displaystyle P_n(x)$$ for $$\displaystyle n=6 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_6(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0) + \frac{(x-x_0)^6}{6!} f^6(x_0)$$
 * }
 * }
 * }


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

$$ \displaystyle P_6(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^2}{2!} sin(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^3}{3!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^4}{4!} sin(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^5}{5!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^6}{6!} sin(\frac{3 \pi}{8}) $$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(h)$$\displaystyle P_n(x)$$ for $$\displaystyle n=7 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_7(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0) + \frac{(x-x_0)^6}{6!} f^6(x_0) $$
 * $$ \displaystyle P_7(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0) + \frac{(x-x_0)^6}{6!} f^6(x_0) $$

$$ \displaystyle + \frac{(x-x_0)^7}{7!} f^7(x_0)$$
 * }
 * }


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

$$ \displaystyle P_7(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^2}{2!} sin(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^3}{3!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^4}{4!} sin(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^5}{5!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^6}{6!} sin(\frac{3 \pi}{8})$$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |

$$\displaystyle -\frac{(x-\frac{3 \pi}{8})^7}{7!} cos(\frac{3 \pi}{8}) $$
 * style= |
 * }
 * }

(i)$$\displaystyle P_n(x)$$ for $$\displaystyle n=8 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_8(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0) + \frac{(x-x_0)^6}{6!} f^6(x_0) $$
 * $$ \displaystyle P_8(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0) + \frac{(x-x_0)^6}{6!} f^6(x_0) $$

$$ \displaystyle + \frac{(x-x_0)^7}{7!} f^7(x_0) + \frac{(x-x_0)^8}{8!} f^8(x_0)$$
 * }
 * }


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

$$ \displaystyle P_8(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^2}{2!} sin(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^3}{3!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^4}{4!} sin(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^5}{5!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^6}{6!} sin(\frac{3 \pi}{8})$$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |

$$\displaystyle -\frac{(x-\frac{3 \pi}{8})^7}{7!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^8}{8!} sin(\frac{3 \pi}{8}) $$
 * style= |
 * }
 * }

(j)$$\displaystyle P_n(x)$$ for $$\displaystyle n=9 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_9(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0) + \frac{(x-x_0)^6}{6!} f^6(x_0) $$
 * $$ \displaystyle P_9(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0) + \frac{(x-x_0)^6}{6!} f^6(x_0) $$

$$ \displaystyle + \frac{(x-x_0)^7}{7!} f^7(x_0) + \frac{(x-x_0)^8}{8!} f^8(x_0) + \frac{(x-x_0)^9}{9!} f^9(x_0)$$
 * }
 * }


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

$$ \displaystyle P_9(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^2}{2!} sin(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^3}{3!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^4}{4!} sin(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^5}{5!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^6}{6!} sin(\frac{3 \pi}{8})$$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |

$$\displaystyle -\frac{(x-\frac{3 \pi}{8})^7}{7!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^8}{8!} sin(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^9}{9!} cos(\frac{3 \pi}{8}) $$
 * style= |
 * }
 * }

(k)$$\displaystyle P_n(x)$$ for $$\displaystyle n=10 $$ and $$\displaystyle x_0 = \frac{3 \pi}{8}$$
 * {| style="width:100%" border="0" align="left"


 * $$ \displaystyle P_{10}(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0) + \frac{(x-x_0)^6}{6!} f^6(x_0) $$
 * $$ \displaystyle P_{10}(x)= f(x_0) + \frac{(x-x_0)}{1!} f^1(x_0) + \frac{(x-x_0)^2}{2!} f^2(x_0) + \frac{(x-x_0)^3}{3!} f^3(x_0) +  \frac{(x-x_0)^4}{4!} f^4(x_0) + \frac{(x-x_0)^5}{5!} f^5(x_0) + \frac{(x-x_0)^6}{6!} f^6(x_0) $$

$$ \displaystyle + \frac{(x-x_0)^7}{7!} f^7(x_0) + \frac{(x-x_0)^8}{8!} f^8(x_0) + \frac{(x-x_0)^9}{9!} f^9(x_0) + \frac{(x-x_0)^{10}}{10!} f^{10}(x_0)$$
 * }
 * }


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

$$ \displaystyle P_{10}(x)= sin (\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})}{1!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^2}{2!} sin(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^3}{3!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^4}{4!} sin(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^5}{5!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^6}{6!} sin(\frac{3 \pi}{8})$$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |

$$\displaystyle -\frac{(x-\frac{3 \pi}{8})^7}{7!} cos(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^8}{8!} sin(\frac{3 \pi}{8}) + \frac{(x-\frac{3 \pi}{8})^9}{9!} cos(\frac{3 \pi}{8}) - \frac{(x-\frac{3 \pi}{8})^{10}}{10!} sin(\frac{3 \pi}{8}) $$
 * style= |
 * }
 * }

Part 2. Plot
Homework 2 Problem 2 Figure 1: First 10 Taylor series expansions of $$Sin(x)$$ , from $$0$$ to $$2 \pi $$ J Davis 17:48, 30 January 2011 (UTC)

Part 3. Error Estimation
$$\displaystyle \max \bigg| R_{n+1}(x) \bigg| = \frac{(x-x_0)^{n+1}}{(n+1)!} \max \bigg| f^{n+1}(t)\bigg| \qquad t \ \in \ [x_0, x] $$

Since $$\displaystyle f(x) = \sin (x)$$

$$\displaystyle \max \bigg| f^{n+1}(t)\bigg| = 1 \qquad \forall \ n = 2k \qquad (k=0,1,2,3,4,5)$$ $$\displaystyle \max \bigg| f^{n+1}(t)\bigg| = \bigg| \cos(\frac{3 \pi}{4}) \bigg| = \frac{1}{\sqrt 2} \qquad \forall \ n = 2k+1 \qquad (k=0,1,2,3,4)$$

(a)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=0 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{1}(x)\bigg| = \frac{x-x_0}{1!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}]$$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{\frac{3 \pi}{4}-\frac{3 \pi}{8}}{1!} \cdot \frac{1}{\sqrt 2} $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{1}(x)\bigg| = 0.8330 $$ ( WA result )
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(b)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=1 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{2}(x)\bigg|= \frac{(x-x_0)^2}{2!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^2}{2!} \cdot 1 $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{2}(x)\bigg| = 0.69396 $$ ( WA result )
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(c)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=2 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{3}(x)\bigg|= \frac{(x-x_0)^3}{3!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^3}{3!} \cdot \frac{1}{\sqrt 2} $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{3}(x)\bigg| = 0.1927 $$ ( WA result )
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(d)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=3 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{4}(x)\bigg|= \frac{(x-x_0)^4}{4!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^4}{4!} \cdot 1 $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{4}(x)\bigg| = 0.08026 $$ ( WA result )
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(e)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=4 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{5}(x)\bigg|= \frac{(x-x_0)^5}{5!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^5}{5!} \cdot \frac{1}{\sqrt 2} $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{5}(x)\bigg| = 0.01337 $$ ( WA result )
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(f)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=5 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{6}(x)\bigg|= \frac{(x-x_0)^6}{6!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^6}{6!} \cdot 1 $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{6}(x)\bigg| = 0.00371 $$ ( WA result )
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(g)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=6 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{7}(x)\bigg|= \frac{(x-x_0)^7}{7!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^7}{7!} \cdot \frac{1}{\sqrt 2} $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{7}(x)\bigg| = 4.41898 * 10^{-4} $$ ( WA result )
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(h)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=7 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{8}(x)\bigg|= \frac{(x-x_0)^8}{8!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^8}{8!} \cdot 1 $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{8}(x)\bigg| = 9.20298 * 10^{-5} $$ ( WA result )
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(i)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=8 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{9}(x)\bigg|= \frac{(x-x_0)^9}{9!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^9}{9!} \cdot \frac{1}{\sqrt 2} $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{9}(x)\bigg| = 8.51829 * 10^{-6}$$ ( WA result )
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(j)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=9 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{10}(x)\bigg|= \frac{(x-x_0)^{10}}{10!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^{10}}{10!} \cdot 1 $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{10}(x)\bigg| = 1.41922 * 10^{-6} $$ ( WA result )
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(k)$$\displaystyle \max \bigg|R_{n+1}(x)\bigg|$$ for $$\displaystyle n=10 $$ ,$$\displaystyle x_0 = \frac{3 \pi}{8} $$ and $$\displaystyle x = \frac{3 \pi}{4} $$


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


 * $$ \displaystyle \max \bigg|R_{11}(x)\bigg|= \frac{(x-x_0)^{11}}{11!} \cdot \max \bigg|f^{n+1}(t)\bigg| \qquad t \ \in \ [\frac{3 \pi}{8}, \frac{3 \pi}{4}] $$
 * }
 * }
 * }


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

$$ \displaystyle = \frac{(\frac{3 \pi}{4}-\frac{3 \pi}{8})^{11}}{11!} \cdot \frac{1}{\sqrt 2} $$
 * }
 * }


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

$$\displaystyle \max \bigg|R_{11}(x)\bigg| = 1.0748 * 10^{-7} $$ ( WA result )
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

Double-check with Mathematica
 Verified using Mathematica 7 and the following commands: J Davis 19:33, 30 January 2011 (UTC)

Rf = ConstantArray[0, 10];

Table[fr = D[Sin[x], {x, i}];

maxf = MaxValue[{Abs[D[Sin[x], {x, (i + 1)}]],3*Pi/8 <= x <= 3*Pi/4}, x];

R = ((3*Pi/4 - 3.*Pi/8)^(i + 1)/(i + 1)!);

Rfi = R*maxf, {i, 0, 10}]

$$Max\left|R(x)_{n+1}\right|=\frac{\left(x-x_0\right){}^{n+1} Max\left|f(\zeta )^{n+1}\right|}{(n+1)!}, \zeta \in \left[x_o, x\right],x_0=\frac{3 \pi }{8},x=\frac{3 \pi }{4}$$ When $$n+1$$ is even $$ Max\left|f(\zeta )^{n+1}\right|=1$$ When $$n+1$$ is odd $$ Max\left|f(\zeta )^{n+1}\right|=\frac{1}{\sqrt{2}}$$ $$\therefore$$ When $$n+1$$ is even: $$Max\left|R(x)_{n+1}\right|=\frac{1.1781^{n+1}}{(n+1)!}$$ And When $$n+1$$ is odd: $$Max\left|R(x)_{n+1}\right|=\frac{1.1781^{n+1}}{\sqrt{2}(n+1)!}$$

J Davis 19:33, 30 January 2011 (UTC)

Author and proof-reader
[Author] Oh,J Davis 19:35, 30 January 2011 (UTC)

[Proof-reader] J Davis 19:35, 30 January 2011 (UTC)

=Problem 3 - Taylor Series= From (meeting 7 page 2)

Given
$$\displaystyle f(x)= \frac{e^x-1}{x}$$ ,

Find
1. Expand $$\displaystyle {e}^{x}$$ in Taylor Series up to order n with remainder $$\displaystyle R_{n+1}[{e}^{x};x]$$ 2. Find Taylor Series of $$\displaystyle f(x)$$ up to order n with remainder $$\displaystyle R_{n+1}[f;x]$$

Solution
We solved the problem on our own.

To find the Taylor series expansions and remainders of both $$\displaystyle e^x$$ and $$\displaystyle f(x)$$. To verify that:
 * $$R_{n+1}[f(x);x] = \frac{(x-0)^{n+1}}{x(n+1)!}e^\xi = \frac{R_{n}[e^{x};x]}{n+1}$$

We will examine the T.S expansions at $$ x_0 = 0$$.In general, functions for which the (n+1)th derivative exists and is continuous, can be expressed as where $$p_{n}(x)$$ is a polynomial of order n and $$R_{n+1}(x)$$ is the corresponding remainder. It is shown that these polynomials and remainders take the following form of the T.S. from equation 3 from mtg. 3-3: where $$\displaystyle f^{(n)}(x_0)$$ denotes the n-th derivative of f evaluated at $$\displaystyle x_0$$.We also know from equation 5 from mtg. 3-3: For the T.S expansion of $$\displaystyle e^x$$ about $$\displaystyle x_0=0$$, all derivatives of $$\displaystyle e^x$$ are $$\displaystyle e^x$$ and take the value of 1 when evaluated at $$\displaystyle x_0=0$$.

Author and proof-reader
[Author] raghunathan

[Proof-reader]

=Problem 4 - Numerical Integration = From (meeting 7 page 3)

Given
$$\displaystyle f(x)= \frac{e^x-1}{x}$$ , I = $$\int_{a}^{b}f(x) dx$$ where [a,b]=[-1,1]

Find
1. Plot $$ f(x) $$ for [a,b]=[-1,1] 2. Find $$I_n$$ using 2.1. Taylor Series Expansion 2.2. Composite Trapezoidal Rule 2.3. Composite Simpson Rule 2.4. Gauss Legendre Quadrature For, $$\displaystyle n=0,1,2,3,4$$

Solution
We solved this problem on our own.

1.Plot f(x) Matlab code:
 * {| style="width:100%" border="0" align="left"

The exact integral of $$I=\int_{-1}^{1} f(x) dx$$ is $$\displaystyle 2.1145$$ using (WA) 2.1 Taylor Series The formula is: $$I_{n}=\int_{-1}^{1}f_{n}(x)dx$$, where $$ f_{n}=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})+...+\frac{(x-x_{0})^{n}}{n!}f^{n}(x_{0})$$ For all the calculations up to n=8, $$f(x_{0})=0.63212$$ $$f^{(1)}(x_{0})=0.26424$$ $$f^{(2)}(x_{0})=0.1606$$ $$f^{(3)}(x_{0})=0.1139$$ $$f^{(4)}(x_{0})=0.0878$$ $$f^{(5)}(x_{0})=0.0713$$ $$f^{(6)}(x_{0})=0.0599$$ $$f^{(7)}(x_{0})=0.0517$$ $$f^{(8)}(x_{0})=0.0454$$ For n=2, $$f_{2}(x_{0})=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})$$ $$I_{2}=\int_{-1}^{1}f_{2}(x)dx$$
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * }
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$I_{2}= 2.001$$ For n=4, $$f_{4}(x_{0})=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})+\frac{(x-x_{0})^{3}}{3!}f^{(3)}(x_{0})+\frac{(x-x_{0})^{4}}{4!}f^{(4)}(x_{0})$$ $$I_{4}=\int_{-1}^{1}f_{4}(x)dx$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$I_{4}= 2.106$$ For n=8, $$f_{8}(x_{0})=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})+\frac{(x-x_{0})^{3}}{3!}f^{(3)}(x_{0})+\frac{(x-x_{0})^{4}}{4!}f^{(4)}(x_{0})+\frac{(x-x_{0})^{5}}{5!}f^{(5)}(x_{0})+\frac{(x-x_{0})^{6}}{6!}f^{(6)}(x_{0})+\frac{(x-x_{0})^{7}}{7!}f^{(7)}(x_{0})+\frac{(x-x_{0})^{8}}{8!}f^{(8)}(x_{0})$$ $$I_{8}=\int_{-1}^{1}f_{8}(x)dx$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$I_{8}= 2.115$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

2.2 Composite Trapezoidal Rule The formula is: $$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})),h=\dfrac{b-a}{n}$$ for n=2, $$I_2=h(\dfrac{1}{2}f_0+f_1+\dfrac{1}{2}f_2)$$ $$\displaystyle h=1$$ $$\displaystyle f_0 = f(-1)=0.6321 $$ $$\displaystyle f_1 = f(0)=1 $$ $$\displaystyle f_2 = f(1)=1.7183 $$ Therefore,
 * {| style="width:100%" border="0" align="left"

$$\displaystyle I_2=2.1752$$ for n=4, $$I_4=h(\dfrac{1}{2}f_0+f_1+f_2+f_3+\dfrac{1}{2}f_4)$$ $$h=\dfrac{1}{2}$$ $$\displaystyle f_0 = f(-1)=0.6321 $$ $$f_1 = f(-\dfrac{1}{2})=0.7869 $$ $$\displaystyle f_2 = f(0)=1 $$ $$f_3 = f(\dfrac{1}{2})=1.2974 $$ $$\displaystyle f_4 = f(1)=1.7183 $$ Therefore,
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$\displaystyle I_4=2.1296$$ for n=8, $$I_8=h(\dfrac{1}{2}f_0+f_1+f_2+f_3+f_4+f_5+f_6+f_7+\dfrac{1}{2}f_8)$$ $$h=\dfrac{1}{4}$$ $$\displaystyle f_0 = f(-1)=0.6321 $$ $$f_1 = f(-\dfrac{3}{4})=0.7035 $$ $$f_2 = f(-\dfrac{1}{2})=0.7869 $$ $$f_3 = f(-\dfrac{1}{4})=0.8846 $$ $$\displaystyle f_4 = f(0)=1 $$ $$f_5 = f(\dfrac{1}{4})=1.1361 $$ $$f_6 = f(\dfrac{1}{2})=1.2974 $$ $$f_7 = f(\dfrac{3}{4})1.4893 $$ $$\displaystyle f_8 = f(1)=1.7183 $$ Therefore,
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$\displaystyle I_8=2.1183$$ 2.3 Composite Simpson Rule The formula is: $$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)),h=\dfrac{b-a}{n}$$ for n=2, $$I_2=\displaystyle \dfrac{h}{3}(f_0+4f_1+f_2)$$ $$\displaystyle h=1$$ $$\displaystyle f_0 = f(-1)=0.6321 $$ $$\displaystyle f_1 = f(0)=1 $$ $$\displaystyle f_2 = f(1)=1.7183 $$ Therefore,
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$\displaystyle I_2=2.1168$$ for n=4, $$I_4=\displaystyle \dfrac{h}{3}(f_0+4f_1+2f_2+4f_3+f_4)$$ $$h=\dfrac{1}{2}$$ $$\displaystyle f_0 = f(-1)=0.6321 $$ $$f_1 = f(-\dfrac{1}{2})=0.7869 $$ $$\displaystyle f_2 = f(0)=1 $$ $$f_3 = f(\dfrac{1}{2})=1.2974 $$ $$\displaystyle f_4 = f(1)=1.7183 $$ Therefore,
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$\displaystyle I_4=2.1146$$ for n=8, $$I_8=\displaystyle \dfrac{h}{3}(f_0+4f_1+2f_2+4f_3+2f_4+4f_5+2f_6+4f_7+f_8)$$ $$h=\dfrac{1}{4}$$ $$\displaystyle f_0 = f(-1)=0.6321 $$ $$f_1 = f(-\dfrac{3}{4})=0.7035 $$ $$f_2 = f(-\dfrac{1}{2})=0.7869 $$ $$f_3 = f(-\dfrac{1}{4})=0.8846 $$ $$\displaystyle f_4 = f(0)=1 $$ $$f_5 = f(\dfrac{1}{4})=1.1361 $$ $$f_6 = f(\dfrac{1}{2})=1.2974 $$ $$f_7 = f(\dfrac{3}{4})1.4893 $$ $$\displaystyle f_8 = f(1)=1.7183 $$ Therefore,
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$\displaystyle I_8=2.1144$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

2.4 Gauss-Legendre quadrature The Gauss-Legendre quadrature is as follows: $$I(f)=\int_{a}^{b}f(x)dx \approx \sum_{i=1}^{n}w_{i}f(x_{i})  $$. For $$n=2$$, $$I_{2}=\int_{-1}^{1}f(x)dx=f\left( \frac{-1}{\sqrt{3}} \right)+f\left( \frac{1}{\sqrt{3}} \right)$$ $$I_{2}=0.759705+1.35327=2.11298$$
 * {| style="width:100%" border="0" align="left"

$$I_2=2.11298$$ For $$n=4$$, $$I_{4}=\int_{-1}^{1}f(x)dx=0.652145[f(0.339981)+f(-0.339981)] + 0.347855[f(0.861136)+f(-0.861136)]$$ $$I_{4}=2.1145$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$\displaystyle I_4=2.1145$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

Author and proof-reader
[Author] raghunathan, cavalcanti

[Proof Reader] cavalcanti

=Problem 5 - Verify NIST Handbook= From (meeting 7 page 5)

Given
The following table from wikipedia:

Legendre Polynomials Table

Find
Verify the table against the NIST Handbook.

NIST Handbook

Solution
'''We solved this problem on our own. '''

Using octave, the values of the Wikipedia table were calculated to 5 decimal places: Comparing with the NIST table, we have:


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

The weights for $$n=5$$ are shown on the NIST website. The Wikipedia values are correct.
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

Author and proof-reader
 cavalcanti

[Proof-reader]

=Problem 6 - Verification general form of Legendre poly.= From (meeting 8 page 1)

Given

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

P_0(x) = 1 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (6-1)
 * }
 * }


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

P_1(x) = x $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (6-2)
 * }
 * }


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

P_2(x) = \frac{1}{2} \left(3 x ^ 2 - 1\right) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (6-3)
 * }
 * }


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

P_3(x) = \frac{1}{2} \left(5 x ^ 3 - 3 x\right) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (6-4)
 * }
 * }


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

P_4(x) = \frac{35}{8} x ^ 4 - \frac{15}{4} x ^ 2 + \frac{3}{8} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (6-5)
 * }
 * }

NOTE: There is something wrong in the formatting of the above equation. Without this line, the title of the next section does not show up.

Find
Verify that (6-1) - (6-5) can be written as


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

P_n(x) = \sum_{i=0}^{[n/2]} \frac{(-1)^i (2 n - 2 i)! x^{n - 2i}}{2^n i! (n-i)! (n-2i)!} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (6-6)
 * }
 * }

$$\displaystyle \ [\frac{n}{2}]$$ = interger part of  $$ \displaystyle \ \frac{n}{2} $$

Solution
''' We refered to [http://en.wikiversity.org/w/index.php?title=User_talk:Egm6321.f10.team5.oh/hw6#Problem_8_-_Verification_genernal_form_of_Legendre_poly. Egm6321.f10.team5.oh] and verify the solution with WA'''

Background knowledge :  Factorial , Floor and ceiling functions

1. In case of $$\displaystyle n = 0 $$


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

P_0(x) = \sum_{i=0}^{[0/2]} \frac{(-1)^i (2 (0) - 2 i)! x^{0 - 2i}}{2^0 i! (0-i)! (0-2i)!} \ = \sum_{i=0}^{0} \frac{(-1)^i ( - 2 i)! x^{- 2i}}{i! (-i)! (-2i)!} \ = \frac{(-1)^0 \cdot 0! \cdot x^0}{0! \cdot 0! \cdot 0!}$$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }
 * }


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

$$\displaystyle P_0(x) = 1 $$ ( WA result )
 * style="width:25%; padding:10px; border:2px solid #8888aa" |
 * style="width:25%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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




 * }
 * }
 * }

2. In case of $$\displaystyle n = 1 $$


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

P_1(x) = \sum_{i=0}^{[1/2]} \frac{(-1)^i (2 (1) - 2 i)! x^{1 - 2i}}{2^1 i! (1-i)! (1-2i)!}= \sum_{i=0}^{0} \frac{(-1)^i \ (2 - 2 i)! \ x^{1 - 2i}}{2 \ i! \ (1-i)! \ (1-2i)!}= \frac{(-1)^0 \cdot 2! \cdot x^1}{2 \cdot 0! \cdot 1! \cdot 1!} $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }
 * }


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

$$\displaystyle P_1(x) = x $$ ( WA result )
 * style="width:25%; padding:10px; border:2px solid #8888aa" |
 * style="width:25%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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




 * }
 * }
 * }

3. In case of $$\displaystyle n = 2 $$


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

P_2(x) = \sum_{i=0}^{[2/2]} \frac{(-1)^i (2 (2) - 2 i)! x^{2 - 2i}}{2^2 i! (2-i)! (2-2i)!}= \sum_{i=0}^{1} \frac{(-1)^i \ (4 - 2 i)! \ x^{2 - 2i}}{4 \ i! \ (2-i)! \ (2-2i)!}= \underbrace{\frac{(-1)^0 \cdot 4! \cdot x^2}{4 \cdot 0! \cdot 2! \cdot 2!}}_{\frac{3}{2}x^2} \ + \ \underbrace{\frac{(-1)^1 \cdot 2! \cdot x^0}{4 \cdot 1! \cdot 1! \cdot 1!}}_{-\frac{1}{2}} $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }
 * }


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

$$\displaystyle P_2(x) = \frac{1}{2}(3x^2-1) $$ ( WA result )
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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




 * }
 * }
 * }

4. In case of $$\displaystyle n = 3 $$
 * {| style="width:100%" border="0" align="left"

P_3(x) = \sum_{i=0}^{[3/2]} \frac{(-1)^i (2 (3) - 2 i)! x^{3 - 2i}}{2^3 i! (3-i)! (3-2i)!}= \sum_{i=0}^{1} \frac{(-1)^i (6 - 2 i)! x^{3 - 2i}}{8 \ i! \ (3-i)! \ (3-2i)!} = \underbrace{\frac{(-1)^0 \cdot 6! \cdot x^{3}}{8 \cdot 0! \cdot 3! \cdot 3!}}_{\frac{5}{2}x^3} + \underbrace{\frac{(-1)^1 \cdot 4! \cdot x^1}{8 \cdot 1! \cdot 2! \cdot 1!}}_{-\frac{3}{2}x}$$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }
 * }


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

$$\displaystyle P_3(x) = \frac{1}{2}(5x^3-3x) $$ ( WA result )
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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




 * }
 * }
 * }

5. In case of $$\displaystyle n = 4 $$
 * {| style="width:100%" border="0" align="left"

P_4(x) = \sum_{i=0}^{[4/2]} \frac{(-1)^i (2 (4) - 2 i)! x^{4 - 2i}}{2^4 i! (4-i)! (4-2i)!}= \sum_{i=0}^{2} \frac{(-1)^i \ (8 - 2 i)! \ x^{4 - 2i}}{16 \ i! \ (4-i)! \ (4-2i)!}$$
 * $$\displaystyle
 * $$\displaystyle

$$\displaystyle = \underbrace{\frac{(-1)^0 \cdot 8! \cdot x^4}{16 \cdot 0! \cdot 4! \cdot 4!}}_{\frac{35}{8}x^4} \ + \ \underbrace{\frac{(-1)^1 \cdot 6! \cdot x^{2}}{16 \cdot 1! \cdot 3! \cdot 2!}}_{- \frac{15}{4}x^2} \ + \ \underbrace{\frac{(-1)^2 \cdot 4! \cdot x^0}{16 \cdot 2! \cdot 2! \cdot 0!}}_{\frac{3}{8}}$$
 * }
 * }
 * }


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

$$\displaystyle P_4(x) = \frac{35}{8} x ^ 4 - \frac{15}{4} x ^ 2 + \frac{3}{8} $$ ( WA result )
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * style="width:45%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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




 * }
 * }
 * }

Check
 Verified using Mathematica 7 and the following commands: P[n_] := Simplify[Sum[1/(2^n)*((-1)^i (2 n - 2 i)! x^(n - 2 i))/(i! (n - 2 i)! (n - i)!), {i, 0,IntegerPart[n/2]}]]

Pt = Table[P[i], {i, 0, 5}];

{Pt}\[Transpose]

Plot[Pt, {x, -1, 1}]

The function P[n_] generates:

$$\sum _{i=0}^{Integer Part\left[\frac{n}{2}\right]} \frac{(-1)^i (2 n-2 i)! x^{n-2 i}}{2^n (i! (n-2 i)! (n-i)!)}$$

The Table command evaluates P[n_] for n=0,1,2,3,4,5 and assembles the results in an array, presented here

$$ \left( \begin{array}{c} 1 \\ x \\ \frac{1}{2} \left(3 x^2-1\right) \\ \frac{1}{2} x \left(5 x^2-3\right) \\ \frac{1}{8} \left(35 x^4-30 x^2+3\right) \\ \frac{1}{8} x \left(63 x^4-70 x^2+15\right) \end{array} \right)$$

These are then plotted for a visual verification as well

Plot of first five Legendre polynominals J Davis 21:39, 30 January 2011 (UTC)

Author and proof-reader
[Author] Oh,J Davis 19:57, 30 January 2011 (UTC)

[Proof-reader] Shin

= Problem 7 - Orthogonality of $$P_{n}$$= from meeting page 9-1

Given
The Legendre polynomials $$P_{n}$$ (meeting 8).

Find
Verify that $$\left \{ P_{i}(x), i=0,1,2,...\right \}$$ is orthogonal function for $$ n=0,1,...,5$$. 1. Show that $$\Gamma$$ is diagonal. 2. Find the determinant of $$\Gamma$$.

Solution
We solved this problem on our own, using values from Wolfram Alpha 

As per meeting 8, the Legendre polynomials are as follows: $$\mathbf{P}_{0}(x)=1$$ $$\mathbf{P}_{1}(x)=x$$ $$\mathbf{P}_{2}(x)=\frac{1}{2}(3x^2-1)$$ $$\mathbf{P}_{3}(x)=\frac{1}{2}(5x^3-3x)$$ $$\mathbf{P}_{4}(x)=\frac{35}{8}(x^4-\frac{15}{4}x^2+\frac{3}{8})$$ $$\mathbf{P}_{5}(x)=\frac{1}{8}(63x^5-70x^3+15x)$$ To solve this, the Gram matrix should be constructed as follows: $$\mathbf{\Gamma} = \begin{vmatrix}\mathbf{\Gamma}_{ij} \end{vmatrix} = \begin{vmatrix} <\mathbf{P}_{i},\mathbf{P}_{j}> \end{vmatrix} $$, where i = rows and j = columns.

1. Proof that $$\mathbf{\Gamma}$$ is diagonal matrix
Expanding the Gram matrix, we get: $$ \begin{vmatrix} <\mathbf{P}_{0},\mathbf{P}_{0}> & <\mathbf{P}_{0},\mathbf{P}_{1}> & <\mathbf{P}_{0},\mathbf{P}_{2}> & <\mathbf{P}_{0},\mathbf{P}_{3}> & <\mathbf{P}_{0},\mathbf{P}_{4}> & <\mathbf{P}_{0},\mathbf{P}_{5}>\\ <\mathbf{P}_{1},\mathbf{P}_{0}> & <\mathbf{P}_{1},\mathbf{P}_{1}> & <\mathbf{P}_{1},\mathbf{P}_{2}> & <\mathbf{P}_{1},\mathbf{P}_{3}> & <\mathbf{P}_{1},\mathbf{P}_{4}> & <\mathbf{P}_{1},\mathbf{P}_{5}>\\ <\mathbf{P}_{2},\mathbf{P}_{0}> & <\mathbf{P}_{2},\mathbf{P}_{1}> & <\mathbf{P}_{2},\mathbf{P}_{2}> & <\mathbf{P}_{2},\mathbf{P}_{3}> & <\mathbf{P}_{2},\mathbf{P}_{4}> & <\mathbf{P}_{2},\mathbf{P}_{5}>\\ <\mathbf{P}_{3},\mathbf{P}_{0}> & <\mathbf{P}_{3},\mathbf{P}_{1}> & <\mathbf{P}_{3},\mathbf{P}_{2}> & <\mathbf{P}_{3},\mathbf{P}_{3}> & <\mathbf{P}_{3},\mathbf{P}_{4}> & <\mathbf{P}_{3},\mathbf{P}_{5}>\\ <\mathbf{P}_{4},\mathbf{P}_{0}> & <\mathbf{P}_{4},\mathbf{P}_{1}> & <\mathbf{P}_{4},\mathbf{P}_{2}> & <\mathbf{P}_{4},\mathbf{P}_{3}> & <\mathbf{P}_{4},\mathbf{P}_{4}> & <\mathbf{P}_{4},\mathbf{P}_{5}>\\ <\mathbf{P}_{5},\mathbf{P}_{0}> & <\mathbf{P}_{5},\mathbf{P}_{1}> & <\mathbf{P}_{5},\mathbf{P}_{2}> & <\mathbf{P}_{5},\mathbf{P}_{3}> & <\mathbf{P}_{5},\mathbf{P}_{4}> & <\mathbf{P}_{5},\mathbf{P}_{5}> \end{vmatrix} $$ To evaluate the dot product of two functions, we use: $$\int_{-1}^{1}\mathbf{P}_{i}(x)\mathbf{P}_{j}(x)dx=\delta _{i,j}$$. Evaluating the elements: $$ <\mathbf{P}_{0},\mathbf{P}_{0}> = \int_{-1}^{1}1(1)dx=2$$

$$<\mathbf{P}_{0},\mathbf{P}_{1}>= \int_{-1}^{1}1xdx=1-1=0$$

$$<\mathbf{P}_{0}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{1}{2}(3x^2-1)=(1^{3}-1)-((-1)^{3}-(-1))=0$$

$$ <\mathbf{P}_{0},\mathbf{P}_{3}> = \int_{-1}^{1}\frac{1}{2}(5x^3-3x)dx=\left ( \frac{5}{4}-\frac{3}{2}\right )-\left ( \frac{5}{4}-\frac{3}{2} \right ) =0$$

$$ <\mathbf{P}_{0},\mathbf{P}_{4}> = \int_{-1}^{1}\frac{35}{8}(x^4-\frac{15}{4}x^2+\frac{3}{8})dx= \left( \frac{-1}{5}+\frac{5}{4}-\frac{3}{8} \right) - \left( \frac{-1}{5}+\frac{5}{4}-\frac{3}{8} \right)=0$$

$$ <\mathbf{P}_{0},\mathbf{P}_{5}> = \int_{-1}^{1}\frac{1}{8}(63x^5-70x^3+15x)dx= \left( \frac{63}{6}-\frac{70}{4}+\frac{15}{2} \right) - \left( \frac{63}{6}-\frac{70}{4}+\frac{15}{2} \right)=0$$

$$<\mathbf{P}_{1}, \mathbf{P}_{0}>=\int_{-1}^{1}xdx= 1-1=0$$

$$ <\mathbf{P}_{1},\mathbf{P}_{1}> = \int_{-1}^{1}x(x)dx=\frac{1}{3}\left [ x^3 \right ]_{-1}^{1}=\frac{2}{3}$$

$$<\mathbf{P}_{1}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{1}{2}3x^{3}-xdx=\frac{1}{2}\left[ \frac{3}{4}x^{4}-\frac{1}{2}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{1}, \mathbf{P}_{3}>=\int_{-1}^{1}\frac{1}{2}\left(5x^{4}-4x^{2}\right)dx=\left[x^{5}-x^{3}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{1}, \mathbf{P}_{4}>=\int_{-1}^{1}\frac{38}{5}\left(x^{5}-\frac{15}{4}x^{3}+\frac{3}{8}x\right)dx=\left[ \frac{1}{6}x^{6}-\frac{15}{16}x^{4}+\frac{3}{16}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{1}, \mathbf{P}_{5}>=\int_{-1}^{1}\frac{1}{8}(64x^{6}-70x^{4}+15x^{2})dx=\left[ \frac{64}{7}x^{7}-14x^{5}+5x^{3}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2}, \mathbf{P}_{0}>=\int_{-1}^{1}\frac{1}{2}(3x^{2}-1)dx=\left[ x^{3}-x\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2}, \mathbf{P}_{1}>=\int_{-1}^{1}\frac{1}{2}(3x^{3}-x)dx=\left[ \frac{3}{4}x^{4}-\frac{1}{2}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2},\mathbf{P}_{2}> = \int_{-1}^{1}\left ( \frac{1}{2}\left ( 3x^2-1 \right ) \right )\left ( \frac{1}{2}\left ( 3x^2-1 \right ) \right )dx = \frac{1}{4}\int_{-1}^{1} 9x^4-6x^2+1dx = \frac{1}{4}\left [ \frac{9}{5}x^5-2x^3+x \right ]_{-1}^{1}=\frac{2}{5}$$

$$<\mathbf{P}_{2}, \mathbf{P}_{3}>=\int_{-1}^{1}\frac{1}{4}\left( 15x^{5}-14x^{3}+3x \right)dx=\left[\frac{15}{6}x^{6}-\frac{14}{4}x^{4}+\frac{3}{2}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2}, \mathbf{P}_{4}>=\int_{-1}^{1}\frac{35}{16}\left( 3x^6-\frac{49}{4}x^4-\frac{21}{8}x^2-\frac{3}{8}\right)dx=\left[ \frac{3}{7}x^7-\frac{49}{20}x^5-\frac{7}{8}x^3-\frac{3}{8}x \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2}, \mathbf{P}_{5}>=\int_{-1}^{1}\frac{1}{16}\left( 189x^7 - 273x^5 +115x^3 -15x \right)dx= \left[ \frac{189}{8}x^8 - \frac{273}{6}x^6 + \frac{115}{4}x^4 -\frac{15}{2}x^2 \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{3}, \mathbf{P}_{0}>=\int_{-1}^{1}\frac{1}{2}(5x^3 -3x)dx=\left[ \frac{5}{4}x^4 - \frac{3}{2}x^2 \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{3}, \mathbf{P}_{1}>=\int_{-1}^{1}\frac{1}{2}(5x^4 - 3x^2)dx=\left[ x^5 - x^3 \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{3}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{1}{4}\left( 15x^{5}-14x^{3}+3x \right)dx=\left[\frac{15}{6}x^{6}-\frac{14}{4}x^{4}+\frac{3}{2}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{3},\mathbf{P}_{3}>=\int_{-1}^{1}\left ( \frac{1}{2}\left ( 5x^3-3x \right ) \right )\left ( \frac{1}{2}\left ( 5x^3-3x \right ) \right )dx= \frac{1}{4}\int_{-1}^{1}25x^6-30x^4+9x^2dx = \frac{-3}{2}$$ (| WA)

$$<\mathbf{P}_{3}, \mathbf{P}_{4}>=\int_{-1}^{1}\frac{35}{16}\left( 5x^7 - \frac{87}{4}x^5 + \frac{105}{8}x^3 - \frac{9}{8} \right)= \left[ \frac{5}{8}x^8 - \frac{87}{24}x^6 + \frac{105}{32}x^4 - \frac{9}{16}x^2 \right]_{-1}^{1} = 0$$

$$<\mathbf{P}_{3}, \mathbf{P}_{5}>=\int_{-1}^{1}\frac{1}{16}\left( 315x^8 -539x^6 - 135x^4 -45x \right)= 0$$

$$<\mathbf{P}_{4}, \mathbf{P}_{1}>=\int_{-1}^{1}\int_{-1}^{1}\frac{38}{5}\left(x^{5}-\frac{15}{4}x^{3}+\frac{3}{8}x\right)dx=\left[ \frac{1}{6}x^{6}-\frac{15}{16}x^{4}+\frac{3}{16}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{4}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{35}{16}\left( 3x^6-\frac{49}{4}x^4-\frac{21}{8}x^2-\frac{3}{8}\right)dx=\left[ \frac{3}{7}x^7-\frac{49}{20}x^5-\frac{7}{8}x^3-\frac{3}{8}x \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{4}, \mathbf{P}_{3}>=\int_{-1}^{1}\frac{35}{16}\left( 5x^7 - \frac{87}{4}x^5 + \frac{105}{8}x^3 - \frac{9}{8} \right)= \left[ \frac{5}{8}x^8 - \frac{87}{24}x^6 + \frac{105}{32}x^4 - \frac{9}{16}x^2 \right]_{-1}^{1} = 0$$

$$<\mathbf{P}_{4},\mathbf{P}_{4}> = \int_{-1}^{1}\left ( \frac{35}{8}\left ( x^4-\frac{15}{4}x^2+\frac{3}{8} \right ) \right )\left ( \frac{35}{8}\left ( x^4-\frac{15}{4}x^2+\frac{3}{8} \right ) \right )dx \approx 46.1407$$ (| WA)

$$<\mathbf{P}_{4},\mathbf{P}_{5}> = \int_{-1}^{1}\frac{35}{64}\left( x^4 - \frac{15}{4}x^2 + \frac{3}{8} \right)\left( 63x^5 - 70x^3 + 15x \right)dx = 0$$

$$<\mathbf{P}_{5},\mathbf{P}_{0}>= \int_{-1}^{1}\frac{1}{8}(63x^5-70x^3+15x)dx= \left( \frac{63}{6}-\frac{70}{4}+\frac{15}{2} \right) - \left( \frac{63}{6}-\frac{70}{4}+\frac{15}{2} \right)=0$$

$$<\mathbf{P}_{5}, \mathbf{P}_{1}>=\int_{-1}^{1}\frac{1}{8}(64x^{6}-70x^{4}+15x^{2})dx=\left[ \frac{64}{7}x^{7}-14x^{5}+5x^{3}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{5}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{1}{16}\left( 189x^7 - 273x^5 +115x^3 -15x \right)dx= \left[ \frac{189}{8}x^8 - \frac{273}{6}x^6 + \frac{115}{4}x^4 -\frac{15}{2}x^2 \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{5}, \mathbf{P}_{3}>=\int_{-1}^{1}\frac{1}{16}\left( 315x^8 -539x^6 - 135x^4 -45x \right)= 0$$

$$<\mathbf{P}_{5},\mathbf{P}_{4}> = \int_{-1}^{1}\frac{35}{64}\left( x^4 - \frac{15}{4}x^2 + \frac{3}{8} \right)\left( 63x^5 - 70x^3 + 15x \right)dx = 0$$

$$ <\mathbf{P}_{5},\mathbf{P}_{5}>=\int_{-1}^{1}\left ( \frac{1}{8}\left ( 65x^5-70x^3+15x \right ) \right )\left ( \frac{1}{8}\left ( 65x^5-70x^3+15x \right ) \right ) dx = 0.1818$$ (| WA) Our simplified matrix is:
 * {| style="width:100%" border="0" align="left"

$$ \begin{vmatrix} 2 & 0 & 0 & 0 & 0 & 0\\ 0 & 0.66 & 0 & 0 & 0 & 0\\ 0 & 0 & 0.4 & 0 & 0 & 0\\ 0 & 0 & 0 & -1.5 & 0 & 0\\ 0 & 0 & 0 & 0 & 46.14 & 0\\ 0 & 0 & 0 & 0 & 0 & 0.18 \end{vmatrix} $$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

2. Determinant of $$\Gamma$$
The determinant was calculated using the following Octave program: octave-3.2.4.exe.1> g=[2 0 0 0 0 0; 0 0.66 0 0 0 0; 0 0 0.4 0 0 0; 0 0 0 -1.5 0 0; 0 0 0 0 46.14 0; 0 0 0 0 0 0.18]; octave-3.2.4.exe.2> det(g) octave-3.2.4.exe.3> ans = -6.577
 * {| style="width:100%" border="0" align="left"

$$det(\boldsymbol{\Gamma})= -6.5777$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

=Problem 8 - Trapezoidal rule (simple) = From (meeting 9 page 4)

Given

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

I = I_1(f) = \int\limits_{a}^{b} f_1(x) \, dx = (\int\limits_{a}^{b} l_0(x) \ dx)f(x_0) + (\int\limits_{a}^{b} l_1(x) \ dx)f(x_1)] $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (8-1)
 * }
 * }


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

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

Find
Show $$ (8-1) ==> (8.2) $$

==> Trap. rule(simple)

Solution
We refered to Egm6341.s10.Team4 but we solved again by ourselves and discussed about background knowledge and tried to make more clearly.

Background knowledge :  Trapezoidal_rule , Lagrange

According to the lecture mtg9 (9-2) and (9-3)


 * $$\displaystyle

f_1(x) = P_1(x) = \sum_{i=0}^{n=1} l_i(x)f(x_i) $$
 * $$\displaystyle

f_1(x) = \underbrace{l_0(x)}_{\frac{x-x_1}{x_0-x_1}}f(x_0) + \underbrace{l_1(x)}_{\frac{x-x_1}{x_1-x_0}}f(x_1) $$

Simply define


 * $$\displaystyle

x_0=a;   x_1=b $$


 * $$\displaystyle

(8-1) \Rightarrow\ I= \int\limits_{a}^{b}[\dfrac{x-b}{a-b}f(a)+\dfrac{x-a}{b-a}f(b)]\, dx $$



\dfrac{1}{b-a} \int\limits_{a}^{b}[(b-x)f(a)+(x-a)f(b)]\, dx $$



=\dfrac{1}{b-a} [\int\limits_{a}^{b}(b-x)f(a)\, dx]+[\int\limits_{a}^{b}(x-a)f(b)\, dx] $$

Now, integration can be easily solved in its interval:



=\dfrac{1}{b-a}[f(a)(bx-\dfrac{x^2}{2})+f(b)(\dfrac{x^2}{2}-ax)]_{a}^{b}=\dfrac{1}{b-a}[f(a)(\dfrac{b^2}{2}-ab+\dfrac{a^2}{2})+f(b)(\dfrac{b^2}{2}-ab+\dfrac{a^2}{2})] $$



=\dfrac{1}{2(b-a)}[f(a)(b-a)^2+f(b)(b-a)^2]=\dfrac{b-a}{2}[f(a)+f(b)] $$

So,


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

$$\displaystyle \Rightarrow I = \dfrac{b-a}{2}[f(a)+f(b)] $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |


 * style= |


 * }.
 * }.

Author and proof-reader
[Author] Oh

[Proof-reader] cavalcanti

=Problem 9 - Find the roots= From (meeting 10 page 1)

Given
Legendre Polynominal From (meeting 8 page 1)

$$P_{n}(x)=\sum _{i=0}^{\text{IntegerPart}\left[\frac{n}{2}\right]} \frac{(-1)^i (2 n-2 i)! x^{n-2 i}}{2^n (i! (n-2 i)! (n-i)!)}$$

Find
Find and plot the roots (interception with the x axis) for n=5&10

Solution
For $${{\rm P}_5}(x)$$ the equation is as follows: $${{\rm P}_5}(x) = \sum\limits_{i = 0}^{\left[ {\frac{5}{2}} \right]} {{{( - 1)}^i}\frac} $$ for $$i=0$$ $$ \Rightarrow \frac = \frac{8}{x^5}$$ for $$i = 1$$ $$ \Rightarrow - \frac =  - \frac{4}{x^3}$$ for $$i = 2$$ $$ \Rightarrow \frac = \frac{8}{x^{}}$$ $$ \Rightarrow {{\rm P}_5}(x)=\frac{8}{x^5} - \frac{4}{x^3} + \frac{8}x$$

Solved my self using Mathematica 7 and the following commands: P[n_] := Simplify[Sum[1/(2^n)*((-1)^i (2 n - 2 i)! x^(n - 2 i))/(i! (n - 2 i)! (n - i)!), {i, 0,IntegerPart[n/2]}]]

sol5 = Solve[P[5] == 0, x];

MatrixForm[Simplify[Sort[(x /. sol5), Less]]]

sol10 = Solve[P[10] == 0, x];

MatrixForm[N[Sort[(x /. sol10), Less],18]]

Roots of $$P_{5}(x)=\left( \begin{array}{c} -\frac{1}{3} \sqrt{5+2 \sqrt{\frac{10}{7}}} \\ -\frac{1}{3} \sqrt{5-2 \sqrt{\frac{10}{7}}} \\ 0 \\ \frac{1}{3} \sqrt{5-2 \sqrt{\frac{10}{7}}} \\ \frac{1}{3} \sqrt{5+2 \sqrt{\frac{10}{7}}} \end{array} \right)$$

Which matches excatly with the given table on (meeting 7 page 5) For $${{\rm P}_{10}}(x)$$ the equation is as follows: $${{\rm P}_{10}}(x) = \sum\limits_{i = 0}^{\left[ {\frac{10}{2}} \right]} {{{( - 1)}^i}\frac} $$ for $$i=0$$ $$ \Rightarrow \frac = \frac{x^{10}}$$ for $$i=1$$ $$\Rightarrow - \frac =  - \frac{x^8}$$ for $$i=2$$ $$\Rightarrow \frac = \frac{x^6}$$ for $$i=3$$ $$\Rightarrow - \frac =  - \frac{x^4}$$ for $$i=4$$ $$ \Rightarrow \frac = \frac{x^2}$$ for $$i=5$$ $$ \Rightarrow - \frac =  - \frac$$ $$ \Rightarrow {{\rm P}_{10}}(x) = \frac{x^{10}} - \frac{x^8} + \frac{x^6} - \frac{x^4} + \frac{x^2} - \frac$$ All of the values we checked using Wolframalpha Roots of $$P_{10}(x)=\left( \begin{array}{c} -0.973906528517171720 \\ -0.865063366688984511 \\ -0.679409568299024406 \\ -0.433395394129247191 \\ -0.148874338981631211 \\ 0.148874338981631211 \\ 0.433395394129247191 \\ 0.679409568299024406 \\ 0.865063366688984511 \\ 0.973906528517171720 \end{array} \right)$$

Which matches excatly with the values given here: (NIST Quadrature)



Roots of the Legendre Polynominal for n=5,10

Observations

The two curves and point sets in the figure suggests that the roots of the Legendre Polynominal have a tendency to group towards the extremes of -1 and 1 and this grouping becomes more pronounced the higher the order, n. Both are evenly distributed about the y axis and odd functions have a root at x=0.

Author and proof-reader
[Author] J Davis 21:28, 30 January 2011 (UTC), Reiss

[Proof-reader]

=Problem 10 - Lagrange Basis Approximation= From (meeting 10 page 4)

Given

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

p_2(x) = c_2 x^2 + c_1 x + c_0 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (10-1)


 * }
 * }


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

p_2(x) = f(x_i), \ i=0,1,2 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (10-2)


 * }
 * }

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
 * $$\displaystyle (10-3)


 * }.
 * }.

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
 * $$\displaystyle (10-4)


 * }.
 * }.

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
 * $$\displaystyle


 * }.
 * }.

Solution
 We refered to Egm6341.s10.Team4 but we solved again by ourselves and discussed about background knowledge

Background knowledge :  Lagrange_polynomial ,

Equation (10-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
 * $$\displaystyle (10-5)


 * }
 * }


 * {| 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
 * $$\displaystyle (10-6)


 * }
 * }


 * {| 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
 * <p style="text-align:right;">$$\displaystyle (10-7)


 * }
 * }

Substituting Equations (10-5), (10-6) and (10-7) in (10-3),


 * {| 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
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (10-8)


 * }
 * }

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
 * $$\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 and proof-reader
[Author] Oh

[Proof-reader]

=Problem 11 - Derivation of simple Simpson's rule= From (meeting 10 page 4)

Given
From the class note p.8-3


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

I(f_n)=\int_a^b \! f_n(x) \, \mathrm{d}x $$ $$ ,where
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-1)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

f_n(x)=P_n(x)=\sum_{i=0}^n l_{i,n}(x)f(x_i) $$ $$ Let $$\displaystyle n=2.$$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-2)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

P_2(x)=\sum_{i=0}^{n=2} l_{i,2}(x)f(x_i) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-3)
 * }
 * $$\displaystyle
 * $$\displaystyle

\begin{align} x_0&=a \\ x_1&=\frac{a+b}{2} \\ x_2&=b \end{align} $$

Find
Derive simple Simpson's rule using Eq.(11-3).
 * Simple Simpson's rule:
 * $$\displaystyle

I_2=\frac{h}{3}[f_0+4f_1+f_2] $$ ,where $$\displaystyle h=\frac{b-a}{2} $$

Solution
First, Lagrange interpolation functions need to be computed using the definition shown below.
 * {| style="width:100%" border="0" align="left"

l_{i,n}(x)=\prod_{j=0}^n \frac{x-x_j}{x_i-x_j} $$ $$ So, the following steps can be done.
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-4)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

\begin{align} l_{0,2}(x)&=\frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}=\frac{1}{(x_0-x_1)(x_0-x_2)}\left[x^2-(x_1+x_2)x+x_1 x_2\right]\\ l_{1,2}(x)&=\frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}=\frac{1}{(x_1-x_0)(x_1-x_2)}\left[x^2-(x_0+x_2)x+x_0 x_2\right]\\ l_{2,2}(x)&=\frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)}=\frac{1}{(x_2-x_0)(x_2-x_1)}\left[x^2-(x_0+x_1)x+x_0 x_1\right] \end{align} $$ $$ Also, Eq (11-3) can be rewritten in the following form.
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-5)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

P_2(x)=l_{0,2}f(x_0)+l_{1,2}f(x_1)+l_{2,2}f(x_2) $$ $$ Also, the integral equation (11-1) can be rewritten as follows.
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-6)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

\begin{align} I(f_n)&=\int_{x_0}^{x_2} \! P_2(x) \, \mathrm{d}x \\ &=\int_{x_0}^{x_2} \! l_{0,2}f(x_0)+l_{1,2}f(x_1)+l_{2,2}f(x_2) \, \mathrm{d}x \\ &=f(x_0) \int_{x_0}^{x_2} \! l_{0,2} \, \mathrm{d}x +f(x_1) \int_{x_0}^{x_2} \! l_{1,2} \, \mathrm{d}x +f(x_2) \int_{x_0}^{x_2} \! l_{2,2} \, \mathrm{d}x \end{align} $$ $$ Each integral terms in Eq.11-7 can be obtained through the following steps.
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-7)
 * }
 * }
 * $$\displaystyle

\begin{align} \int_{x_0}^{x_2} \! l_{0,2} \, \mathrm{d}x &=\frac{1}{(x_0-x_1)(x_0-x_2)} \int_{x_0}^{x_2} \! \left[x^2-(x_1+x_2)x+x_1 x_2\right] \, \mathrm{d}x\\ &=\frac{1}{(x_0-x_1)(x_0-x_2)} \left[\frac{1}{3}x^3-\frac{(x_1+x_2)}{2}x^2+x_1 x_2 x \right]_{x_0}^{x_2}\\ &=\frac{1}{(x_0-x_1)(x_0-x_2)} \left[\frac{1}{3}(x_2^3-x_0^3)-\frac{(x_1+x_2)}{2}(x_2^2-x_0^2)+x_1 x_2(x_2-x_0) \right] \\ &=\frac{(x_2-x_0)}{(x_0-x_1)(x_0-x_2)} \left[\frac{(x_2^2+x_2 x_0+x_0^2)}{3}-\frac{(x_1+x_2)(x_2+x_0)}{2}+x_1 x_2 \right] \\ & \mbox{Substituting,} x_1=\frac{x_2+x_0}{2}   \mbox{in the above equation}  \\ &=\frac{(-1)}{(x_0-x_1)} \left[\frac{(x_2^2+x_2 x_0+x_0^2)}{3}-(x_1+x_2)x_1+x_1 x_2 \right] \\ &=\frac{(-1)}{(x_0-x_1)} \left[\frac{x_2^2+x_2 x_0+x_0^2-3x_1^2}{3} \right] \\ & \mbox{Substituting,} x_1=\frac{x_2+x_0}{2}    \mbox { in the above equation}\\ &=\frac{(-2)}{(x_0-x_2)} \left[\frac{4(x_2^2+x_2 x_0+x_0^2)-3(x_0^2+2x_0 x_2+x_2^2)}{12} \right] \\ &=\frac{(-2)}{(x_0-x_2)} \left[\frac{x_2^2-2 x_2 x_0+x_0^2}{12} \right] \\ &=\frac{(-2)}{(x_0-x_2)} \left[\frac{(x_2-x_0)^2}{12} \right] \\ &=\frac{(x_2-x_0)}{6} \end{align} $$
 * $$\displaystyle

\begin{align} \int_{x_0}^{x_2} \! l_{1,2} \, \mathrm{d}x &=\frac{1}{(x_1-x_0)(x_1-x_2)} \int_{x_0}^{x_2} \! \left[x^2-(x_0+x_2)x+x_0 x_2\right] \, \mathrm{d}x\\ &=\frac{1}{(x_1-x_0)(x_1-x_2)} \left[\frac{1}{3}x^3-\frac{(x_0+x_2)}{2}x^2+x_0 x_2 x \right]_{x_0}^{x_2}\\ &=\frac{1}{(x_1-x_0)(x_1-x_2)} \left[\frac{1}{3}(x_2^3-x_0^3)-\frac{(x_0+x_2)}{2}(x_2^2-x_0^2)+x_0 x_2(x_2-x_0) \right] \\ &=\frac{(x_2-x_0)}{(x_1-x_0)(x_1-x_2)} \left[\frac{(x_2^2+x_2 x_0+x_0^2)}{3}-\frac{(x_2+x_0)^2}{2}+x_0 x_2 \right] \\ &=\frac{(x_2-x_0)}{(x_1-x_0)(x_1-x_2)} \left[\frac{(2x_2^2+2x_2 x_0+2x_0^2)}{6}-\frac{3x_2^2+6x_2 x_0+3x_0^2}{6}+\frac{6x_0 x_2}{6} \right] \\ &=\frac{(x_2-x_0)}{(x_1-x_0)(x_1-x_2)} \left[\frac{-x_2^2+2x_2 x_0-x_0^2}{6} \right] \\ & \mbox{Substituting } x_1=\frac{x_2+x_0}{2} \mbox{ in the above equation}\\ &=\frac{(x_2-x_0)}{(\frac{x_2-x_0}{2})(\frac{x_0-x_2}{2})} \left[\frac{-(x_2-x_0)^2}{6} \right] \\ &=\frac{4(x_2-x_0)}{6} \end{align} $$
 * $$\displaystyle

\begin{align} \int_{x_0}^{x_2} \! l_{2,2} \, \mathrm{d}x &=\frac{1}{(x_2-x_0)(x_2-x_1)} \int_{x_0}^{x_2} \! \left[x^2-(x_0+x_1)x+x_0 x_1\right] \, \mathrm{d}x\\ &=\frac{1}{(x_2-x_0)(x_2-x_1)} \left[\frac{1}{3}x^3-\frac{(x_0+x_1)}{2}x^2+x_0 x_1 x \right]_{x_0}^{x_2}\\ &=\frac{1}{(x_2-x_0)(x_2-x_1)} \left[\frac{1}{3}(x_2^3-x_0^3)-\frac{(x_0+x_1)}{2}(x_2^2-x_0^2)+x_0 x_1(x_2-x_0) \right] \\ &=\frac{(x_2-x_0)}{(x_2-x_0)(x_2-x_1)} \left[\frac{(x_2^2+x_2 x_0+x_0^2)}{3}-\frac{(x_0+x_1)(x_2+x_0)}{2}+x_0 x_1 \right] \\ & \mbox{Substituting} x_1=\frac{x_2+x_0}{2} \mbox{in the above equation} \\ &=\frac{1}{(x_2-x_1)} \left[\frac{(x_2^2+x_2 x_0+x_0^2)}{3}-(x_0+x_1)x_1+x_0 x_1 \right] \\ &=\frac{1}{(x_2-x_1)} \left[\frac{x_2^2+x_2 x_0+x_0^2-3x_1^2}{3} \right] \\ & \mbox{Substitute } x_1=\frac{x_2+x_0}{2} \mbox{ in the above equation}\\ &=\frac{2}{(x_2-x_0)} \left[\frac{4(x_2^2+x_2 x_0+x_0^2)-3(x_0^2+2x_0 x_2+x_2^2)}{12} \right] \\ &=\frac{2}{(x_2-x_0)} \left[\frac{x_2^2-2 x_2 x_0+x_0^2}{12} \right] \\ &=\frac{2}{(x_2-x_0)} \left[\frac{(x_2-x_0)^2}{12} \right] \\ &=\frac{(x_2-x_0)}{6} \end{align} $$ Therefore,
 * {| style="width:100%" border="0" align="left"

\int_{x_0}^{x_2} \! l_{0,2} \, \mathrm{d}x = \frac{(x_2-x_0)}{6} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-8)
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

\int_{x_0}^{x_2} \! l_{1,2} \, \mathrm{d}x =\frac{4(x_2-x_0)}{6} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-9)
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

\int_{x_0}^{x_2} \! l_{2,2} \, \mathrm{d}x = \frac{(x_2-x_0)}{6} $$ $$ We know that $$\displaystyle x_2=b$$, $$\displaystyle x_0=a$$. In addition, the term $$\displaystyle h $$ in the definition of simple Simpson's rule is defined as $$\displaystyle h=\frac{b-a}{2}$$. As a result, the following can be concluded:
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (11-10)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$\displaystyle \begin{align} I(f_n)&=f(x_0) \int_{x_0}^{x_2} \! l_{0,2} \, \mathrm{d}x +f(x_1) \int_{x_0}^{x_2} \! l_{1,2} \, \mathrm{d}x +f(x_2) \int_{x_0}^{x_2} \! l_{2,2} \, \mathrm{d}x \\ &=\frac{(x_2-x_0)}{6}f(x_0)+\frac{4(x_2-x_0)}{6}f(x_1)+\frac{(x_2-x_0)}{6}f(x_2) \\ &=\frac{(b-a)}{6}f(x_0)+\frac{4(b-a)}{6}f(x_1)+\frac{(b-a)}{6}f(x_2) \\ &=\frac{h}{3}f(x_0)+\frac{4h}{3}f(x_1)+\frac{h}{3}f(x_2) \end{align} $$
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

Author and proof-reader
[Author] Shin

[Proof-reader] Raghunathan

=Problem 12 - Newton-Cotes method= From (meeting 10 page 4)

Given
$$\displaystyle f(x)=\frac{e^{x}-1}{x}$$, $$\displaystyle x \in [-1,1]$$

Find

 * 1) Construct $$\displaystyle f_n(x)$$ defined in Eq.12-1 for $$\displaystyle n=1,2,4,8,16$$.
 * 2) Plot $$\displaystyle f, f_{n}$$ for $$\displaystyle n=1,2,4,8,16$$.
 * 3) Compute $$\displaystyle I(f_n)=\int_a^b \! f_n(x) \, \mathrm{d}x$$,(n=1,2,4,8,16) and compare to $$\displaystyle I$$ from WA.
 * 4) For $$\displaystyle n=5$$, plot $$\displaystyle l_{0},l_{1},l_{2}$$. How will $$\displaystyle l_{3},l_{4},l_{5}$$ look?

Construct
CASE 1 : $$\displaystyle n=1 $$
 * $$\displaystyle x_0=-1,\quad x_1=1 $$
 * {| style="width:100%" border="0" align="left"

f_1(x) = P_1(x)=\sum_{i=0}^{1} l_{i,1}(x)f(x_i)=l_{0,1}(x)f(x_0)+l_{1,1}f(x_1) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (12-3)
 * }
 * , where
 * $$\displaystyle
 * $$\displaystyle

\begin{align} l_{0,1}(x)&=\frac{(x-x_1)}{(x_0-x_1)}=\frac{x-1}{-2}, \quad f(x_0)=f(-1)=1-e^{-1} \\ l_{1,1}(x)&=\frac{(x-x_0)}{(x_1-x_0)}=\frac{x+1}{2}, \quad f(x_1)=f(1)=e-1 \end{align} $$ CASE 2 : $$\displaystyle n=2 $$
 * $$\displaystyle x_0=-1,\quad x_1=0,\quad x_2=1 $$
 * {| style="width:100%" border="0" align="left"

f_2(x) = P_2(x)=\sum_{i=0}^{2} l_{i,2}(x)f(x_i)=l_{0,2}(x)f(x_0)+l_{1,2}f(x_1)+l_{2,2}f(x_2) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (12-4)
 * }
 * , where
 * $$\displaystyle
 * $$\displaystyle

\begin{align} l_{0,2}(x)&=\frac{(x-x_1)}{(x_0-x_1)}\frac{(x-x_2)}{(x_0-x_2)}=\frac{x(x-1)}{2}, \quad f(x_0)=f(-1)=1-e^{-1} \\ l_{1,2}(x)&=\frac{(x-x_0)}{(x_1-x_0)}\frac{(x-x_2)}{(x_1-x_2)}=\frac{(x+1)(x-1)}{-1}, \quad f(x_1)=f(0)=1 \\ l_{2,2}(x)&=\frac{(x-x_0)}{(x_2-x_0)}\frac{(x-x_1)}{(x_2-x_1)}=\frac{(x+1)x}{2}, \quad f(x_1)=f(1)=e+1 \end{align} $$ CASE 3 : $$\displaystyle n=4 $$
 * $$\displaystyle

x_0=-1,\quad x_1=-\frac{1}{2}, \quad x_2=0, \quad x_3=\frac{1}{2}, \quad x_4=1 $$
 * {| style="width:100%" border="0" align="left"

f_4(x)=P_4(x)=\sum_{i=0}^{4}l_{i,4}(x)f(x_{i})=l_{0,4}(x)f(x_{0})+l_{1,4}(x)f(x_{1})+l_{2,4}(x)f(x_{2})+l_{3,4}(x)f(x_{3})+l_{4,4}(x)f(x_{4}) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (12-5)
 * }
 * , where
 * $$\displaystyle
 * $$\displaystyle

\begin{align} l_{0,4}&=\prod_{j=0}^{4}\frac{x-x_{j}}{x_{0}-x_{j}}=\frac{(x+\frac{1}{2})(x-0)(x-\frac{1}{2})(x-1)}{(-1+\frac{1}{2})(-1-0)(-1-\frac{1}{2})(-1-1)}, \quad f(x_{0})=f(-1)=1-e^{-1} \\ l_{1,4}&=\prod_{j=0}^{4}\frac{x-x_{j}}{x_{1}-x_{j}}=\frac{(x+1)(x-0)(x-\frac{1}{2})(x-1)}{(-\frac{1}{2}+1)(-\frac{1}{2}-0)(-\frac{1}{2}-\frac{1}{2})(-\frac{1}{2}-1)}, \quad f(x_{1})=f(-\frac{1}{2})=\frac{e^{-\frac{1}{2}}-1}{-\frac{1}{2}} \\ l_{2,4}&=\prod_{j=0}^{4}\frac{x-x_{j}}{x_{2}-x_{j}}=\frac{(x+1)(x+\frac{1}{2})(x-\frac{1}{2})(x-1)}{(0+1)(0+\frac{1}{2})(0-\frac{1}{2})(0-1)}, \quad f(x_{2})=f(0)=1 \\ l_{3,4}&=\prod_{j=0}^{4}\frac{x-x_{j}}{x_{3}-x_{j}}=\frac{(x+1)(x+\frac{1}{2})(x-0)(x-1)}{(\frac{1}{2}+1)(\frac{1}{2}+\frac{1}{2})(\frac{1}{2}-0)(-\frac{1}{2}-1)}, \quad f(x_{3})=f(\frac{1}{2})=\frac{e^{\frac{1}{2}}-1}{\frac{1}{2}} \\ l_{4,4}&=\prod_{j=0}^{4}\frac{x-x_{j}}{x_{4}-x_{j}}=\frac{(x+1)(x+\frac{1}{2})(x-0)(x-\frac{1}{2})}{(-1+1)(-1+\frac{1}{2})(-1-0)(-1-\frac{1}{2})}, \quad f(x_{4})=f(1)=e^{1}-1 \\ \end{align} $$ CASE 4 : $$\displaystyle n=8 $$
 * $$\displaystyle

x_0=-1,\quad x_1=-\frac{3}{4},\quad x_2=-\frac{1}{2},\quad x_3=-\frac{1}{4},\quad x_4=0,\quad x_5=\frac{1}{4},\quad x_6=\frac{1}{2},\quad x_7=\frac{3}{4}, \quad x_8=1 $$
 * {| style="width:100%" border="0" align="left"

\begin{align} f_8(x)=P_8(x)=\sum_{i=0}^{8}l_{i,8}(x)f(x_{i})=&l_{0,8}(x)f(x_{0})+l_{1,8}(x)f(x_{1})+l_{2,8}(x)f(x_{2})+l_{3,8}(x)f(x_{3})+l_{4,8}(x)f(x_{4})+l_{5,8}(x)f(x_{5})+l_{6,8}(x)f(x_{6}) \\ &+l_{7,8}(x)f(x_{7})+l_{8,8}(x)f(x_{8}) \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (12-6)
 * }
 * , where
 * $$\displaystyle
 * $$\displaystyle

\begin{align} l_{0,8}&=\prod_{j=0}^{8}\frac{x-x_{j}}{x_{0}-x_{j}}=\frac{(x+\frac{3}{4})(x+\frac{1}{2})(x+\frac{1}{4})(x-0)(x-\frac{1}{4})(x-\frac{1}{2})(x-\frac{1}{4})(x-\frac{3}{4})(x-1)}{(-1+\frac{3}{4})(-1+\frac{1}{2})(-1+\frac{1}{4})(-1-0)(-1-\frac{1}{4})(-1-\frac{1}{2})(-1-\frac{3}{4})(-1-1)}, \quad f(x_{0})=f(-1)=1-e^{-1} \\ l_{1,8}&=\prod_{j=0}^{8}\frac{x-x_{j}}{x_{1}-x_{j}}=\frac{(x+1)(x+\frac{1}{2})(x+\frac{1}{4})(x-0)(x-\frac{1}{4})(x-\frac{1}{2})(x-\frac{1}{4})(x-\frac{3}{4})(x-1)}{(-\frac{3}{4}+1)(-\frac{3}{4}+\frac{1}{2})(-\frac{3}{4}+\frac{1}{4})(-\frac{3}{4}-0)(-\frac{3}{4}-\frac{1}{4})(-\frac{3}{4}-\frac{1}{2})(-\frac{3}{4}-\frac{3}{4})(-\frac{3}{4}-1)}, \quad f(x_{1})=f(-\frac{3}{4})==\frac{e^{-\frac{3}{4}}-1}{-\frac{3}{4}} \\ l_{2,8}&=\prod_{j=0}^{8}\frac{x-x_{j}}{x_{2}-x_{j}}=\frac{(x+1)(x+\frac{3}{4})(x+\frac{1}{4})(x-0)(x-\frac{1}{4})(x-\frac{1}{2})(x-\frac{1}{4})(x-\frac{3}{4})(x-1)}{(-\frac{1}{2}+1)(-\frac{1}{2}+\frac{3}{4})(-\frac{1}{2}+\frac{1}{4})(-\frac{1}{2}-0)(-\frac{1}{2}-\frac{1}{4})(-\frac{1}{2}-\frac{1}{2})(-\frac{1}{2}-\frac{3}{4})(-\frac{1}{2}-1)}, \quad f(x_{2})=f(-\frac{1}{2})=\frac{e^{-\frac{1}{2}}-1}{-\frac{1}{2}} \\ l_{3,8}&=\prod_{j=0}^{8}\frac{x-x_{j}}{x_{3}-x_{j}}=\frac{(x+1)(x+\frac{3}{4})(x+\frac{1}{2})(x-0)(x-\frac{1}{4})(x-\frac{1}{2})(x-\frac{1}{4})(x-\frac{3}{4})(x-1)}{(-\frac{1}{4}+1)(-\frac{1}{4}+\frac{3}{4})(-\frac{1}{4}+\frac{1}{2})(-\frac{1}{4}-0)(-\frac{1}{4}-\frac{1}{4})(-\frac{1}{4}-\frac{1}{2})(-\frac{1}{4}-\frac{3}{4})(-\frac{1}{4}-1)}, \quad f(x_{2})=f(-\frac{1}{4})=\frac{e^{-\frac{1}{4}}-1}{-\frac{1}{4}} \\ l_{4,8}&=\prod_{j=0}^{8}\frac{x-x_{j}}{x_{4}-x_{j}}=\frac{(x+1)(x+\frac{3}{4})(x+\frac{1}{2})(x+\frac{1}{4})(x-\frac{1}{4})(x-\frac{1}{2})(x-\frac{3}{4})(x-1)}{(0+1)(0+\frac{3}{4})(0+\frac{1}{2})(0+\frac{1}{4})(0-\frac{1}{4})(0-\frac{1}{2})(0-\frac{3}{4})(0-1)}, \quad f(x_{4})=f(0)=1 \\ l_{5,8}&=\prod_{j=0}^{8}\frac{x-x_{j}}{x_{5}-x_{j}}=\frac{(x+1)(x+\frac{3}{4})(x+\frac{1}{2})(x+\frac{1}{4})(x-0)(x-\frac{1}{2})(x-\frac{3}{4})(x-1)}{(\frac{1}{4}+1)(\frac{1}{4}+\frac{3}{4})(\frac{1}{4}+\frac{1}{2})(\frac{1}{4}+\frac{1}{4})(\frac{1}{4}-0)(\frac{1}{4}-\frac{1}{2})(\frac{1}{4}-\frac{3}{4})(\frac{1}{4}-1)}, \quad f(x_{5})=f(\frac{1}{4})=\frac{e^{\frac{1}{4}}-1}{\frac{1}{4}} \\ l_{6,8}&=\prod_{j=0}^{8}\frac{x-x_{j}}{x_{6}-x_{j}}=\frac{(x+1)(x+\frac{3}{4})(x+\frac{1}{2})(x+\frac{1}{4})(x-0)(x-\frac{1}{4})(x-\frac{3}{4})(x-1)}{(\frac{1}{2}+1)(\frac{1}{2}+\frac{3}{4})(\frac{1}{2}+\frac{1}{2})(\frac{1}{2}+\frac{1}{4})(\frac{1}{2}-0)(\frac{1}{2}-\frac{1}{4})(\frac{1}{2}-\frac{3}{4})(\frac{1}{2}-1)}, \quad f(x_{6})=f(\frac{1}{2})=\frac{e^{\frac{1}{2}}-1}{\frac{1}{2}} \\ l_{7,8}&=\prod_{j=0}^{8}\frac{x-x_{j}}{x_{7}-x_{j}}=\frac{(x+1)(x+\frac{3}{4})(x+\frac{1}{2})(x+\frac{1}{4})(x-0)(x-\frac{1}{2})(x-\frac{1}{4})(x-1)}{(\frac{3}{4}+1)(\frac{3}{4}+\frac{3}{4})(\frac{3}{4}+\frac{1}{2})(\frac{3}{4}+\frac{1}{4})(\frac{3}{4}-0)(\frac{3}{4}-\frac{1}{4})(\frac{3}{4}-\frac{1}{2})(\frac{3}{4}-1)}, \quad f(x_{7})=f(\frac{3}{4})=\frac{e^{\frac{3}{4}}-1}{\frac{3}{4}} \\ l_{8,8}&=\prod_{j=0}^{8}\frac{x-x_{j}}{x_{8}-x_{j}}=\frac{(x+1)(x+\frac{3}{4})(x+\frac{1}{2})(x+\frac{1}{4})(x-0)(x-\frac{1}{2})(x-\frac{1}{4})(x-\frac{3}{4})}{(1+1)(1+\frac{3}{4})(1+\frac{1}{2})(1+\frac{1}{4})(1-0)(1-\frac{1}{4})(1-\frac{1}{2})(1-\frac{3}{4})}, \quad f(x_{8})=f(1)=\frac{e-1}{1} \\ \end{align} $$ CASE 5 : $$\displaystyle n=16 $$
 * $$\displaystyle

\begin{align} x_0&=-1,\quad x_1=-\frac{7}{8},\quad x_2=-\frac{3}{4},\quad x_3=-\frac{5}{8},\quad x_4=-\frac{1}{2},\quad x_5=-\frac{3}{8},\quad x_6=-\frac{1}{4},\quad x_7=-\frac{1}{8}, \quad x_8=0 \\ x_9&=\frac{1}{8},\quad x_{10}=\frac{1}{4},\quad x_{11}=\frac{3}{8},\quad x_{12}=\frac{1}{2},\quad x_{13}=\frac{5}{8},\quad x_{14}=\frac{3}{4},\quad x_{15}=\frac{7}{8},\quad x_{16}=1 \end{align} $$
 * {| style="width:100%" border="0" align="left"

\begin{align} f_{16}(x)=P_{16}(x)=&\sum_{i=0}^{16}l_{i,16}(x)f(x_{i})=l_{0,16}(x)f(x_{0})+l_{1,16}(x)f(x_{1})+l_{2,16}(x)f(x_{2})+l_{3,16}(x)f(x_{3})+l_{4,16}(x)f(x_{4})+l_{5,16}(x)f(x_{5}) \\ &+l_{6,16}(x)f(x_{6})+l_{7,16}(x)f(x_{7})+l_{8,16}(x)f(x_{8})+l_{9,16}(x)f(x_{9})+l_{10,16}(x)f(x_{10})+l_{11,16}(x)f(x_{11})+l_{12,16}(x)f(x_{12}) \\ &+l_{13,16}(x)f(x_{13})+l_{14,16}(x)f(x_{14})+l_{15,16}(x)f(x_{15})+l_{16,16}(x)f(x_{16}) \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (12-7)
 * }
 * , where
 * $$\displaystyle
 * $$\displaystyle

\begin{align} l_{0,16}&=\prod_{j=0}^{16}\frac{x-x_{j}}{x_{0}-x_{j}}, \quad f(x_{0})=f(-1)=\frac{e^{-1}-1}{-1} \\ l_{1,16}&=\prod_{j=0}^{16}\frac{x-x_{j}}{x_{1}-x_{j}}, \quad f(x_{1})=f(-\frac{7}{8})=\frac{e^{-\frac{7}{8}}-1}{-\frac{7}{8}}\\ & \cdots \\ l_{16,16}&=\prod_{j=0}^{16}\frac{x-x_{j}}{x_{16}-x_{j}}, \quad f(x_{16})=f(1)=\frac{e-1}{1} \end{align} $$

Plot
Plot $$\displaystyle f_n(x), f(x)$$ for n=1,2,4,8,16. Plot: Matlab code:
 * {| style="width:100%" border="0" align="left"


 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * }
 * }
 * }

Compute integration and compare
Compute $$\displaystyle I(f_n)=\int_a^b \! f_n(x) \, \mathrm{d}x$$,(n=1,2,4,8,16) and compare to $$\displaystyle I$$
 * {|class = "wikitable collapsible"

!colspan="3"|I = 2.1145
 * n
 * In
 * En
 * 1
 * 2.35040238
 * -0.23590238
 * 2
 * 2.11680663
 * -0.00230663
 * 4
 * 2.11451758
 * -0.00001758
 * 8
 * 2.11450788
 * -0.00000788
 * }
 * 8
 * 2.11450788
 * -0.00000788
 * }
 * }

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


 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * }
 * }
 * }

Plot Lagrange interpolation functions
For $$\displaystyle n=5$$, plot $$\displaystyle l_{0},l_{1},l_{2}$$. How will $$\displaystyle l_{3},l_{4},l_{5}$$ look? Plot: Matlab code:
 * {| style="width:100%" border="0" align="left"


 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * }
 * }
 * }

Author and proof-reader
[Author] Shin [Proof Reader] cavalcanti

=Problem 13 - Simple to Composite Rules = From (meeting 10 page 5)

Given
1. The equations for the simple and composite Trapezoidal Rule. 2. The equations for the simple and composite Simpson's Rule.

Find
1. Show that the composite Trapezoidal rule can be obtained from the simple Trapezoidal Rule. 2. Show that the composite Simpson's rule can be obtained from the simple Simpson's Rule.

Solution
'''We solved this problem on our own. '''

1. Trapezoidal Rule.
The equation for the simple Trapezoidal rule, as stated in mtg.7-4, is: $$ I_{1}=\frac{b-a}{2}[f(a)+f(b)]$$, where our interval is $$[a,b]$$ and $$n = 1$$. Instead of having one panel, divide the interval in n panels. The new h is: $$ h=\frac{b-a}{n}$$ The composite rule can be found as follows: $$I_{n}=\sum_{i=1}^{n} \frac{h}{2}[f(x_{i-1} )+f(x_{i} )]$$ Expanding: $$I_{n}=\frac{h}{2}[f(x_{0} )+f(x_{1} )+f(x_{1} )+f(x_{2} )+f(x_{2} )+f(x_{3} )+...+f(x_{n-1} )+f(x_{n-1} )+f(x_{n} )]$$ Simplifying: $$ I_{n}=\frac{h}{2}[f(x_{0} )+2f(x_{1} )+2f(x_{2} )+2f(x_{3} )+...+2f(x_{n-1} )+f(x_{n} )]$$


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

$$I_{n}=h[\frac{f(x_{0} )}{2}+f(x_{1} )+f(x_{2} )+f(x_{3} )+...+f(x_{n-1} )+\frac{f(x_{n} )}{2}] $$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

2. Simpson's Rule.
The equation for the simple Simpson's rules, as state in mtg.7-4 is: $$I_{2}=\frac{h}{3}[f_{0}+4f_{1}+f_{2}]$$, where our interval is $$[a,b]$$ and $$n=2$$. The composite rule can be found as follows: $$I_{n}=\frac{h}{3}[f(x_{0})+2\sum_{j=1}^{\frac{n}{2}-1} f(x_{2j}) + 4\sum_{j=1}^{\frac{n}{2}}f(x_{2j-1})+f(x_{n})]$$ Expanding:
 * {| style="width:100%" border="0" align="left"

$$ I_{n}=\frac{h}{3} [f(x_{0})+4f(x_{1})+2f(x_{2})+4f(x_{3}) +2f(x_{4})+...+4f(x_{n-1})+f(x_{n})]$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

Author and proof-reader
[Author] cavalcanti [Proof-reader] Raghunathan

=Problem 14 - Transformation of variable in integration= From (meeting 11 page 2)

Given

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

I(f(x))=\int_a^b \! f(x) \, \mathrm{d}x = \int_{-1}^{+1} \! \overline{f}(y) \, \mathrm{d}y $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (14-1)
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

f(x)=f(x(y))=\overline{f}(y) $$, $$\displaystyle x = x(y)$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (14-2)
 * }
 * }

Find
Give details to obtain Eq.14-1 using the given information.

Solution
Let,
 * $$\displaystyle x(-1)=a$$, $$\displaystyle x(+1)=b$$

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

$$\displaystyle \begin{align} \int_{-1}^{+1} \! \overline{f}(y) \, \mathrm{d}y &= \int_{x(-1)}^{x(+1)} \! f(x(y)) \, \mathrm{d}x \\ &= \int_{a}^{b} \! f(x) \, \mathrm{d}x \\ &= I(f(x)) \end{align} $$
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

Author and proof-reader
[Author] Shin [Proof-reader] Raghunathan

=References=

=Contributing members=

Signatures
Cavalcanti: Solved problems manually, typed solutions for problems 1, 4, 5, 7, 13, proof read. EGM6341.S11.team5.cavalcanti 18:59, 1 February 2011 (UTC) Shin - Solved & posted 2.11, 2.12, 2.14, proof-read 2.6 08:57, 2 February 2011 (UTC) Raghunathan - Solved problems manually, posted 2.3, 2.4 and proof-read 2.11,2.13,2.14. 15:45, 2 February 2011 (UTC) Oh - Solved & posted 2.2, 2.6, 2.8 and 2.10 15:20, 2 February 2011 (UTC) J Davis 17:04, 2 February 2011 (UTC) - Solved, contributed to, or provided verification for 2.9, 2.6, 2.2