User:Egm6341.s11.team5.shin/HW2

= 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
 * $$\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
 * $$\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
 * $$\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
 * $$\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
 * $$\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
 * $$\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
 * $$\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{at this point, we should take advantage of the fact that } x_1=\frac{x_2+x_0}{2} \\ &=\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{substitute } x_1=\frac{x_2+x_0}{2} \mbox{ into 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{substitute } x_1=\frac{x_2+x_0}{2} \mbox{ into 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}{6}(x_2-x_0) \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{at this point, we should take advantage of the fact that } x_1=\frac{x_2+x_0}{2} \\ &=\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{ into 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} $$ The result from the integrations above shows the followings.
 * {| 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
 * $$\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}{6}(x_2-x_0) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\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
 * $$\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" |
 * }
 * }
 * }

= 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?

Solution
1. Construct $$\displaystyle f_n(x) $$  CASE 1 :  $$\displaystyle n=1 $$
 * $$\displaystyle x_0=-1,\quad x_1=1 $$
 * $$\displaystyle

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

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

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

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

\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} $$
 * , where
 * $$\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} $$ 2. Plot $$\displaystyle f_n(x), f(x)$$ for n=1,2,4,8,16. Plot: Matlab code:
 * {| style="width:100%" border="0" align="left"

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$$
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * }
 * }
 * }

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

4 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: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"

= Problem 14 - Transformation of variable in integration = From (meeting 11 page 2)
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * }
 * }
 * }

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
 * $$\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
 * $$\displaystyle (14-2)
 * }
 * }

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

Solution
First of all, set up the followings.
 * $$\displaystyle x(-1)=a$$, $$\displaystyle x(+1)=b$$

With the setup above, the following can be concluded.
 * {| 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" |
 * }
 * }
 * }