User:EGM6341.s11.TEAM1.Sujin.HW2

Find
1) Construct Taylor series around (2.2)

2) Plot these series for each n.

3) Find/Estimate max $$ \left | R_{n+1}(x=\frac{3 \pi\ }{4}) \right \vert $$

1) Construct Taylor series

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

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


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

$$\begin{align}       =0.9239 + (x-\frac{3\pi}{8})(\cos(\frac{3\pi}{8})) \end{align}$$
 * $$\displaystyle P_1(x)=f(\frac{3\pi}{8}) + \frac{(x-x_0)^{(1)}}{1!} f^{(1)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_1(x)=0.4730 + 0.3827x \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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

$$\displaystyle        = (0.3827x + 0.4730) + \frac{(x-\frac{3\pi}{8})^{2}}{2!} (-\sin(\frac{3\pi}{8}))$$
 * $$\displaystyle P_2(x) = P_1(x) + \frac{(x-x_0)^{(2)}}{2!} f^{(2)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_2(x) = 0.4730 + 0.3827x + \frac{(x-\frac{3\pi}{8})^{2}}{2!}(-0.9239) \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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

$$\displaystyle = 0.3827x + 0.4730 + \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}))  $$
 * $$\displaystyle P_3(x) = P_2(x) + \frac{(x-x_0)^{3}}{3!} f^{(3)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_3(x) = 0.4730 + 0.3827x + \frac{(x-\frac{3\pi}{8})^{2}}{2!}(-0.9239) + \frac{(x-\frac{3\pi}{8})^{3}}{3!}(-0.3827) \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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

$$\displaystyle = 0.3827x + 0.4730 + \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})) $$
 * $$\displaystyle P_4(x) = P_3(x) + \frac{(x-x_0)^{4}}{4!} f^{(4)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_4(x) = 0.4730 + 0.3827x + \frac{(x-\frac{3\pi}{8})^{2}}{2!}(-0.9239) + \frac{(x-\frac{3\pi}{8})^{3}}{3!}(-0.3827) + \frac{(x-\frac{3\pi}{8})^{4}}{4!} (0.9239) \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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

$$\displaystyle = 0.3827x + 0.4730 + \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})) $$
 * $$\displaystyle P_5(x) = P_4(x) + \frac{(x-x_0)^{5}}{5!} f^{(5)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_5(x) = 0.4730 + 0.3827x + \frac{(x-\frac{3\pi}{8})^{2}}{2!}(-0.9239) + \frac{(x-\frac{3\pi}{8})^{3}}{3!}(-0.3827) + \frac{(x-\frac{3\pi}{8})^{4}}{4!} (0.9239) + \frac{(x-\frac{3\pi}{8})^{5}}{5!} (0.3827) \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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

$$\displaystyle = 0.3827x + 0.4730 + \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})) $$ $$\displaystyle + \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-\sin(\frac{3\pi}{8})) $$
 * $$\displaystyle P_6(x) = P_5(x) + \frac{(x-x_0)^{6}}{6!} f^{(6)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_6(x) = 0.4730 + 0.3827x + \frac{(x-\frac{3\pi}{8})^{2}}{2!}(-0.9239) + \frac{(x-\frac{3\pi}{8})^{3}}{3!}(-0.3827) + \frac{(x-\frac{3\pi}{8})^{4}}{4!} (0.9239) + \frac{(x-\frac{3\pi}{8})^{5}}{5!} (0.3827) \\+ \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-0.9239)\\ \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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

$$\displaystyle = 0.3827x + 0.4730 + \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})) $$ $$\displaystyle + \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-\sin(\frac{3\pi}{8})) + \frac{(x-\frac{3\pi}{8})^{7}}{7!} (-\cos(\frac{3\pi}{8})) $$
 * $$\displaystyle P_7(x) = P_6(x) + \frac{(x-x_0)^{7}}{7!} f^{(7)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_7(x) = 0.4730 + 0.3827x + \frac{(x-\frac{3\pi}{8})^{2}}{2!}(-0.9239) + \frac{(x-\frac{3\pi}{8})^{3}}{3!}(-0.3827) + \frac{(x-\frac{3\pi}{8})^{4}}{4!} (0.9239) + \frac{(x-\frac{3\pi}{8})^{5}}{5!} (0.3827) \\+ \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-0.9239) \frac{(x-\frac{3\pi}{8})^{7}}{7!} (-0.3827)\\ \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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

$$\displaystyle = 0.3827x + 0.4730 + \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})) $$ $$\displaystyle + \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-\sin(\frac{3\pi}{8})) + \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})) $$
 * $$\displaystyle P_8(x) = P_7(x) + \frac{(x-x_0)^{8}}{8!} f^{(8)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_8(x) = 0.4730 + 0.3827x + \frac{(x-\frac{3\pi}{8})^{2}}{2!}(-0.9239) + \frac{(x-\frac{3\pi}{8})^{3}}{3!}(-0.3827) + \frac{(x-\frac{3\pi}{8})^{4}}{4!} (0.9239) + \frac{(x-\frac{3\pi}{8})^{5}}{5!} (0.3827) \\+ \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-0.9239) \frac{(x-\frac{3\pi}{8})^{7}}{7!} (-0.3827) + \frac{(x-\frac{3\pi}{8})^{8}}{8!} (0.9239)\\ \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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

$$\displaystyle = 0.3827x + 0.4730 + \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})) $$ $$\displaystyle + \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-\sin(\frac{3\pi}{8})) + \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})) $$
 * $$\displaystyle P_9(x) = P_8(x) + \frac{(x-x_0)^{9}}{9!} f^{(9)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_9(x) = 0.4730 + 0.3827x + \frac{(x-\frac{3\pi}{8})^{2}}{2!}(-0.9239) + \frac{(x-\frac{3\pi}{8})^{3}}{3!}(-0.3827) + \frac{(x-\frac{3\pi}{8})^{4}}{4!} (0.9239) + \frac{(x-\frac{3\pi}{8})^{5}}{5!} (0.3827) \\+ \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-0.9239) \frac{(x-\frac{3\pi}{8})^{7}}{7!} (-0.3827) + \frac{(x-\frac{3\pi}{8})^{8}}{8!} (0.9239) + \frac{(x-\frac{3\pi}{8})^{9}}{9!} (0.3827)\\ \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }


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

$$\displaystyle = 0.3827x + 0.4730 + \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})) $$ $$\displaystyle + \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-\sin(\frac{3\pi}{8})) + \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})) $$
 * $$\displaystyle P_{10}(x) = P_9(x) + \frac{(x-x_0)^{10}}{10!} f^{(10)}(x_0) $$
 * }


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

$$\displaystyle \begin{align} P_{10}(x) = 0.4730 + 0.3827x + \frac{(x-\frac{3\pi}{8})^{2}}{2!}(-0.9239) + \frac{(x-\frac{3\pi}{8})^{3}}{3!}(-0.3827) + \frac{(x-\frac{3\pi}{8})^{4}}{4!} (0.9239) + \frac{(x-\frac{3\pi}{8})^{5}}{5!} (0.3827) \\+ \frac{(x-\frac{3\pi}{8})^{6}}{6!} (-0.9239) \frac{(x-\frac{3\pi}{8})^{7}}{7!} (-0.3827) + \frac{(x-\frac{3\pi}{8})^{8}}{8!} (0.9239) + \frac{(x-\frac{3\pi}{9})^{9}}{9!} (0.3827) + \frac{(x-\frac{3\pi}{8})^{10}}{10!} (-0.9239)\\ \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * }
 * }
 * }

2) Plot Taylor series

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


 *  Matlab code: 
 * }


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

 Matlab code: 
 * (a) Plot f(x) in Taylor series expansion for n=0, 1, and 2
 * }




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

 Matlab code: 
 * (b) Plot f(x) in Taylor series expansion for n=3, 4, and 5
 * }




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

 Matlab code: 
 * (c) Plot f(x) in Taylor series expansion for n=6, 7, and 8
 * }




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

 Matlab code: 
 * (e) Plot sin(x) and f(x) in Taylor series expansion for n=9 and 10
 * }



3)Find/Estimate Max Remainder $$ \left | R_{n+1}(x=\frac{3 \pi\ }{4}) \right \vert $$
$$\begin{align}R_{n+1}(x) \end{align}$$ in eqn.(2.4) is defined as following;


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


 * $$\begin{align} max \bigg| R_1(x) \bigg|=\frac{x-x_0}{1!} = \frac{\frac{3\pi}{4}-\frac{3\pi}{8}}{1!}\end{align}$$
 * }


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

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


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


 * $$\begin{align} max \bigg| R_2(x) \bigg|=\frac{{x-x_0}^2}{2!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^2}{2!}\end{align}$$
 * }


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

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


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


 * $$\begin{align} max \bigg| R_3(x) \bigg|=\frac{{x-x_0}^3}{3!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^3}{3!}\end{align}$$
 * }


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

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


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


 * $$\begin{align} max \bigg| R_4(x) \bigg|=\frac{{x-x_0}^4}{4!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^4}{4!}\end{align}$$
 * }


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

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


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


 * $$\begin{align} max \bigg| R_5(x) \bigg|=\frac{{x-x_0}^5}{5!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^5}{5!}\end{align}$$
 * }


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

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


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


 * $$\begin{align} max \bigg| R_6(x) \bigg|=\frac{{x-x_0}^6}{6!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^6}{6!}\end{align}$$
 * }


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

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


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


 * $$\begin{align} max \bigg| R_7(x) \bigg|=\frac{{x-x_0}^7}{7!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^7}{7!}\end{align}$$
 * }


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

$$\displaystyle max \bigg| R_7(x) \bigg| = 6.2494e-004$$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }


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


 * $$\begin{align} max \bigg| R_8(x) \bigg|=\frac{{x-x_0}^8}{8!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^8}{8!}\end{align}$$
 * }


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

$$\displaystyle max \bigg| R_8(x) \bigg| = 9.2030e-005$$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }


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


 * $$\begin{align} max \bigg| R_9(x) \bigg|=\frac{{x-x_0}^9}{9!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^9}{9!}\end{align}$$
 * }


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

$$\displaystyle max \bigg| R_9(x) \bigg| = 1.2047e-005$$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }


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


 * $$\begin{align} max \bigg| R_{10}(x) \bigg|=\frac{{x-x_0}^{10}}{10!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^{10}}{10!}\end{align}$$
 * }


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

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


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


 * $$\begin{align} max \bigg| R_{11}(x) \bigg|=\frac{{x-x_0}^{11}}{11!} = \frac{(\frac{3\pi}{4}-\frac{3\pi}{8})^{11}}{11!}\end{align}$$
 * }


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

$$\displaystyle max \bigg| R_{11}(x) \bigg| = 1.5200e-007 $$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }
 * }

Author

Find
1) Expand $$ e^x \ $$ in Taylor Series up to order n, with remainder $$ R_{n+1}[e^x_ix] $$

2) Find Taylor Series of $$ f(x) \ $$ up to order n, with remainder $$ R_{n+1}[f_{i}x] \ $$ equal to:

1) Expand Taylor series of exponential function $$\begin{align}, e^x \end{align}$$

 * Taylor series expansion of $$\displaystyle f(x) $$ is defined as following, refer eqn.(2.4);


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

$$\begin{align} f_n(x) =\underbrace{P_n(x)}_{\text{Taylor Series}} +\underbrace{R_{n+1}(x)}_{\text{Remainder}} \end{align}$$ where,
 * style="width:95%" |
 * style="width:95%" |
 * }


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

$$\begin{align} P_n(x)= f(x_0) + \frac{{(x-x_0)}^{(n)}}{1!} f^{(1)}(x_0) + ... + \frac{(x-x_0)^{(n)}}{n!} f^{(n)}(x_0) \end{align}$$
 * style="width:95%" |
 * style="width:95%" |
 * }
 * ,and
 * {| style="width:100%" border="0"

$$\begin{align} R_{n+1}(x)=\frac{1}{n!}\int_{x_{0}}^{x}(x-t)^{n}f^{(n+1)}(t)dt=\frac{(x-x_{0})^{n+1}}{(n+1)!}f^{(n+1)}(\xi), \quad \xi\in[x_{0},x] \end{align}$$ (3.5)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


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

By using eqn.(2.4) we can expand $$\begin{align} e^x \end{align}$$ in Taylor series around $$\begin{align} x_0=0 \end{align}$$ ; Derivative of $$\begin{align}e^x\end{align}$$ is its own; $$\begin{align} \frac{d^{n}}{dx^{n}}(e^{x})=e^{x} \end{align}$$ So, by using above property of $$\begin{align}e^x\end{align}$$ and eqn.(3.4) $$\begin{align} P_n(x) \end{align}$$ can obtaine $$\begin{align} P_n(x)=e^{0}+\frac{(x-0)}{1!}e^{0}+\frac{(x-0)^{2}}{2!}e^{0}+\cdots+\frac{(x-0)^{n}}{n!}e^{0} \end{align}$$ $$\begin{align} =P_n(x) = 1 + \frac{x}{1!} + \frac{x^2}{2!} + \cdots + \frac{x^n}{n!} = \sum_{i=0}^{n}\frac{x^i}{i!} \end{align}$$ (3.6)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * From eqn.(3.5), we can also find $$\begin{align} R_{n+1}(x) \end{align}$$.
 * {| style="width:100%" border="0"

$$\begin{align} R_{n+1}(x)=\frac{(x-0)^{n+1}}{(n+1)!}e^{\xi}=\frac{x^{n+1}}{(n+1)!}e^{\xi} \end{align}$$ (3.7)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * Plugging eqn.(3.5) and eqn.(3.6) into eqn(2.4), we can meet Taylor series expansion of $$\displaystyle e^x $$


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

$$\displaystyle \begin{align} e^{x}=P_{n}(x)+R_{n+1}(x)=\sum_{j=0}^{n}\frac{x^{j}}{j!}+\underbrace{\frac{x^{n+1}}{(n+1)!}e^{\xi}}_{R_{n+1}[e^x;x]} {}, \xi\epsilon [0,x] \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |

(3.8)
 * 
 * }

2) Expand Taylor series of f(x) $$\begin{align}, f(x)=\frac{e^x-1}{x} \end{align}$$

 * Taylor expansion of $$\begin{align}, f(x)=\frac{e^x-1}{x} \end{align}$$ can be expressed as following;
 * {| style="width:100%" border="0"

$$\begin{align} f(x) = \frac{e^x-1}{x} = \frac{1}{x}(e^{x}-1)=\frac{1}{x}(\cancel{1}+\underbrace{\frac{x}{1!}+\frac{x^2}{2!}+\cdots+\frac{x^n}{n!}}_{P_n(x)}+\underbrace{\frac{x^{n+1}}{(n+1)!}e^{\xi}}_{R_{n+1}} { } \cancel{-1}) \end{align}$$ $$\begin{align} = \cancel{\frac{1}{x}} \sum_{i=1}^{n}\frac{x^ {\cancelto{i-1}{i}} }{i!}+\frac{x^ {\cancelto{n}{n+1}} }{\cancel{x}(n+1)!} e^{\xi} = \sum_{i=1}^{n}\frac{x^ {i-1} }{i!}+\frac{x^{n}}{(n+1)!} e^{\xi} \end{align}$$
 * style="width:95%" |
 * style="width:95%" |
 * }
 * Thus,


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

$$\displaystyle \begin{align} f(x) = \frac{e^x-1}{x}=P_{n}(x)+R_{n+1}(x)=\sum_{j=0}^{n}\frac{x^{j-1}}{j!}+\underbrace{\frac{x^{n}}{(n+1)!}e^{\xi}}_{R_{n+1}[f(x);x]} {}, \xi\epsilon [0,x] \end{align} $$      (3.9)
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * 
 * 
 * }


 * Furthermore, we can confirm equation [[media:Egm6341.s11.mtg7.pdf|(2)p.7-1]] using eqn.(3.8) and eqn.(3.9);
 * {| style="width:100%" border="0"

From eqn.(3.8), we can find $$\begin{align}R_n[e^x;x]\end{align}$$ $$\begin{align} R_n[e^x;x]=\frac{(x-0)^n}{n!}e^{\xi} {},{} \xi \epsilon [0,x] \end{align}$$ ,and we confirmed $$\begin{align} R_{n+1}[f(x)=\frac{e^x-1}{x};x] \end{align}$$ from eqn.(3.9); $$\begin{align} R_{n+1}[f;x] = \frac{x^{n}}{(n+1)!}e^{\xi} {},{} \xi \epsilon [0,x] \end{align}$$ $$\begin{align} f(x)-f_n(x)=R_{n+1}(x)=\frac{x^{n}}{(n+1)!}e^{\xi} = \underbrace{\frac{(x)^n}{n!}e^{\xi}}_{R_n[e^x;x]}\frac{1}{n+1} \end{align}$$ $$\begin{align} \Rightarrow R_{n+1}[f;x]=\frac{R_n[e^x;x]}{n+1} \end{align}$$
 * style="width:95%" |
 * style="width:95%" |
 * }

Find
Consider $$ n=1,2,4,8,16 \ $$.

Construct $$ f_n(x) \ $$ as shown in Eq12.2.

Plot $$ f,f_n,n=1,2,4,8,16 \ $$

Compute $$ I_n= \int_{a}^{b} f_n(x)\, dx $$ for $$ n=1,2,4,8 \ $$  and compare to $$ I \ $$ (use Wolfram Alpha with more digits)

Plot $$ l_0,l_1,l_2 \ $$ for $$ n=5 \ $$

How would $$ l_3,l_4 \ $$ look?

Solution
1) Construct $$ f_n(x) \ $$ as shown in Eq12.2. (a) $$\displaystyle n=1 $$


 * $$\displaystyle x_0=-1,\quad x_1=1 $$


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

\begin{align} 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) \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }


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

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


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

$$\displaystyle \begin{align} f_1(x)&=p_1(x)\\ &=(\frac{x-1}{-2})(1-e^{-1}) + (\frac{x+1}{2})(e-1)\\ \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = | (12.3)
 * }
 * }

(b) $$\displaystyle n=2 $$
 * $$\displaystyle x_0=-1,\quad x_1=0,\quad x_2=1 $$
 * {| style="width:100%" border="0" align="left"

\begin{align} 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)\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * Where
 * $$\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}, &&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}, && 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}, && f(x_1)=f(1)=e+1 \end{align} $$
 * Thus,


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

$$\displaystyle \begin{align} f_2(x)&=P_2(x)\\ &=( \frac{x(x-1)}{2} )(1-e^{-1}) + (\frac{(x+1)(x-1)}{-1})(1) + (\frac{(x+1)x}{2})(e+1)\\ \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = | (12.4)
 * }
 * }

(c)$$\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"

\begin{align} 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}) \end{align}$$
 * $$\displaystyle
 * $$\displaystyle
 * }


 * Where,
 * $$\displaystyle

\begin{align} l_{0,4}&=\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)}, &&f(x_{0})=f(-1)=1-e^{-1} \\ l_{1,4}&=\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)}, &&f(x_{1})=f(-\frac{1}{2})=\frac{e^{-\frac{1}{2}}-1}{-\frac{1}{2}} \\ l_{2,4}&=\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)}, &&f(x_{2})=f(0)=1 \\ l_{3,4}&=\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)}, &&f(x_{3})=f(\frac{1}{2})=\frac{e^{\frac{1}{2}}-1}{\frac{1}{2}} \\ l_{4,4}&=\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})}, &&f(x_{4})=f(1)=e^{1}-1 \\ \end{align} $$


 * Thus,


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

$$\displaystyle \begin{align} f_4(x) =& P_4(x)\\ =&(\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)}) (1-e^{-1}) +(\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)})(\frac{e^{-\frac{1}{2}}-1}{-\frac{1}{2}})\\ &+(\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)})(1) +(\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)})(\frac{e^{\frac{1}{2}}-1}{\frac{1}{2}})\\ &+(\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})})(e^{1}-1)\\ \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = | (12.5)
 * }
 * }

(d) $$\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
 * }


 * where,
 * $$\displaystyle

\begin{align} l_{0,8}&=\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}&=\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}&=\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}&=\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}&=\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}&=\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}&=\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}&=\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}&=\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} $$


 * Thus,


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

$$\displaystyle \begin{align} f_8(x)=&(\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)}) (1-e^{-1}) \\ &+(\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)}) (\frac{e^{-\frac{3}{4}}-1}{-\frac{3}{4}})\\ &+(\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)}) (\frac{e^{-\frac{1}{2}}-1}{-\frac{1}{2}} )\\ &+(\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)}) (\frac{e^{-\frac{1}{4}}-1}{-\frac{1}{4}})\\ &+(\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)}) (1)\\ &+(\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)}) (\frac{e^{\frac{1}{4}}-1}{\frac{1}{4}})\\ &+(\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)}) (\frac{e^{\frac{1}{2}}-1}{\frac{1}{2}})\\ &+(\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)}) (\frac{e^{\frac{3}{4}}-1}{\frac{3}{4}})\\ &+(\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})}) (\frac{e-1}{1})\\ \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = | (12.6)
 * }
 * }

(e) $$\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}, \cdots ,\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
 * }
 * $$\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}}\\ & \vdots \\ 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} $$ Thus,


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

$$\displaystyle \begin{align} f_{16}(x)=&(\prod_{j=0}^{16}\frac{x-x_{j}}{x_{0}-x_{j}})(\frac{e^{-1}-1}{-1}) + (\prod_{j=0}^{16}\frac{x-x_{j}}{x_{1}-x_{j}}) (\frac{e^{-\frac{7}{8}}-1}{-\frac{7}{8}}) + \cdots + (\prod_{j=0}^{16}\frac{x-x_{j}}{x_{16}-x_{j}}) (\frac{e-1}{1}) \end{align} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = | (12.7)
 * }
 * }

2) Compute $$ I_n= \int_{a}^{b} f_n(x)\, dx $$ for $$ n=1,2,4,8 $$

3) Plot $$ l_0,l_1,l_2 \ $$ for $$ n=5 \ $$

matlab
Matlab generated LIET plot for n={1,2,4,8,16}

Matlab generated Lagrange-Interpolation for n={1,2,4,8,16}

When n=1 When n=2 When n=4 When n=8 When n=16