User:Egm6341.s10.Team4/HW1

= Problem 1: Limits=

Given
Refer Lecture slide 2-1 for problem statement


 * {| style="width:70%" border="0" align="center"



f(x) = \frac{e^x - 1}{x} $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)


 * }.
 * }.

Find
1. Find


 * {| style="width:70%" border="0" align="center"



\lim_{x \rightarrow 0}f(x) $$
 * $$\displaystyle


 * }.
 * }.

2. Plot
 * {| style="width:70%" border="0" align="center"



f(x),\ x\in[0,1] $$
 * $$\displaystyle


 * }.
 * }.

Solution
1. Limit

The Taylor series expansion for $$\displaystyle e^x $$ is given by,


 * {| style="width:70%" border="0" align="center"



\begin{align} e^x &= \sum_{i=0}^n \frac{x^i}{i!} \\ &= 1 + \sum_{i=1}^n \frac{x^i}{i!} \end{align} $$
 * $$\displaystyle


 * }.
 * }.

Dividing throughout by x,


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle

\Rightarrow \frac{e^x - 1}{x} = \sum_{i=1}^n \frac{x^{i-1}}{i!}

$$


 * }.
 * }.

which is equal to $$\displaystyle f(x)$$ in Equation(1).


 * {| style="width:70%" border="0" align="center"



\begin{align} \Rightarrow f(x) &= \frac{e^x - 1}{x} \\ &= \sum_{i=1}^n \frac{x^{i-1}}{i!} &= \frac{x^0}{1!} + \frac{x^1}{2!} + \frac{x^2}{3!} + \cdots \end{align} $$
 * $$\displaystyle


 * }.
 * }.

Applying limits on both sides,


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle

\Rightarrow \lim_{x \rightarrow 0}f(x) = \frac{0^0}{1!} + \cancelto{0}{\frac{0^1}{2!}} + \cancelto{0}{\frac{0^2}{3!}} + \cdots

$$


 * }.
 * }.

Hence,


 * {| style="width:70%" border="0" align="center"

$$\displaystyle \Rightarrow \lim_{x \rightarrow 0}f(x) = 1 $$ $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * $$\displaystyle \longrightarrow (2)


 * style= |


 * }.
 * }.

2. Plot convergence of $$\displaystyle f(x) $$ .

To visualize the limit as in Equation (2), $$\displaystyle f(x) \to 1 \ as\ x \to 0 $$, two plots are provided below one with $$\displaystyle n = 10 $$ in the Taylor series, & with 10 points on x-axis scale, and another with $$\displaystyle n = 100 $$, & with 100 points on x-axis scale.

Matlab Code:

Plots:

.

Author
Solved by - --Egm6341.s10.Team4.roni 04:31, 18 February 2010 (UTC) Typed and Reviewed by - Egm6341.s10.Team4.andy 21:59, 17 February 2010 (UTC) .

= Problem 2: Taylor Series Terms =

Given
Refer Lecture slide 2-3 for problem statement.

From lecture slide 2-2, for a continuous function $$\displaystyle f(x) $$, the Taylor series is given by


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

f(x)= p_n(x) + R_{n+1}(x) $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

such that $$\displaystyle f^{n+1}(x) $$ exists and continuous,


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

f^{n+1}(x) := \frac{d^{n+1}}{dx^{n+1}} f(x) $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

where,


 * {| 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 \longrightarrow (1)
 * }.
 * }.

and,


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

R_{n+1}(x):= \frac{1}{n!} \int_{x_0}^{x}(x-t)^nf^{n+1}(t)dt $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)
 * }.
 * }.

Find
To find $$\displaystyle p_n(x) $$ and $$\displaystyle R_{n+1}(x) $$ for $$\displaystyle e^x $$.

Solution
Taking $$\displaystyle x_0 = 0 $$, Equation (1) for $$\displaystyle f(x) = e^x $$ becomes,


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

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

which is,


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

$$\displaystyle p_n(x)= 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots + \frac{x^n}{n!} $$ $$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * $$\displaystyle \longrightarrow (3)


 * }.
 * }.

From Lecture slide 2-3, Equation(2) is given by,


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

R_{n+1}(x)= \frac{(x-x_0)^{n+1}}{(n+1)!} f^{n+1}(\xi) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \xi \in [x_0,x] $$
 * $$\displaystyle \longrightarrow (4)
 * }.
 * }.

For $$\displaystyle x_0 = 0 $$ and $$\displaystyle f(x) = e^x $$ Equation (4) becomes,


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

$$\displaystyle R_{n+1}(x)= \frac{x^{n+1}}{(n+1)!} e^\xi $$ $$
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * $$\displaystyle \longrightarrow (5)
 * }.
 * }.

Author
Solved by - --Egm6341.s10.Team4.roni 04:41, 18 February 2010 (UTC) Typed and Reviewed by - Egm6341.s10.Team4.andy 22:00, 17 February 2010 (UTC) .

= Problem 3: Infinity Norms =

Given
Refer Lecture slide 3-3 for problem statement.


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

f(x)= sin x $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)
 * }.
 * }.


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

g(x)= sin (x-\frac{\pi}{2}) = -cos x $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)
 * }.
 * }.

Find
1. Plot $$\displaystyle f(x), g(x) $$ given $$\displaystyle x \in [0,\pi] $$.

2. Find $$\displaystyle \parallel f \parallel_{\infty}, \parallel g \parallel_{\infty}, \parallel f - g\parallel_{\infty} $$

Solution
1. 

Matlab Code:

Plots:

.

2.

The infinity norms are given as,


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

\parallel f \parallel_{\infty} = \underset{x}{max} |f| $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

or


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

\parallel f - g\parallel_{\infty} = \underset{x}{max} |f - g| $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Min and Max Values from Matlab:

So, the infinity norms are given by,


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

$$\displaystyle \begin{align} \parallel f \parallel_{\infty} &= 1 \\
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |

\parallel g \parallel_{\infty} &= 1 \\ \parallel f - g\parallel_{\infty} &= 1.414214 \end{align} $$
 * style = |


 * }.

Author
Solved by - --Egm6341.s10.Team4.roni 04:43, 18 February 2010 (UTC) Typed and Reviewed by - Egm6341.s10.Team4.andy 22:00, 17 February 2010 (UTC) .

= Problem 4: Integral Mean Value Theorem (IMVT)=

Given
From lecture slide [[media:Egm6341.s10.mtg2.pdf|2-4]], any function $$\displaystyle f(.) $$ continuous on $$\displaystyle [a,b] $$ with $$\displaystyle m = min(f(x)) $$ and $$\displaystyle M =  max(f(x)) $$,


 * {| style="width:70%" border="0" align="center"



m \le f(x) \le M $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)


 * }
 * }

Find
Lecture Slide [[media:Egm6341.s10.mtg5.pdf|5-1]]:

1. Prove IMVT for non-negative $$\displaystyle W(.) \Rightarrow W \ge 0$$, given by:


 * {| style="width:70%" border="0" align="center"



\int_{a}^{b}W(x)f(x)dx = f(\xi)\int_{a}^{b}W(x)dx $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)


 * }
 * }

where $$\displaystyle \xi \in [a,b] $$

2. Prove IMVT for non-zero $$\displaystyle W(.) \Rightarrow W \ne 0$$.

Solution
1. $$\displaystyle W(x) \ge 0$$ .

Equation (1),


 * {| style="width:70%" border="0" align="center"



m \le f(x) \le M $$
 * $$\displaystyle


 * }.
 * }.

Multiplying by non-negative $$\displaystyle W(x) $$,


 * {| style="width:70%" border="0" align="center"



\Rightarrow m W(x) \le W(x)f(x) \le M W(x) $$
 * $$\displaystyle


 * }.
 * }.

Integrating from a to b with respect to x,


 * {| style="width:70%" border="0" align="center"



\Rightarrow m \int_{a}^{b} W(x)dx \le \int_{a}^{b} W(x)f(x)dx \le M \int_{a}^{b} W(x)dx $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (3)


 * }.
 * }.

Let the integral $$\displaystyle I $$ be,


 * {| style="width:70%" border="0" align="center"



I:=\int_{a}^{b} W(x)dx $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (4)
 * }.
 * }.

For $$\displaystyle I = 0 $$, the non-strict inequality Equation (3) holds true. So, we will take the case when $$\displaystyle I > 0$$.

Dividing (4) throughout (3),


 * {| style="width:70%" border="0" align="center"



\Rightarrow m \le \frac{1}{I} \int_{a}^{b} W(x)f(x)dx \le M $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (5)


 * }.
 * }.

From Lecture slide [[media:Egm6341.s10.mtg3.pdf|3-4]], we know that for every value in the closed interval $$\displaystyle [a,b] $$ there exists at least a value [need not be unique] $$\displaystyle \xi \in [a,b] $$ such that $$\displaystyle \zeta = f(\xi) = \frac{1}{b-a} \int_{a}^{b} f(x)dx$$, specifically for a continuous function $$\displaystyle f(x) $$.

With the same argument, there exists at least a value $$\displaystyle \xi_1 \in [a,b] $$ such that for a continuous function $$\displaystyle f(x) $$,


 * {| style="width:70%" border="0" align="center"



\Rightarrow \zeta_1 = f(\xi_1) = \frac{1}{I} \int_{a}^{b} W(x)f(x)dx $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (6)


 * }.
 * }.

Hence,


 * {| style="width:70%" border="0" align="center"



\Rightarrow f(\xi_1) I = \int_{a}^{b} W(x)f(x)dx $$
 * $$\displaystyle


 * }.
 * }.

proving Equation (2) for a non-negative $$\displaystyle W(x) $$,


 * {| style="width:70%" border="0" align="center"



$$\displaystyle \Rightarrow f(\xi_1) \int_{a}^{b} W(x)dx = \int_{a}^{b} W(x)f(x)dx $$ $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * $$\displaystyle \longrightarrow (7)
 * style= |


 * }.
 * }.

2. $$\displaystyle W(x) \ne 0$$ .

For the case when $$\displaystyle W(x) > 0$$ the above proof holds.

Next we deal the case when $$\displaystyle W(x) < 0$$.

Multiplying Equation(1) by $$\displaystyle -W(x)$$ (this makes $$\displaystyle W(x) > 0$$ in the below equations),


 * {| style="width:70%" border="0" align="center"



\Rightarrow -m W(x) \ge -W(x)f(x) \ge -M W(x) $$
 * $$\displaystyle


 * }.
 * }.

Integrating from a to b with respect to x gives,


 * {| style="width:70%" border="0" align="center"



\Rightarrow -m \int_{a}^{b} W(x)dx \ge -\int_{a}^{b} W(x)f(x)dx \ge -M \int_{a}^{b} W(x)dx $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (8)


 * }.
 * }.

Multiplying Equation(8) throughout by -1, we get Equation (3). Right from there, we can prove IMVT following the same procedure as explained above.

Author
Solved by - Egm6341.s10.Team4.andy 22:00, 17 February 2010 (UTC), Egm6341.s10.team4.anandankala 13:43, 19 February 2010 (UTC)

Typed by - Egm6341.s10.Team4.andy 22:00, 17 February 2010 (UTC).

= Problem 5: IMVT Appication Example =

Given
The Integral Mean Value Theorem (IMVT) is given by,


 * {| style="width:70%" border="0" align="center"



\int_{a}^{b}W(t)f(t)dt = f(\xi)\int_{a}^{b}W(t)dt $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (1)


 * }
 * }

where $$\displaystyle \xi \in [a,b] $$

Find
Refer Lecture slide [[media:Egm6341.s10.mtg5.pdf|5-1]] for problem statement.

From Lecture slide [[media:Egm6341.s10.mtg2.pdf|2-2]] the Remainder $$\displaystyle R_{n+1}(x)$$ of the Taylor series is given by,


 * {| style="width:70%" border="0" align="center"



R_{n+1}(x) := \frac{1}{n!} \int_{x_0}^{x} (x-t)^n f^{n+1}(t)dt $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (2)


 * }.
 * }.

where $$\displaystyle f^{n+1}(t) $$ is the $$\displaystyle (n+1)^{th} $$ derivative of $$\displaystyle f(t) $$.

Using IMVT show that,


 * {| style="width:70%" border="0" align="center"



R_{n+1}(x) = \frac{(x-x_0)^{n+1}}{(n+1)!} f^{n+1}(\xi) $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (3)


 * }.
 * }.

where $$\displaystyle \xi \in [x_0,x] $$.

Solution
Equation (2) is given by,


 * {| style="width:70%" border="0" align="center"



R_{n+1}(x) := \frac{1}{n!} \int_{x_0}^{x} \underbrace{(x-t)^n}_{W(t)} \underbrace{f^{n+1}(t)}_{g(t)}dt $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (3)


 * }.
 * }.

Now, using IMVT we can pull out $$\displaystyle g(t) $$ valued at $$\displaystyle \xi $$ resulting in,


 * {| style="width:70%" border="0" align="center"



\Rightarrow R_{n+1}(x) = g(\xi)\frac{1}{n!} \int_{x_0}^{x} \underbrace{(x-t)^n}_{W(t)} dt $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (4)


 * }.
 * }.

The integrand $$\displaystyle W(t) = (x-t)^n $$ is integrated from $$\displaystyle x_0 $$ to $$\displaystyle x $$. So, $$\displaystyle t \in [x_0,x]$$, which means $$\displaystyle (x-t) \ge 0$$. $$\displaystyle \Rightarrow W(t) \ge 0 $$.


 * {| style="width:70%" border="0" align="center"



\begin{align}
 * $$\displaystyle

\Rightarrow \int_{x_0}^{x} W(t)dt & = \int_{x_0}^{x} {(x-t)^n} dt \\ & = -\frac{1}{n+1} \left [ (x-t)^{n+1}\right]_{x0}^{x} \\ & = -\frac{1}{n+1} \left [ \cancelto{0}{(x-x)^{n+1}} - (x-x_0)^{n+1} \right ] \\ & = -\frac{1}{n+1} \left [- (x-x_0)^{n+1} \right ] \end{align} $$


 * }.
 * }.

So,


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle

\Rightarrow \int_{x_0}^{x} W(t)dt = \frac{(x-x_0)^{n+1}}{n+1}

$$ $$
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (5)


 * }.
 * }.

Substituting (5) in (4),


 * {| style="width:70%" border="0" align="center"



\begin{align} \Rightarrow R_{n+1}(x) &= g(\xi)\frac{1}{n!} \frac{(x-x_0)^{n+1}}{n+1} \\ &= g(\xi)\frac{(x-x_0)^{n+1}}{(n+1)!} \\ &= f^{n+1}(\xi)\frac{(x-x_0)^{n+1}}{(n+1)!} \end{align} $$
 * $$\displaystyle


 * }.
 * }.

Hence Equation(3) is proved,


 * {| style="width:70%" border="0" align="center"

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

\Rightarrow 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)

$$ $$
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (6)
 * style= |
 * }.
 * }.

Author
Solved and Typed by - Egm6341.s10.Team4.andy 22:01, 17 February 2010 (UTC) .

= Problem 6: Taylor Series: Integration by Parts !!=

Given
Use following Integration


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

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle f(x)=f(x_0)+\dfrac{x-x_0}{1!}f^1(x_0)+\int\limits_{x_0}^{x} (x-t)f^2(t)\, dt


 * }
 * }

Find
Repeat integration by parts to reveal:


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

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \dfrac{(x-x_0)^2}{2!}f^2(x_0)+\dfrac{(x-x_0)^3}{3!}f^3(x_0)


 * }
 * }

Solution
For solving this problem we should show that:



I=\int\limits_{x_0}^{x} (x-t)f^2(t)\, dt = \dfrac{(x-x_0)^2}{2!}f^2(x_0)+\dfrac{(x-x_0)^3}{3!}f^3(x_0)+.... $$

From integration by parts; we can define functions u and dv as:



f^2(t)=u; (x-t)dt=dv \rightarrow\ v=\int\limits_{x_0}^{x}(x-t)\, dt = xt-\dfrac{(t^2)}{2} $$



\Rightarrow\ \int\limits_{x_0}^{x} (x-t)f^2(t)\, dt=[(xt-\dfrac{t^2}{2})f^2(t)]-\int\limits_{x_0}^{x}(xt-\dfrac{t^2}{2})f^3(t)\, dt= $$



=\dfrac{x^2}{2}f^2(x)-xx_0f^2(x_0)+\dfrac{x_0^2}{2}f^2(x_0)-\int\limits_{x_0}^{x} (xt-\dfrac{t^2}{2})f^3(t)\, dt $$

Then, by adding and subtracting following term to the integral,



\dfrac{x^2}{2}f^2(x_0) $$

We obtain:



=\dfrac{x^2}{2}f^2(x)-\dfrac{x^2}{2}f^2(x_0)+\dfrac{x^2}{2}f^2(x_0)-\dfrac{2xx_0}{2}f^2(x_0)+\dfrac{x_0^2}{2}f^2(x_0)-\int\limits_{x_0}^{x} (xt-\dfrac{t^2}{2})f^3(t)\, dt= $$



=\dfrac{(x-x_0)^2}{2!}f^2(x_0)+\dfrac{x^2}{2}\int\limits_{x_0}^{x} f^3(t)\, dt-\int\limits_{x_0}^{x} (xt-\dfrac{t^2}{2})f^3(t)\, dt= $$



=\dfrac{(x-x_0)^2}{2!}f^2(x_0)-\int\limits_{x_0}^{x} (\dfrac{x^2}{2}-xt+\dfrac{t^2}{2})f^3(t)\, dt $$

The first term of the expression has already been attained. Now, we should reveal that:



\int\limits_{x_0}^{x} (\dfrac{x^2}{2}-xt+\dfrac{t^2}{2})f^3(t)\, dt=\dfrac{(x-x_0)^3}{3!}f^3(x_0)+.... $$

Again by integration by parts we have:



f^3(t)=u; (\dfrac{x^2}{2}-xt-\dfrac{t^2}{2})dt=dv \rightarrow\ v=\int\limits_{x_0}^{x}(\dfrac{x^2}{2}-xt+\dfrac{t^2}{2})\, dt = (\dfrac{x^2}{2}t-\dfrac{x}{2}t^2+\dfrac{1}{6}t^3) $$



\Rightarrow\ \int\limits_{x_0}^{x} (\dfrac{x^2}{2}-xt+\dfrac{t^2}{2})f^3(t)\, dt=[(\dfrac{x^2}{2}t-\dfrac{x}{2}t^2+\dfrac{t^3}{6})f^3(t)]-\int\limits_{x_0}^{x} (\dfrac{x^2}{2}t-\dfrac{x}{2}t^2+\dfrac{1}{6}t^3)f^4(t)\, dt $$



=\dfrac{x^3}{6}f^3(x)-\dfrac{x^2}{2}x_0f^3(x_0)+\dfrac{xx_0^2}{2}f^3(x_0)-\dfrac{x_0^3}{6}f^3(x_0)-\int\limits_{x_0}^{x} (\dfrac{x^2}{2}t-\dfrac{x}{2}t^2+\dfrac{1}{6}t^3)f^4(t)\, dt $$



=\dfrac{x^3}{6}f^3(x)+\dfrac{(-3x_0x^2+3x_0^2x-x_0^3)}{6=3!}f^3(x_0)-\dfrac{x^3}{6}f^3(x_0)+\dfrac{x^3}{6}f^3(x_0)+....=\dfrac{(x-x_0)^3}{3!}f^3(x_0)+\int\limits_{x_0}^{x} (\dfrac{x^3}{6}-\dfrac{x^2}{2}t+\dfrac{x}{2}t^2+\dfrac{1}{6}t^3)f^4(t)\, dt $$


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

$$ \Rightarrow\ f(x)=f(x_0)+\dfrac{x-x_0}{1!}f^1(x_0)+\int\limits_{x_0}^{x} (x-t)f^2(t)\, dt+\dfrac{(x-x_0)^2}{2!}f^2(x_0)+\dfrac{(x-x_0)^3}{3!}f^3(x_0)+.... $$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.

Author
Solved and Typed by - Egm6341.s10.Team4.nimaa&amp;m 02:33, 18 February 2010 (UTC) .

= Problem 7: Taylor series extension =

Given

 * {| style="width:70%" border="0" align="center"

f(x)= \sin(x),  x \in [0,\pi] $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (1)


 * }
 * }

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

2. Plot these series (for each n)

3. Find (estimate of max)of R(x) at $$x=\dfrac{\pi}{2}$$

Solution
1. Construct Taylor series of $$\displaystyle f(x)$$ around $$x_o=\dfrac{\pi}{4}$$  for n = 0, 1,..., 10

when n=0,


 * {| style="width:70%" border="0" align="center"



P_0(x)= \sin(\dfrac{\pi}{4}) = \dfrac{1}{\sqrt{2}} $$
 * $$\displaystyle


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"



R_0(x) = \sin(x)-\sin(\dfrac{\pi}{4}) $$
 * $$\displaystyle


 * }.
 * }.

when n=1,


 * {| style="width:70%" border="0" align="center"



P_1(x)= \sin(\dfrac{\pi}{4}) + (x-\dfrac{\pi}{4})\cos(\dfrac{\pi}{4}) = \dfrac{1}{\sqrt{2}} + \dfrac{1}{\sqrt{2}}(x-\dfrac{\pi}{4}) $$
 * $$\displaystyle


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"



R_1(x) = -\sin(\xi)\dfrac{(x-\dfrac{\pi}{4})^2}{2!}, \xi \in [0,\pi] $$
 * $$\displaystyle


 * }.
 * }.

when n=2,
 * {| style="width:70%" border="0" align="center"



P_2(x)= \sin(\dfrac{\pi}{4}) + (x-\dfrac{\pi}{4})\cos(\dfrac{\pi}{4}) - \dfrac{(x-\dfrac{\pi}{4})^2}{2!}\sin(\dfrac{\pi}{4}) = \dfrac{1}{\sqrt{2}} + \dfrac{1}{\sqrt{2}}(x-\dfrac{\pi}{4})- \dfrac{1}{\sqrt{2}}\dfrac{(x-\dfrac{\pi}{4})^2}{2} $$
 * $$\displaystyle


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"



R_2(x) = -\cos(\xi)\dfrac{(x-\dfrac{\pi}{4})^3}{3!}, \xi \in [0,\pi] $$
 * $$\displaystyle


 * }.
 * }.

when n=3,


 * {| style="width:70%" border="0" align="center"



P_3(x)= \sin(\dfrac{\pi}{4}) + (x-\dfrac{\pi}{4})\cos(\dfrac{\pi}{4}) - \dfrac{(x-\dfrac{\pi}{4})^2}{2!}\sin(\dfrac{\pi}{4}) - \dfrac{(x-\dfrac{\pi}{4})^3}{3!}\cos(\dfrac{\pi}{4}) = \dfrac{1}{\sqrt{2}} + \dfrac{1}{\sqrt{2}}(x-\dfrac{\pi}{4})- \dfrac{1}{2\sqrt{2}}(x-\dfrac{\pi}{4})^2 - \dfrac{1}{6\sqrt{2}}(x-\dfrac{\pi}{4})^3 $$
 * $$\displaystyle


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"



R_3(x) = \sin(\xi)\dfrac{(x-\dfrac{\pi}{4})^4}{4!}, \xi \in [0,\pi] $$
 * $$\displaystyle


 * }.
 * }.

when n=4,


 * {| style="width:70%" border="0" align="center"



P_4(x)= P_3(x) + \dfrac{(x-\dfrac{\pi}{4})^4}{4!}\sin(\dfrac{\pi}{4}) $$
 * $$\displaystyle


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"



R_4(x) = \cos(\xi)\dfrac{(x-\dfrac{\pi}{4})^5}{5!}, \xi \in [0,\pi] $$
 * $$\displaystyle


 * }.
 * }.

when n=5 ~ 10,


 * {| style="width:70%" border="0" align="center"



P_n(x)= P_{n-1}(x) + \dfrac{(x-\dfrac{\pi}{4})^n}{n!}f^{(n)}(\dfrac{\pi}{4}) $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (2)


 * }.
 * {| style="width:70%" border="0" align="center"
 * {| style="width:70%" border="0" align="center"



R_n(x) = f^{(n+1)}(\xi)\dfrac{(x-\dfrac{\pi}{4})^{n+1}}{(n+1)!} $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (3)


 * }.
 * }.

where,
 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle f^{(n)}(x) = \sin(x)$$ n=4k,   (k=0,1,2,.......)

$$\displaystyle f^{(n)}(x) = \cos(x)$$ n=4k+1,   (k=0,1,2,.......)

$$\displaystyle f^{(n)}(x) = -\sin(x)$$ n=4k+2,   (k=0,1,2,.......)

$$\displaystyle f^{(n)}(x) = -\cos(x)$$ n=4k+3,   (k=0,1,2,.......)


 * }.
 * }.

2. plot $$\displaystyle P_n(x)$$ for n=0, 1, 2, ... 10

 Matlab Code: 

 Plots:  The plots for $$\displaystyle P_n(x)$$ with $$\displaystyle n= 0, 1, 2,. . . 10 $$ are shown below.

3. Find (estimate of max)of R(x) at $$x=\dfrac{\pi}{2}$$

from the equation $$\displaystyle (3)$$
 * {| style="width:70%" border="0" align="center"



R_n(x) = f^{(n+1)}(\xi)\dfrac{(x-\dfrac{\pi}{4})^{n+1}}{(n+1)!} $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (4)


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"



\left | R_n(\dfrac{\pi}{2}) \right |\leqslant \dfrac{(\dfrac{\pi}{2}-\dfrac{\pi}{4})^{n+1}}{(n+1)!} \underbrace{\max \left | f^{(n+1)}(\xi)\right |, \xi \in [0,\dfrac{\pi}{2}]}_{\leqslant 1} = \dfrac{(\dfrac{\pi}{4})^{n+1}}{(n+1)!} $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (5)


 * }.
 * }.

$$\begin{array}{|c||c|c|c|c|c|c|c|c|c|c|c|}\hline n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 \\ \hline R_n(\dfrac{\pi}{2})&\dfrac{(\pi/4)^{1}}{1!}&\dfrac{(\pi/4)^{2}}{2!}&\dfrac{(\pi/4)^{3}}{3!}&\dfrac{(\pi/4)^{4}}{4!}&\dfrac{(\pi/4)^{5}}{5!}&\dfrac{(\pi/4)^{6}}{6!}&\dfrac{(\pi/4)^{7}}{7!}&\dfrac{(\pi/4)^{8}}{8!}&\dfrac{(\pi/4)^{9}}{9!}&\dfrac{(\pi/4)^{10}}{10!}&\dfrac{(\pi/4)^{11}}{11!}\\ \hline &7.854E-01&3.084E-01&8.075E-02&1.585E-02&2.490E-03&3.260E-04&3.658E-05&3.591E-06&3.134E-07&2.461E-08&1.757E-09\\ \hline \end{array} $$.

Author
Solved and Typed by - Egm6341.s10.Team4.yunseok 02:07, 18 February 2010 (UTC) .

= Problem 8: Integration Methods - A Comparison=

Given

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


 * $$\displaystyle f(x)= \frac{e^x-1}{x} $$
 * $$\displaystyle I= \int\limits_{0}^{1}\frac{e^x-1}{x}\, dx $$
 * }
 * }
 * }

Find
Use 3 methods to find $$I_n$$

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

2. Composite Trapezoidal Rule.

3. Composite Simpson Rule.

n=2, 4, 8,. . . until error of order $$10^{-6}$$

Solution
'''1. Taylor series expansion of $$f_n$$. '''

The function $$e^x$$ can be approximated using Taylor series to find that $$e^x=\displaystyle\sum_{j=0}^{\infty}\frac{x^j}{j!}.$$ Inserting this into our function, $$f(x)$$, and simplifying the expression, we find that $$f(x)=\displaystyle\sum_{j=1}^{\infty}\frac{x^{(j-1)}}{j!}.$$ While this form of our function, $$f(x)$$, presents an exact solution, we need to truncate this in order to solve it numerically. Therefore, let $$f_n(x)$$ be our approximation of $$f(x)$$ and let $$f_n(x)=\displaystyle\sum_{j=1}^{n}\frac{x^{(j-1)}}{j!}.$$ While $$f_n(x)$$ can be integrated numerically, it still has some degree of error because it is only an approximation of $$f(x)$$. The error in this approximation can be analyzed by integrating the remainder of $$f_n(x)$$, where $$R \displaystyle\ _{n}(x)=f(x)-f_n(x)=\frac{x^{n}}{(n+1)!}exp(\xi),$$ for $$\displaystyle\ \xi   \epsilon   [0,x] $$.

$$\displaystyle f_n(x)= \sum_{j=1}^n \frac{x^{j-1}}{j!}$$

$$\displaystyle I_n= \int\limits_{0}^{1}f_n(x)\, dx = \int\limits_{0}^{1} \sum_{j=1}^n \frac{x^{j-1}}{j!}\, dx = \sum_{j=1}^n \frac{1}{j j!}$$

The erroer$$\displaystyle (E_n) $$ is

$$\displaystyle E_n= I-I_n = \int\limits_{0}^{1}f(x)-f_n(x)\, dx = \int\limits_{0}^{1} \frac{(x-0)^{n}}{(n+1)!} \frac{e^x-1}{x}\, dx \underbrace{=}_{IMVT} \max \left | \frac{e^\xi-1}{\xi} \right |\int\limits_{0}^{1} \frac{x^{n}}{(n+1)!} dx, \xi \in [0,1] \leqslant \frac{e-1}{(n+1)(n+1)!}$$

$$\displaystyle E_8 \leqslant 5.327\times10^{-6}$$

So, $$\displaystyle I_8 = \sum_{j=1}^7 \frac{1}{j j!} = 1.3179018$$

'''2. Composite Trapezoidal Rule. '''

The trapezoidal rule is a method of numerical integration that uses linear interpolation between two points in order to calculate the area under a given curve, $$f(x)$$.

For two points on a curve, where x=a,b. The trapezoidal rule can be expressed as $$\displaystyle\ I_1=\int_a^b f_n(x)dx =\frac{b-a}{2}(f(a)+f(b)).$$

For n+1 number of points, the domain of $$ \displaystyle\ x \epsilon [a,b] $$ can be broken up into n segments of equal length, h, and the trapezoidal rule works out such that $$ \displaystyle\ I_n=\frac{h}{2}(f_0+2f_1+2f_2+...+2f_{n-1}+f_n)$$, where $$\displaystyle\ f_i=f(x_i)$$.

For the case that $$f(x)=\frac{e^x-1}{x}$$, results of this method are shown below.

The error of this case, based on the result of using the Taylor series approximation of f(x) for a large value of n, is also available below.

'''3. Composite Simpson's Rule. '''

Whereas the trapezoidal rule uses a linear method of interpolation, Simpson's Rule uses a 2nd order polynomial to determine the area under a given curve, $$f(x)$$.

For three points on a curve, for x=a, (a+b)/2,b. $$\displaystyle\ I_2=\int_a^b f_n(x)dx =\frac{b-a}{6}(f(a)+4f(\frac{a+b}{2})+f(b))$$.

For n+1 number of points, the domain of $$ \displaystyle\ x \epsilon [a,b]$$ can be broken into n segments of equal length, h, and Simpson's Rule works out such that $$ \displaystyle\ I_n=\frac{h}{6}(f_0+4f_1+2f_2+4f_3+...2f_{n-2}+4f_{n-1}+f_n)$$, where $$ \displaystyle\ f_i=f(x_i)$$.

For the case that $$f(x)=\frac{e^x-1}{x}$$, results of this method are shown below.

The error of this case, based on the result of using the Taylor series approximation of f(x) for a large value of n, is also available below.

 Matlab Code: For $$ E_{n,Taylor} $$ 

.

 Matlab Code: For $$ E_{n,trap} $$ 

.

 Matlab Code: For $$ E_{n,Simpson} $$ 

.

Author
Solved by - --Egm6341.s10.Team4.roni 04:47, 18 February 2010 (UTC)

Egm6341.s10.Team4.riherd 14:53, 18 February 2010 (UTC)

Egm6341.s10.team4.anandankala 13:43, 19 February 2010 (UTC)

Typed by - Egm6341.s10.Team4.riherd 14:53, 18 February 2010 (UTC) .

= Problem: 9 Taylor Series Terms=

Given

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

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \dfrac{e^x}{x}=\dfrac{1}{x}[e^x-1]=:f(x)


 * }
 * }

Find
1) Expand
 * {| style="width:100%" border="0" align="left"

e^x $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

in Taylor series with remainder.

2) Find Taylor series expansion and remainder of f(x).

Solution
Generally, f(x) can be expressed in Taylor series as follows:


 * $$\displaystyle

f(x)=P_n(x)+R_{n+1}(x) $$



\Rightarrow\sum_{i=0}^n \dfrac{(x-x_0)^n}{n!}f^n(x_0)+\dfrac{(x-x_0)^{n+1}}{(n+1)!}f^{n+1}(\gamma) $$



\gamma\in [0,x] $$



\Rightarrow\ e^x=\sum_{i=0}^n \dfrac{x^n}{n!}f^n(0)+\dfrac{x^{n+1}}{(n+1)!}f^{n+1}(\gamma)=\sum_{i=0}^n \dfrac{x^n}{n!}+\dfrac{x^{n+1}}{(n+1)!}e^\gamma $$

Using the first part will lead us to solve second part:



\Rightarrow\ e^x=1+\sum_{i=1}^n \dfrac{x^n}{n!}+\dfrac{x^{n+1}}{(n+1)!}e^\gamma $$



\Rightarrow\ e^x-1=\sum_{i=1}^n \dfrac{x^n}{n!}+\dfrac{x^{n+1}}{(n+1)!}e^\gamma $$



\Rightarrow\ \dfrac{e^x-1}{x}=\sum_{i=1}^n \dfrac{x^{n-1}}{n!}+\dfrac{x^n}{n+1}e^\gamma $$



\gamma\in[0,x] $$

Author
Solved and Typed by - Egm6341.s10.Team4.nimaa&amp;m 02:34, 18 February 2010 (UTC) .

= Problem: 10 Trapezoidal Simple Rule: Lagrange Basis!!=

Given
Use following Integration


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

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \int\limits_{a}^{b} \sum_{i=0}^{n=1} l_i(x)f(x_i)\, dx


 * }
 * }

Find
To obtain


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

I=\dfrac{b-a}{2}(f(a)+f(b)). $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle


 * }
 * }

Solution
First we expand the summation inside the integral:



I=\int\limits_{a}^{b} \sum_{i=0}^{n=1} l_i(x)f(x_i)\, dx = \int\limits_{a}^{b}[l_0(x)f(x_0)+l_1(x)f(x_1)]\, dx $$

From Lagrange basis equation we have:



l_i(x)=\prod_{j=0,j \ne i}^{n=1} \dfrac{x-x_j}{x_i-x_j} $$



\Rightarrow\ l_0(x)= \dfrac{x-x_1}{x_0-x_1}; l_1=\dfrac{x-x_0}{x_1-x_0} $$

Trivially,



x_0=a;   x_1=b $$



\Rightarrow\ I= \int\limits_{a}^{b}[\dfrac{x-b}{a-b}f(a)+\dfrac{x-a}{b-a}f(b)]\, dx $$



\dfrac{1}{b-a} \int\limits_{a}^{b}[(b-x)f(a)+(x-a)f(b)]\, dx $$



=\dfrac{1}{b-a} [\int\limits_{a}^{b}(b-x)f(a)\, dx]+[\int\limits_{a}^{b}(x-a)f(b)\, dx] $$

Now, integration can be easily solved in its interval:



=\dfrac{1}{b-a}[f(a)(bx-\dfrac{x^2}{2})+f(b)(\dfrac{x^2}{2}-ax)]=\dfrac{1}{b-a}[f(a)(\dfrac{b^2}{2}-ab+\dfrac{a^2}{2})+f(b)(\dfrac{b^2}{2}-ab+\dfrac{a^2}{2})] $$



=\dfrac{1}{2(b-a)}[f(a)(b-a)^2+f(b)(b-a)^2]=\dfrac{b-a}{2}[f(a)+f(b)] $$

So,


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

$$\displaystyle \Rightarrow I = \dfrac{b-a}{2}[f(a)+f(b)] $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |


 * style= |


 * }.
 * }.

Author
Solved and Typed by - Egm6341.s10.Team4.nimaa&amp;m 02:35, 18 February 2010 (UTC) .

=Problem 11: Simpson's Rule - Simple=

Given
From Lagrange basis equation we have:
 * {| style="width:70%" border="0" align="center"




 * $$l_i= \displaystyle\prod_{\underset{j\neq i}{j=0}}^{2}\frac{x-x_j}{x_i-x_j}$$
 * }.
 * }.

Find
Show that,


 * {| style="width:70%" border="0" align="center"




 * $$p_2(x_j)= \displaystyle\sum_{i=0}^{2} \underbrace{l_i(x_j)}_{\delta_{ij}}f(x_i)= f(x_j)$$
 * }.
 * }.

Solution

 * {| style="width:70%" border="0" align="center"




 * $$\underset{i=0}{l_0}= \displaystyle\prod_{\underset{j\neq i}{j=0}}^{2}\frac{x-x_j}{x_i-x_j}= \frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\underset{i=1}{l_1}= \displaystyle\prod_{\underset{j\neq i}{j=0}}^{2}\frac{x-x_j}{x_i-x_j}= \frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\underset{i=2}{l_2}= \displaystyle\prod_{\underset{j\neq i}{j=0}}^{2}\frac{x-x_j}{x_i-x_j}= \frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)}$$
 * }.
 * }.

@x=x0
 * {| style="width:70%" border="0" align="center"




 * $$l_0= \frac{(x_0-x_1)(x_0-x_2)}{(x_0-x_1)(x_0-x_2)}= 1$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$l_1= \frac{ \cancelto{0}{(x_0-x_0)}(x_0-x_2)}{(x_1-x_0)(x_1-x_2)}= 0$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$l_2= \frac{ \cancelto{0}{(x_0-x_0)}(x_0-x_1)}{(x_2-x_0)(x_2-x_1)}= 0$$
 * }.
 * }.

Similarly @x=x1


 * {| style="width:70%" border="0" align="center"




 * $$l_0= \frac{ \cancelto{0}{(x_1-x_1)}(x_1-x_2)}{(x_0-x_1)(x_0-x_2)}= 0$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$l_1= \frac{(x_1-x_0)(x_1-x_2)}{(x_1-x_0)(x_1-x_2)}= 1$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$l_2= \frac{(x_1-x_0) \cancelto{0}{(x_1-x_1)}}{(x_2-x_0)(x_2-x_1)}= 0$$
 * }.
 * }.

Similarly @x=x2


 * {| style="width:70%" border="0" align="center"




 * $$l_0= \frac{(x_2-x_1) \cancelto{0}{(x_2-x_2)}}{(x_0-x_1)(x_0-x_2)}= 0$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$l_1= \frac{(x_2-x_0) \cancelto{0}{(x_2-x_2)}}{(x_1-x_0)(x_1-x_2)}= 0$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$l_2= \frac{(x_2-x_0)(x_2-x_1)}{(x_2-x_0)(x_2-x_1)}= 1$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$ p_2 (j=0)_{x=x_0}= l_0.f(x_0)+\cancelto{0}{l_1}.f(x_1)+\cancelto{0}{l_2}.f(x_2)= 1.f(x_0)= f(x_j)$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$ p_2 (j=1)_{x=x_1}= \cancelto{0}{l_0}.f(x_0)+l_1.f(x_1)+\cancelto{0}{l_2}.f(x_2)= 1.f(x_1)= f(x_j)$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$ p_2 (j=2)_{x=x_2}= \cancelto{0}{l_0}.f(x_0)+\cancelto{0}{l_1}.f(x_1)+l_2.f(x_2)= 1.f(x_2)= f(x_j)$$
 * }.
 * }.

Hence proved.

Author
Solved by - --Egm6341.s10.Team4.roni 04:54, 18 February 2010 (UTC)

Typed by - Egm6341.s10.Team4.riherd 14:53, 18 February 2010 (UTC)

Egm6341.s10.team4.anandankala 13:43, 19 February 2010 (UTC) .

= Contributing Team Members =

Egm6341.s10.Team4.andy 22:03, 17 February 2010 (UTC) - Author of Problems:4, 5 ; Proof Read: 1,2,3,9,10,11

Egm6341.s10.Team4.riherd 1:48, 25 January 2010 (UTC) - Author of Problems 8, 11

Egm6341.s10.Team4.nimaa&amp;m 13:54, 19 February 2010 (UTC) 10:50, 26 January 2010 (UTC) - Author of Problems: 6, 9, 10

Egm6341.s10.Team4.yunseok 08:43, 25 January 2010 (UTC) Author of Problems:7

Egm6341.s10.Team4.roni 05:10, 26 January 2010 (UTC) - Author of Problems:1,2,3,8,11 ; Proof Read: 1,2,3,4,5,7,8,9,10,11

Egm6341.s10.team4.anandankala 12:05, 27 January 2010 (UTC)- Author of problems:4,8,11; Proof Read: 2,3,5,6.