User:Egm6341.s11.team5.shin/HW1

= Problem 1 - L'Hôpital's rule = From (meeting 3 page 1)

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

Find

 * $$\displaystyle \lim_{x \to 0}f(x)$$ and plot $$\displaystyle f(x)$$ for $$\displaystyle x \in [0,1] $$.

Solution
Using L'Hospital's Rule, the limit can be evaluated. L'Hospital's Rule:
 * {| style="width:100%" border="0" align="left"

\lim_{x \to 0}\frac{g(x)}{h(x)}=\lim_{x \to 0}\frac{g^{'}(x)}{h^{'}(x)} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (1)
 * }
 * }

Applying the Rule:

As a result, the limit is computed as follows.
 * $$\displaystyle g(x)=e^x-1$$, || $$\displaystyle g^{'}(x)=e^x$$
 * $$\displaystyle h(x)=x$$, || $$\displaystyle h^{'}(x)=1$$
 * }
 * $$\displaystyle h(x)=x$$, || $$\displaystyle h^{'}(x)=1$$
 * }
 * $$\lim_{x \to 0}\frac{e^x-1}{x}=\lim_{x \to 0}\frac{e^x}{1}$$
 * $$\lim_{x \to 0}\frac{e^x}{1}=\frac{1}{1}=1$$

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

$$\displaystyle \ \lim_{x\rightarrow 0} \frac{e^{x}-1}{x} \ = \ 1 $$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

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

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 2 - Taylor series expansion = From (meeting 3 page 4)
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * }
 * }
 * }

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

Find

 * $$\displaystyle P_n(x)$$ and $$\displaystyle R_{n+1}(x)$$ of $$\displaystyle e^x$$ and $$\displaystyle \frac{e^x-1}{x}$$.

Solution
Through Taylor series, a function $$\displaystyle f(x) $$ can be decomposed into $$\displaystyle P_n(x)$$ and $$\displaystyle R_{n+1}(x)$$. From the lecture notes p.3-3, $$\displaystyle P_n(x)$$ and $$\displaystyle R_{n+1}(x)$$ is defined as


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

P_{n}(x)=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\cdots+\frac{(x-x_{0})^{n}}{n!}f^{(n)}(x_{0}) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (2)
 * }
 * }


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

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


 * $$\displaystyle f(x)=e^x $$
 * We know that n-th derivative of function $$\displaystyle e^x$$.
 * {| style="width:100%" border="0" align="left"

\frac{d^{(n)}}{dx^{(n)}}(e^x) = e^x $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (4)
 * }
 * Substitute Eq.(4) into Eq.(2) to obtain $$\displaystyle P_n(x)$$.
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

P_n(x)=e^{x_0}+\frac{(x-x_0)}{1!}e^{x_0}+\cdots+\frac{(x-x_0)^n}{n!}e^{x_0} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (5)
 * }
 * Simplify Eq.(5).
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

\begin{align} P_n(x)&=\bigl(1+\frac{(x-x_0)}{1!}+\cdots+\frac{(x-x_0)^n}{n!}\bigr)e^{x_0}\\ &=\sum_{i=0}^{n}\bigl(\frac{(x-x_0)^i}{i!}\bigr)e^{x_0} \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (6)
 * }
 * }


 * Substitute Eq.(4) into Eq.(3) to obtain $$\displaystyle R_{n+1}(x)$$.
 * {| style="width:100%" border="0" align="left"

R_{n+1}(x)=\frac{(x-x_{0})^{n+1}}{(n+1)!}e^{\xi}, \quad \xi\in[x_{0},x] $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (7)
 * }
 * The result of Taylor series expansion on $$\displaystyle f(x)=e^x $$ is shown below.
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

$$\displaystyle \begin{align} P_n(x)&=\sum_{i=0}^{n}\bigl(\frac{(x-x_0)^i}{i!}\bigr)e^{x_0} \\ R_{n+1}(x)&=\frac{(x-x_{0})^{n+1}}{(n+1)!}e^{\xi}, \quad \xi\in[x_{0},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" |
 * }
 * Also, the expansion becomes as below if $$\displaystyle x_0=0 $$.
 * }
 * Also, the expansion becomes as below if $$\displaystyle x_0=0 $$.


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

$$\displaystyle \begin{align} P_n(x)&=\sum_{i=0}^{n}\bigl(\frac{x^i}{i!}\bigr) \\ R_{n+1}(x)&=\frac{x^{n+1}}{(n+1)!}e^{\xi}, \quad \xi\in[0,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" |
 * $$\displaystyle (8)$$
 * }
 * }


 * $$\displaystyle f(x)=\frac{e^x-1}{x} $$
 * To perform Taylor series expansion on $$\displaystyle f(x)=\frac{e^x-1}{x} $$, we need to exploit Eq.(8). Assume the result of the expansion is $$\displaystyle P^{'}_n(x) $$ and the remainder is $$\displaystyle R^{'}_n(x) $$.
 * Then, $$\displaystyle P^{'}_n(x) $$ can be obtained as follows.
 * {| style="width:100%" border="0" align="left"

\begin{align} P_n(x)-1&=\sum_{i=0}^{n}\frac{x^i}{i!}-1 \\ &=\bigl(1+\sum_{i=1}^{n}\frac{x^i}{i!}\bigr)-1 \\ &=\sum_{i=1}^{n}\frac{x^i}{i!} \end{align} $$ \begin{align} P^'_n(x)&=\frac{P_n(x)-1}{x} \\ &=\sum_{i=1}^{n}\frac{x^{i-1}}{i!} \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (9) $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (10) $$
 * }
 * Similarly, $$\displaystyle R^'_{n+1}(x)$$ can be computed. Note here that the term $$\displaystyle -1$$ in the function $$\displaystyle f(x)$$ is already taken into account in $$\displaystyle P^'_n(x)$$. Therefore, $$\displaystyle R^'_{n+1}(x)$$ can be computed by dividing $$\displaystyle R_{n+1}(x)$$ by $$\displaystyle x $$.
 * {| style="width:100%" border="0" align="left"

\begin{align} R^'_{n+1}(x)&=\frac{R_{n+1}(x)}{x} \\ &=\frac{x^n}{(n+1)!}e^{\xi}, \quad \xi\in[0,x] \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (11)
 * }
 * Hence, the expansion result of $$\displaystyle f(x)=\frac{e^x-1}{x} $$ is shown as:
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

$$\displaystyle \begin{align} P^'_n(x)&=\sum_{i=1}^{n}\frac{x^{i-1}}{i!} \\ R^'_{n+1}(x)&=\frac{x^n}{(n+1)!}e^{\xi}, \quad \xi\in[0,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" |
 * $$\displaystyle (12)$$
 * }
 * }