User:Egm6341.s2010.Team1/HW1

=Problem 2-1=

Find
Determine $$\lim _{x\mapsto 0}f\left ( x \right )$$ and plot $$f\left ( x \right ), x\in \left [ 0,1 \right ]$$

Given

 * $$f\left ( x \right )=\frac{e^{x}-1}{x}$$

Solution [[media:HW1_P2_1.jpg|P2-1]]
Determine the limit of the numerator and denominator separately and then evaluate the quotient.

Numerator:
 * $$\frac{\mathrm{d} }{\mathrm{d} x}\left ( e^{x}-1 \right )|_{x=0}=e^{x}|_{x=0}=1$$

Demoninator:
 * $$\frac{\mathrm{d} }{\mathrm{d} x}\left ( x \right )|_{x=0}=1$$

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


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

\lim _{x\mapsto 0}\frac{e^{x}-1}{x}=\frac{1}{1}=1 $$ $$
 * $$\displaystyle
 * }
 * }

=Problem 2-3=

Find
Determine $$P_{n}\left ( x \right )$$ and $$R_{n+1}\left ( x \right )$$ for $$e^{x} \,$$

Given

 * $$P_{n}\left ( x \right )=f\left ( x_{0} \right )+\frac{x-x_{0}}{1!}f^{(1)}\left ( x_{0} \right )+...+\frac{x-x_{0}}{n!}f^{(n)}\left ( x_{0} \right )$$

And
 * $$R_{n+1}\left ( x \right )=\frac{\left (x-x_{0} \right )^{n+1}}{\left ( n+1 \right )!}f^{(n+1)}\left ( \xi  \right ) for \xi \in [x_{0},x]$$

Solution [[media:HW1_P2_3.jpg|P2-3]]
Since $$x_{0}=0 \,$$ then $$f\left ( x_{0} \right )=e^{0}=1$$ In fact every derivative of $$e^{x} \,$$ is $$e^{x}\,$$ therefore $$f^{(n)}\left ( x_{0} \right )=1$$ Therefore,
 * {| style="width:100%" border="0" align="left"


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

P_{n}\left ( x \right )=1+x+\frac{x^{2}}{2}+\frac{x^{3}}{3!}+...+\frac{x^{n}}{n!} $$ $$
 * $$\displaystyle
 * }
 * }

=Problem 3-3=

Find
Determine $$\left \| f \right \|_{\infty }$$, $$\left \| g \right \|_{\infty }$$, and $$\left \| f-g \right \|_{\infty }$$ Plot $$f\left ( x \right ), g\left ( x \right ) x\in [0,\pi ]$$

Given

 * $$f\left ( x \right )=\sin x$$
 * $$g\left ( x \right )=\sin \left ( x-\frac{\pi }{2} \right )=-\cos x$$

Solution [[media:HW1_P3_3.jpg|P3-3]]
$$\left \| f \right \|_{\infty }=\max _{x}\left | f\left ( x \right ) \right |$$, so we must find where $$\frac{\mathrm{df} }{\mathrm{d} x}=0$$

Start with $$f\left ( x \right )$$
 * $$\frac{\mathrm{d} }{\mathrm{d} x}\left ( \sin x \right )=\cos x=0$$ between $$[0,\pi ] \,$$
 * $$\Rightarrow x=\frac{\pi }{2}$$
 * $$\Rightarrow \sin \left ( \frac{\pi }{2} \right )=1$$
 * {| style="width:100%" border="0" align="left"


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

\left \| \sin x \right \|_{\infty }=1,x=\frac{\pi }{2} $$ $$ Next do $$g\left ( x \right )$$
 * $$\displaystyle
 * }
 * }
 * $$\left \| -\cos x \right \|_{\infty }=\max _{x}\left | -\cos x \right |=\max _{x}\left ( \cos x \right )$$
 * $$\frac{\mathrm{d\left ( \cos x \right )} }{\mathrm{d} x}=-\sin x=0$$
 * $$\Rightarrow \cos x=1|_{x=0}$$
 * {| style="width:100%" border="0" align="left"


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

\left \| -\cos x \right \|_{\infty }=1,x=0 $$ $$ Finally do $$f-g \,$$
 * $$\displaystyle
 * }
 * }
 * $$\left \| f-g \right \|_{\infty }=\max _{x}\left | \sin x- \left ( -\cos x \right ) \right |=\max _{x}\left | \sin x+\cos x \right |$$
 * $$\frac{\mathrm{d} }{\mathrm{d} x}\left ( \sin x+\cos x \right )=\cos x-\sin x=0$$
 * $$\Rightarrow \cos x=\sin x$$
 * $$\Rightarrow x=\frac{\pi }{4}$$
 * $$\sin \left ( \frac{\pi }{4} \right )+\cos \left ( \frac{\pi }{4} \right )=\sqrt{2}$$
 * {| style="width:100%" border="0" align="left"


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

\left \| \sin x+\cos \right \|_{\infty }=\sqrt{2},x=\frac{\pi }{4} $$ $$
 * $$\displaystyle
 * }
 * }

=Problem 5-1a=

Find

 * 1) Prove the Intermediate Mean Value Theorem for $$w\left ( . \right )$$ being non-negative, i.e. $$w\geq 0$$
 * 2) Prove the IMVT for $$w\left ( x \right )\neq 0, \forall x\in [a,b]$$

Given
IMVT
 * $$\int_{a}^{b}w\left ( x \right )f\left ( x \right )dx=f\left ( \xi \right )\int_{a}^{b}w\left ( x \right )dx$$

Solution [[media:HW1_P5_1_1.jpg|P5-1a]]
1. For $$w\left ( x \right )\geq 0, \forall x\in [a,b]$$, we aim to prove that there exists a $$\xi \,$$ within $$[a,b] \,$$ such that $$\int_{a}^{b}w\left ( x \right )f\left ( x \right )dx=f\left ( \xi \right )\int_{a}^{b}w\left ( x \right )dx$$.

If the functions are continuous on this interval there exists both a minimum (m) and maximum (M) value of $$w\left ( x \right )f\left ( x \right )$$ within $$[a,b]$$.

Thus,
 * $$\int_{a}^{b}mdx\leq \int_{a}^{b}w\left ( x \right )f\left ( x \right )dx\leq \int_{a}^{b}Mdx, \forall x\in [a,b]$$
 * $$\Rightarrow m\leq \frac{1}{b-a}\int_{a}^{b}w\left ( x \right )f\left ( x \right )dx\leq M$$

If the functions are continuous on $$[a,b]$$ there must exist a $$\xi \,$$ in $$[a,b]$$ where,
 * $$f\left ( \xi \right )\int_{a}^{b}w\left ( x \right )dx=\int_{a}^{b}w\left ( x \right )f\left ( x \right )dx$$

2. $$w> 0 \,$$ was covered in 1, and for $$w< 0 \,$$ the result is similar. In the case of $$w\left ( x \right )\neq 0$$ there must exist a minimum(m) and maximum(M) value of $$w\left ( x \right )f\left ( x \right )$$ within $$[a,b]$$.


 * $$\int_{a}^{b}mdx\leq \int_{a}^{b}w\left ( x \right )f\left ( x \right )dx\leq \int_{a}^{b}Mdx, \forall x\in [a,b]$$

though in this case the minumim and/or maximum could be negative. Again,
 * $$m\leq \frac{1}{b-a}\int_{a}^{b}w\left ( x \right )f\left ( x \right )dx\leq M$$

This integral could be negative, but like in part-1 there must exist a $$\xi \,$$ in $$[a,b] \,$$ where
 * $$f\left ( \xi \right )\int_{a}^{b}w\left ( x \right )dx=\int_{a}^{b}w\left ( x \right )f\left ( x \right )dx$$

=Problem 5-1b=

Find
Use the Intermediate Mean Value Theorem to show Eq. (5) [http://upload.wikimedia.org/wikipedia/commons/b/b5/Egm6341.s10.mtg2.pdf Lec. 2-2] and Eq. (1) [http://upload.wikimedia.org/wikipedia/commons/b/b5/Egm6341.s10.mtg2.pdf Lec. 2-3]

Given
Eq. (5)
 * $$R_{n+1}\left ( x \right )=\frac{1}{n!}\int_{x_{0}}^{x}\left ( x-t \right )^{n}f^{(n+1)}\left ( t \right )dt$$

Eq. (1)
 * $$R_{n+1}\left ( x \right )=\frac{(x-x_{0})^{n+1}}{(n+1)!}f^{(n+1)}\left ( \xi \right )$$

IMVT
 * $$\int_{a}^{b}w\left ( x \right )f\left ( x \right )dx=f\left ( \xi \right )\int_{a}^{b}w\left ( x \right )dx$$

Solution [[media:HW1_P5_1_2.jpg|P5-1b]]
Let $$w\left ( x \right )$$ be nonnegative in the integral on $$[a,b] \,$$ and let $$f\left ( x \right )$$ be continuous on $$[a,b] \,$$. Then,


 * $$\int_{a}^{b}w\left ( x \right )f\left ( x \right )dx=f\left ( \xi \right )\int_{a}^{b}w\left ( x \right )dx$$

for
 * $$\xi \in [a,b]$$

Using a Taylor series expansion,
 * $$f\left ( x \right )=P_{n}\left ( x \right )+R_{n+1}\left ( x \right )$$

where
 * $$R_{n+1}\left ( x \right )=\frac{1}{n!}\int_{x_{0}}^{x}\left ( x-1 \right )^{n}f^{(n+1)}\left ( t \right )dt$$
 * $$\Rightarrow \frac{1}{n!}f^{(n+1)}\left ( \xi \right )\int_{x_{0}}^{x}\left ( x-t \right )^{n}dt$$
 * $$\Rightarrow \frac{1}{n!}f^{(n+1)}\left ( \xi \right )\left ( \frac{-1}{n+1} \right )\left ( x-t \right )^{n+1}|_{x_{0}}^{x}$$
 * {| style="width:100%" border="0" align="left"


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

\Rightarrow \frac{(x-x_{0})^{n+1}}{(n+1)!}f^{(n+1)}\left ( \xi \right ) $$ $$
 * $$\displaystyle
 * }
 * }

=Problem 5-3=

Find
Integrate by parts to obtain
 * $$\frac{(x-x_{0})^{2}}{2!}f^{(2)}\left ( x_{0} \right )+\frac{(x-x_{0})^{3}}{3!}f^{(3)}\left ( x_{0} \right )$$

and show the remainder.

Then assume Eq. (4) and Eq. (5) [http://upload.wikimedia.org/wikipedia/commons/b/b5/Egm6341.s10.mtg2.pdf Lec. 2-2] are true and do integration by parts once more.

Given

 * $$f\left ( x \right )=f\left ( x_{0} \right )+\left ( x-x_{0} \right )f^{(1)}\left ( x_{0} \right )+\int_{x_{0}}^{x}\left ( x-t \right )f^{(2)}\left ( t \right )dt$$

Solution [[media:HW1_P5_3.jpg|P5-3]]
Integrate by parts,
 * $$\int_{x_{0}}^{x}\underbrace{\left ( x-t \right )}_{u'}\underbrace{f^{(2)}\left ( t \right )}_{v}dt=\left [ -\frac{(x-t)^{2}}{2} f^{(2)}\left ( t \right )\right ]_{x_{0}}^{x}-\int_{x_{0}}^{x}\frac{-(x-t)^{2}}{2}f^{(3)}\left ( t \right )dt$$
 * $$\Rightarrow 0+\frac{(x-x_{0})^{2}}{2}f^{(2)}\left ( x_{0} \right )+\int_{x_{0}}^{x}\frac{(x-t)^{2}}{2}f^{(3)}\left ( t \right )dt$$
 * {| style="width:100%" border="0" align="left"


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

f\left ( x \right )=f\left ( x_{0} \right )+\frac{(x-x_{0})}{1!}f^{(1)}\left ( x_{0} \right )+\frac{(x-x_{0})^{2}}{2!}f^{(2)}\left ( x_{0} \right )+\int_{x_{0}}^{x}\frac{(x-t)^{2}}{2}f^{(3)}\left ( t \right )dt $$ $$
 * $$\displaystyle
 * }
 * }

And the remainders
 * $$f\left ( x \right )=P_{n}\left ( x \right )+R_{n+1}\left ( x \right )$$
 * $$P_{n}\left ( x \right )=f\left ( x_{0} \right )+\frac{(x-x_{0})}{1!}f^{(1)}\left ( x_{0} \right )+...+\frac{(x-x_{0})^{n}}{n!}f^{(n)}\left ( x_{0} \right )$$
 * $$R_{n+1}\left ( x \right )=\frac{1}{n!}\int_{x_{0}}^{x}\underbrace{\left ( x-t \right )^{n}}_{u'}\underbrace{f^{(n+1)}\left ( t \right )}_{v}dt$$

Integrate by parts of $$R_{n+1}\left ( x \right )$$
 * $$\frac{1}{n!}\int_{x_{0}}^{x}\left ( x-t \right )^{n}f^{(n+1)}\left ( t \right )dt=\frac{1}{n!}\left \{ \left [ -\frac{(x-t)^{n}}{(n+1)}f^{(n+1)}\left ( t \right ) \right ]_{x_{0}}^{x} - \int_{x_{0}}^{x}\frac{-(x-t)^{n+1}}{(n+1)}f^{(n+1)}\left ( t \right )dt\right \}$$
 * $$\Rightarrow 0+\frac{(x-x_{0})^{n+1}}{(n+1)!}f^{(n+1)}\left ( x_{0} \right )+\int_{x_{0}}^{x}\frac{(x-t)^{n+1}}{(n+1)!}f^{(n+2)}dt$$
 * $$f\left ( x \right )=P_{n+1}\left ( x \right )+R_{n+2}\left ( x \right )$$


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


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

P_{n+1}\left ( x \right )=f\left ( x_{0} \right )+\frac{(x-x_{0})}{1!}f^{(1)}\left ( x_{0} \right )+...+\frac{(x-x_{0})^{n+1}}{(n+1)!}f^{(n+1)}\left ( x_{0} \right ) $$ $$
 * $$\displaystyle
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

R_{n+2}\left ( x \right )=\frac{1}{(n+1)!}\int_{x_{0}}^{x}(x-t)^{n+1}f^{(n+2)}dt $$ $$
 * $$\displaystyle
 * }
 * }

=Problem 6-1=

Find
Construct the Taylor series of $$f(x) \,$$ around $$x_0=\frac{\pi}{4}$$ for $$n=0,1,...,10 \,$$.

Plot these series for each $$n \,$$. Then estimate the maximum of $$R(x) \,$$ at $$x=\frac{\pi}{2}$$

Given

 * $$f\left ( x \right )=\sin x$$ for $$x\in [0,\pi ]$$

Solution [[media:HW1_P6_1_1.jpg|P6-1]]

 * $$f\left ( x \right )=\sin x=P_n(x)+R_{n+1}(x)$$
 * $$P_n(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)^n}{n!}f^{(n)}(x_0)$$
 * $$R_{n+1}(x)=\frac{(x-x_0)^{n+1}}{(n+1)!}f^{(n_1)}(\xi)$$

For
 * $$f(x)=\sin x, f^{(1)}(x)=\cos x, f^{(2)}(x)=-\sin x, f^{(3)}(x)=-\cos x, f^{(4)}(x)=\sin x \,$$

When $$n=0 \,$$
 * $$\Rightarrow \sin x=P_0(x)+R_1(x)=\frac{\sqrt{2}}{2}+(x-\frac{\pi}{4})\cos \xi$$

When $$n=1 \,$$
 * $$\Rightarrow \sin x=P_1(x)+R_2(x)=\frac{\sqrt{2}}{2}\left [ 1+\left ( x-\frac{\pi}{4} \right ) \right ]-\frac{(x-\frac{\pi}{4})^2}{2!}\sin \xi$$

When $$n=2 \,$$
 * $$\Rightarrow \sin x=P_2(x)+R_3(x)=\frac{\sqrt{2}}{2}\left [ 1+\left ( x-\frac{\pi}{4} \right )-\frac{(x-\frac{\pi}{4})^2}{2!} \right ]-\frac{(x-\frac{\pi}{4})^3}{3!}\cos \xi$$

When $$n=3 \,$$
 * $$\Rightarrow \sin x=P_3(x)+R_4(x)=\frac{\sqrt{2}}{2}\left [ 1+\left ( x-\frac{\pi}{4} \right )-\frac{(x-\frac{\pi}{4})^2}{2!}-\frac{(x-\frac{\pi}{4})^3}{3!} \right ]+\frac{(x-\frac{\pi}{4})^4}{4!}\sin \xi$$

...

When $$n=10 \,$$
 * $$\Rightarrow \sin x=P_{10}(x)+R_{11}(x)=\frac{\sqrt{2}}{2}\left [ 1+\left ( x-\frac{\pi}{4} \right )-\frac{(x-\frac{\pi}{4})^2}{2!}-\frac{(x-\frac{\pi}{4})^3}{3!}...- \frac{(x-\frac{\pi}{4})^{10}}{10!}\right ]-\frac{(x-\frac{\pi}{4})^{11}}{11!}\cos \xi$$

Finally, the maximum can be computed with,
 * $$R_{n+1}(x)=\frac{(x-x_0)^{n+1}}{(n+1)!}f^{(n+1)}(\xi)$$ for $$\xi \in [0,\pi] \,$$
 * $$\left | R_{n+1}(x) \right |\leq \frac{(x-x_0)^{n+1}}{(n+1)!}\max \left \{ f^{(n+1)}(\xi) \right \} \leq \frac{(x-x_0)^{n+1}}{(n+1)!}=\frac{(\frac{\pi}{4})^{n+1}}{(n+1)!}\leq \frac{\pi}{4}$$

=Problem 6-5=

Find
Use the following three methods to find the integral, $$I \, $$

1. Taylor series expansion of $$f_n\,$$

2 Composite Trapezoidal Rule

3 Composite Simposon Rule

Let $$ n=2,4,8,... \,$$ until the error is of magnitude $$10^{-6} \,$$

Given

 * $$I=\int_{0}^{1}\frac{e^{x}-1}{x}dx$$

Solution [[media:HW1_P6_5_1.jpg|P6-5a]], [[media:HW1_P6_5_2.jpg|P6-5b]], [[media:HW1_P6_5_3.jpg|P6-5c]]
1. Taylor Series
 * $$e^{x}=\sum _{j=0}^{\infty }\frac{x^j}{j!}\Rightarrow \frac{e^{x}-1}{x}=\sum _{j=1}^{\infty }\frac{x^{j-1}}{j!}$$
 * $$I_n=\int_{0}^{1}f_n(x)dx=\int_{0}^{1}\sum _{j=1}^{\infty} \frac{x^{j-1}}{j!}dx=\sum _{j=1}^{n}\frac{x^3}{j!j}|_0^1=\sum _{j=1}^n \frac{1}{j!j}$$
 * $$f(x)-f_n(x)=R_n(x)=\frac{(x-0)^n}{(n+1)!}f^{(n+1)}(\xi)$$ with $$\xi \in [0,x] \,$$ and $$x_0=0 \,$$
 * $$E_n=I-I_n=\int_{0}^{1}\left [ f(x)-f_n(x) \right ]dx=\int_{0}^{1}\overbrace{\frac{x^n}{(n+1)!}}^{w(x)}\overbrace{f^{(n+1)}\left (\xi(x) \right )}^{g(x)}dx$$
 * $$\Rightarrow g(\alpha)\int_{0}^{1}w(x)dx$$ for $$\alpha \in [0,1]$$
 * $$E_n =\,$$
 * $$\Rightarrow max = \frac{g(\alpha)}{(n+1)!(n+1)}$$, $$\alpha=1 \,$$
 * $$\Rightarrow min = \frac{g(\alpha)}{(n+1)!(n+1)}$$, $$\alpha=0 \,$$
 * $$n=3, E_n \leq 0.02 \,$$
 * $$n=5, E_n \leq 8x10^{-5} \,$$


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


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

n=6, E_n \leq 9x10^{-6} \, $$ $$
 * $$\displaystyle
 * }
 * }

2. Comp. Trap. Rule
 * $$\int_{x_0}^{x_1}f(x)dx=\int_{0}^{h}f(t+x_0)dt=\left [ (t+A)F(t+x_0) \right ]_0^h-\int_{0}^{h}(t+A)f'(t+x_0)dt$$
 * $$\int_{a}^{b}f(x)dx\approx \left ( \frac{b-a}{n} \right )\left [ \frac{f(a)+f(b)}{2}+\sum _{k=1}^{n-1}f\left (a+k\frac{b-a}{n} \right ) \right ]$$

We want $$\left [ (t+A)f(t+x_0) \right ]_0^h=\frac{(f(x_0)+f(x_1))}{2}(h)$$ with $$x_1=x_0+h \,$$,
 * $$\Rightarrow A=\frac{-h}{2}$$

We want our error bound small
 * $$\Rightarrow \left [ \left ( \frac{(t+A)^2}{2}+B \right )f'(t+x_0) \right ]_0^h=0$$
 * $$\left [\left ( \frac{\left ( \frac{h}{2} \right )^2}{2}+B \right )f'(h+x_0) \right ]-\left ( \frac{\left ( \frac{-h}{2} \right )^2}{2}+B \right )f'(x_0)=0$$
 * $$\Rightarrow B=\frac{-h^2}{8}$$
 * $$\int_{x_0}^{x_1}f(x)dx=\frac{h}{2}\left [ f(x_0)+f(x_1) \right ]+\int_{0}^{h}\left ( \tfrac{\left ( t-\frac{h}{2} \right )^2}{2}+\frac{h^2}{8} \right )f''(t+x_0)dt$$

The error in the Trap. Rule equals the sum of these:
 * $$E_T=E(0)+E(1)+...+E(n-1) \,$$
 * $$\int_{0}^{h}Qf(t+x_0)dt+\int_{0}^{h}Qf(t+x_1)dt+...+\int_{0}^{h}Qf''(t+x_0)dt$$
 * $$=\int_{0}^{h}Q\left (f(t+x_0)+...+f(t+x_{n-1}) \right )dt$$
 * $$E_T=\int_{0}^{h}\frac{\left (t-\frac{h}{2} \right )^2}{2}\frac{h^2}{8}\left [ f(t+x_0)+...+f(t+x_{n-1}) \right ]dt=\frac{-h^3}{12}$$


 * $$E_T=\frac{-h^3}{12n^3}f''(\xi)$$ with $$\xi \in [0,1] \,$$ and $$h=\frac{1}{n}$$
 * $$E_T=\frac{h^3}{12}\left ( \frac{\left ( x^2-2x+2 \right )e^x-2}{x^3} \right )$$

For $$\xi=1 \,$$ then $$E \,$$ is max
 * $$E_T=\frac{e-2}{12n^3}$$

For $$\xi=0 \,$$ then $$E \,$$ is min and this does not exist.


 * $$n=1, E_n \leq 0.06 \,$$
 * $$n=3, E_n \leq 0.002 \,$$
 * $$n=5, E_n \leq 0.0005 \,$$
 * $$n=7, E_n \leq 0.0002 \,$$
 * $$n=10, E_n \leq 6x10^{-5} \,$$


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


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

n=19, E_n \leq 9x10^{-6} \, $$ $$
 * $$\displaystyle
 * }
 * }

3. Simpson's Rule
 * $$I_n=\frac{b-a}{3n}\left ( f(a)+f(b)+4B_n + 2C_n \right )$$

where,
 * $$B_n=\sum _{i=1,odd}^{n-1}f(x_i)$$

and,
 * $$C_n=\sum _{i=2,even}^{n-2}f(x_i)$$

Then,
 * $$\int_{a}^{b}f(x)dx=I_n+E_n$$
 * $$E_n=-\frac{(1-0)^5}{180n^4}f^{(4)}(\xi)$$ with $$\xi \in [0,1] \,$$

For $$\xi=1 \,$$ yields the maximum $$E_n \,$$


 * $$n=1, E_n \leq 0.01 \,$$
 * $$n=3, E_n \leq 2x10^{-3} \,$$
 * $$n=5, E_n \leq 2x10^{-5} \,$$
 * $$n=7, E_n \leq 5x10^{-6} \,$$
 * $$n=6, E_n \leq 1x10^{-5} \,$$


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


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

n=7, E_n \leq 5x10^{-6} \, $$ $$
 * $$\displaystyle
 * }
 * }

=Problem 7-1=

Find
Expand $$e^x \,$$ in Taylor series w/ remainder.

Find the Taylor series expansion and remainder of $$f(x)\,$$

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

Solution [[media:HW1_P7_1.jpg|P7-1]]
Expanding $$e^x\,$$ in Taylor series w/ remainder,
 * $$e^x=\sum _{j=0}^{\infty}\frac{x^j}{j!}=\frac{x^0}{0!}+\frac{x^1}{1!}+\frac{x^2}{2!}+\frac{x^3}{3!}+...+\frac{x^n}{n!}=1+x+\frac{x^2}{2}+\frac{x^3}{6}+...+\frac{x^n}{n!}$$
 * $$R(x)=\frac{(x-0)^{n+1}}{(n+1)!}e^{\xi (x)}=\frac{x^{n+1}}{(n+1)!}e^{\xi(x)}$$

So then the Taylor series expansion and remainder of $$f(x)\,$$ is,


 * $$e^x=\sum _{j=0}^{\infty}\frac{x^j}{j!}=1+\sum _{j=1}^{\infty}\frac{x^j}{j!}$$
 * $$\Rightarrow e^x-1=\sum _{j=1}^{\infty}\frac{x^j}{j!}$$
 * $$\Rightarrow \frac{e^x-1}{x}=\sum _{j=1}^{\infty}\frac{x^{j-1}}{j!}$$

For $$e^x\,$$,
 * $$R(x)=\frac{x^{n+1}}{(n+1)!}e^{\xi(x)}$$

For $$e^x-1\,$$
 * $$R(x)=\frac{x^{n+1}}{(n+1)!}e^{\xi(x)}$$

For $$\frac{e^x-1}{x}\,$$
 * $$R(x)=\frac{x^n}{(n+1)!}e^{\xi(x)}$$

=Problem 8-2=

Find
Use Eq. (2) [http://upload.wikimedia.org/wikipedia/commons/c/c1/Egm6341.s10.mtg7.pdf Lec. 8-2] to obtain Eq. (1) [http://upload.wikimedia.org/wikipedia/commons/c/c1/Egm6341.s10.mtg7.pdf Lec. 7-1]

Given
Eq. (2)
 * $$I_1=\left ( \int_{a}^{b} l_0(xdx) \right )f(x_0)+\left ( \int_{a}^{b}l_1(x) \right )f(x_1)$$

Eq. (1)
 * $$I_1=\frac{b-a}{2}\left [ f(a)-f(b) \right ]$$

Solution [[media:HW1_P8_2.jpg|P8-2]]
Start with $$x_0=a \,$$ and $$x_1=b\,$$. Then,
 * $$l_0(x)=\frac{x-x_1}{x_0-x_1}=\frac{x-b}{a-b}$$

and
 * $$l_1(x)=\frac{x-x_0}{x_1-x_0}=\frac{x-a}{b-a}$$

Now,
 * $$\int _{a}^{b}l_0(x)dx=\frac{x^2}{2(a-b)}-\frac{bx}{a-b}=\frac{-(a-b)}{2}$$

And
 * $$\int _a^b l_1(x)=\frac{x^2}{2(b-a)}-\frac{ax}{b-a}=\frac{-(a-b)}{2}$$
 * $$\Rightarrow \left ( \frac{b-a}{2} \right )f(a)+\left ( \frac{b-a}{2} \right )f(b)$$
 * {| style="width:100%" border="0" align="left"


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

I_1=\frac{b-a}{2}\left [ f(a)+f(b) \right ] $$ $$
 * $$\displaystyle
 * }
 * }

=Problem 8-3=

Find
Prove $$P_2(x_j)=f(x_j)\,$$

Given
$$P_2(x_j)=\sum _{i=0}^{2}l_i(x_j)f(x_i)$$

Solution [[media:HW1_P8_3_1.jpg|P8-3]]

 * $$P_2(x_j)=\sum _{i=0}^{2}l_i(x_j)f(x_i)=l_0(x_j)f(x_0)+l_1(x_j)f(x_1)+l_2(x_j)f(x_2)$$

Also,
 * $$l_1(x_j)=\delta _{ij}=\left\{\begin{matrix}

1(i=j)\\ 0(i\neq j) \end{matrix}\right.$$ And
 * $$l_0(x_0)=1\,$$
 * $$l_0(x_1)=l_0(x_2)=0\,$$


 * $$l_1(x_1)=1\,$$
 * $$l_1(x_0)=l_1(x_2)=0\,$$


 * $$l_2(x_2)=1\,$$
 * $$l_2(x_0)=l_2(x_1)=0\,$$

Therefore,
 * $$P_2(x_0)=l_0(x_0)f(x_0)+l_1(x_0)f(x_1)+l_2(x_0)f(x_2)=f(x_0)\,$$
 * $$P_2(x_1)=l_0(x_1)f(x_0)+l_1(x_1)f(x_1)+l_2(x_1)f(x_2)=f(x_1)\,$$
 * $$P_2(x_2)=l_0(x_2)f(x_0)+l_1(x_2)f(x_1)+l_2(x_2)f(x_2)=f(x_2)\,$$

...


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


 * style="width:50%; padding:10px; border:2px solid #8888aa" |
 * $$ \displaystyle
 * $$ \displaystyle

\Rightarrow P_2(x_j)=\sum _{i=0}^{2}l_i(x_j)f(x_i)=f(x_j) $$ $$
 * $$\displaystyle
 * }
 * }

=Contributing members= EGM6341.s10.Team1.Kumanchik 17:07, 27 January 2010 (UTC) EGM6341.s10.Team1.Ya-Chiao Chang18:32, 27 January 2010 (UTC) Egm6341.s10.team1.lei 19:22, 27 January 2010 (UTC) Egm6341.s10.team1.toddmock 21:03, 27 January 2010 (UTC)