User:Egm6341.s11.team5.oh/HW2

=Problem 2 - Construct Taylor series = From [ (meeting page )]

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 3. Error Estimation
$$\displaystyle R_{n+1}(x) = \frac{(x-x_0)^{n+1}}{(n+1)!} f^{n+1}(\xi)$$ $$\displaystyle max R_{n+1}(x) = \frac{(x-x_0)^{n+1}}{(n+1)!} max \bigg| f^{n+1}(\xi)\bigg|$$

Since $$\displaystyle f(x) = sin (x)$$  $$\displaystyle max \bigg| f^{n+1}(\xi)\bigg| = 1  $$ for all $$\displaystyle n $$

(a)$$\displaystyle R_{n+1}(x)$$ 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 R_{n+1}(x)_{max}= \frac{x-x_0}{1!} $$
 * }
 * }
 * }


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

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


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

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

(b)$$\displaystyle R_{n+1}(x)_{max}$$ 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 R_{2}(x)_{max}= \frac{(x-x_0)^2}{2!}  $$
 * }
 * }
 * }


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

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


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

$$\displaystyle R_2(x)_{max} = 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 R_{n+1}(x)_{max}$$ 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 R_{3}(x)_{max}= \frac{(x-x_0)^3}{3!}  $$
 * }
 * }
 * }


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

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


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

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

(d)$$\displaystyle R_{n+1}(x)_{max}$$ 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 R_{4}(x)_{max}= \frac{(x-x_0)^4}{4!}  $$
 * }
 * }
 * }


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

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


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

$$\displaystyle R_4(x)_{max} = 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 R_{n+1}(x)_{max}$$ 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 R_{5}(x)_{max}= \frac{(x-x_0)^5}{5!}  $$
 * }
 * }
 * }


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

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


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

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

(f)$$\displaystyle R_{n+1}(x)_{max}$$ 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 R_{6}(x)_{max}= \frac{(x-x_0)^6}{6!}  $$
 * }
 * }
 * }


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

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


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

$$\displaystyle R_6(x)_{max} = 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 R_{n+1}(x)_{max}$$ 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 R_{7}(x)_{max}= \frac{(x-x_0)^7}{7!}  $$
 * }
 * }
 * }


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

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


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

$$\displaystyle R_7(x)_{max} = 6.24939 * 10^{-4} $$ ( WA result )
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(h)$$\displaystyle R_{n+1}(x)_{max}$$ 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 R_{8}(x)_{max}= \frac{(x-x_0)^8}{8!}  $$
 * }
 * }
 * }


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

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


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

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

(i)$$\displaystyle R_{n+1}(x)_{max}$$ 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 R_{9}(x)_{max}= \frac{(x-x_0)^9}{9!}  $$
 * }
 * }
 * }


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

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


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

$$\displaystyle R_9(x)_{max} = 1.20467 * 10^{-5}$$ ( WA result )
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

(j)$$\displaystyle R_{n+1}(x)_{max}$$ 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 R_{10}(x)_{max}= \frac{(x-x_0)^{10}}{10!}  $$
 * }
 * }
 * }


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

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


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

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

(k)$$\displaystyle R_{n+1}(x)_{max}$$ 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 R_{11}(x)_{max}= \frac{(x-x_0)^{11}}{11!}  $$
 * }
 * }
 * }


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

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


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

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

Author and proof-reader
[Author] Oh

[Proof-reader]

=Problem 6 - Verification genernal form of Legendre poly.= From [ (meeting page )]

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)
 * }
 * }

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)
 * }
 * }


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




 * }
 * }
 * }

$$\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 = 5 $$
 * {| 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"




 * }
 * }
 * }

Author and proof-reader
[Author] Oh

[Proof-reader]

=Problem 8 - Trapezoidal rule (simple) = From [ (meeting page )]

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]

[Proof-reader]

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

Given

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



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


 * }
 * }


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



p_2(x) = f(x_i), \ i=0,1,2 $$ $$
 * $$\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 (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 (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


 * }.
 * }.

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 (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 (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 (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 (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

\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]

[Proof-reader]

=References=