User:Egm6341.s11.team5/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"


 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * style="width:30%; padding:10px; border:1px solid #888888" align="center" |
 * }
 * }
 * }

Author and proof-reader
[Author] Oh

[Proof-reader] cavalcanti, Shin, Raghunathan, Reiss

= Problem 2 - Taylor series expansion = From (meeting 3 page 4)

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

Author and proof-reader
[Author] Shin

[Proof-reader] Oh

=Problem 3 - Prove IMVT= From (meeting 4 page 3)

If $$\displaystyle f(x)$$ and $$\displaystyle w(x)$$ are continuous non-negative functions $$\in [a,b]$$

Find

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

\int _a^bf(x) w(x)dx=f(\zeta ) \int_a^b w(x) \, dx $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

Solution
'''Solved via combination of Mean value theorems for integration, Wikipedia

and Egm6341.s10.team3.sa/HW1 '''

First, since $$\displaystyle w(x) $$ is arbitrary and non negative we will set it equal to I


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

I=\int_a^b w(x) \, dx $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (13)
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

\int_a^b w(x) f(x) \, dx=f(\zeta ) I $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (14)
 * }
 * }

Next we will set constants at the extreme values of $$ f(x)\in [a,b]$$


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

M=\max (f(x)),m=\min (f(x)) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (15)
 * }
 * }

Therefore, from the Extreme Value Theorem


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

m I \leq \int_a^b w(x) f(x) \, dx\leq M I $$ $$ Evaluating and subsituting in from above
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (16)
 * }
 * }


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

m \leq \frac{1}{ I } \int_a^b w(x) f(x) \, dx\leq M $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (17)
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

Z=\frac{1}{ I } \int_a^b w(x) f(x) \, dx $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (18)
 * }
 * }


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

\min (f(x))\leq f(\zeta )\leq \max (f(x)) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (19)
 * }
 * }

Since $$\displaystyle f(x)$$ is continous from $$\displaystyle M$$ to $$\displaystyle m$$ there exists $$\displaystyle \zeta \in [a,b]$$ at $$\displaystyle f(\zeta)=Z $$ .
 * {| style="width:100%" border="0" align="left"

$$\therefore f(\zeta)=\frac{1}{\int_a^b w(x) \, dx} \int_a^b w(x) f(x) \, dx$$
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="left" |
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="left" |


 * }
 * }
 * }

Egm6341.spring-11.5.D 19:30, 24 January 2011 (UTC)

If $$\displaystyle w(x)$$ is strictly negative


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

f(\zeta)=\frac{1}{(-1) \cdot \int_a^b w(x) \, dx} \cdot (-1) \cdot \int_a^b w(x) f(x) \, dx $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (20)
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"


 * style="width:50%; padding:10px; border:2px solid #8888aa" align="left" |
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="left" |

$$\therefore f(\zeta)=\frac{1}{\int_a^b w(x) \, dx} \int_a^b w(x) f(x) \, dx$$


 * }
 * }
 * }

Author and proof-reader
[Author] Davis 18:28, 24 January 2011 (UTC)

[Proof-reader] cavalcanti, Oh, Raghunathan, Shin

=Problem 4 - Plot and find infinity norm of Functions= From (meeting 5 page 3)


 * If $$\displaystyle f(x)=3x-2x^3$$, where $$\displaystyle x \in[0,1]$$ and
 * if $$\displaystyle g(x)=\sinh(x)$$, where $$\displaystyle x \in[0,1]$$

Find
1. $$\displaystyle \left \| f \right \|_{\infty }\ $$, $$\displaystyle \left \| g \right \|_{\infty }\ $$ and $$\displaystyle \left \| f - g\right \|_{\infty }\ $$ 2. Plot $$\displaystyle f, g,$$ and $$\displaystyle f-g$$

Solution
1.The definition of the infinity norm is as follows:
 * {| style="width:100%" border="0" align="left"

\left \| f(x) \right \|_{\infty }\ = \max \left| f(x) \right| $$ $$ Similarly,
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (21)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

\left \| g(x) \right \|_{\infty }\ = \max \left| g(x) \right| $$ $$ Also, by definition:
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (22)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

\left \| f - g\right \|_{\infty }\ = \max \left| f(x) - g(x)\right| $$ $$ 2. In the interval of $$ [0,1]$$, the norms are as follows:
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (23)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

$$ \begin{align} \left \| 3x - 2x^3 \right \|_{\infty }\ &= 1.4142 \text{ at } x = 1/\sqrt{2} \\ \left \| \sinh (x) \right \|_{\infty }\ &= 1.1752 \text{ at } x = 1 \\ \left \| f - g\right \|_{\infty }\ &= 0.739161 \text{ at } x = 0.554 \\ \end{align} $$ 3. The plot of both functions are shown in the interval $$[0,1]$$, followed by the octave code. Plot: Octave code:
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="left" |
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="left" |
 * }
 * }
 * }


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

octave-3.2.4.exe:1> x=[0:0.001:1]; octave-3.2.4.exe:2> y=(3*x)-(2*x.^3); octave-3.2.4.exe.3> y2=sinh(x); octave-3.2.4.exe:4> y3=y-y2; octave-3.2.4.exe:5> plot(x,y,"-10",x,y2,"-11", x, y3, "-12") octave-3.2.4.exe.6> legend('f(x)', 'g(x)', 'f-g')
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="left" |
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="left" |
 * }
 * }
 * }

Author and proof-reader
[Author] cavalcanti, Reiss, raghunathan

[Proof-reader] Oh, Raghunathan, Shin

= References =
 * L'Hospital's Rule, WolframMathworld
 * Mean Value Theorems for integration, Wikipedia
 * Extreme Value Theorem, Wikipedia

=Contributing members=

Signatures
Oh - Solved HW1.1 and proof-read HW1.2, 1.3 and 1.4 Shin - Solved, posted HW1.2 and proof-read HW1.1, HW1.3, HW1.4 Raghunathan - Solved HW1.1,1.3,1.4 manually and reviewed HW1.1, 1.3 and 1.4 Cavalcanti - Solved problems manually, reviewed HW1.1 and posted HW 1.4 EGM6341.S11.team5.cavalcanti 02:10, 26 January 2011 (UTC)