User:Egm6341.s10.Team4.andy/HW2

= Problem 1: Lagrange Basis Approximation =

Given
Refer Lecture slide 9-1 for problem statement.

From Lecture slide 8-3,


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



p_2(x) = c_2 x^2 + c_1 x + c_0 $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)


 * }.
 * }.

Find
We need to approximate Equation (1) using,


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



p_2(x) = \sum_{i=0}^{2} l_i(x_j)f(x_i) $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)


 * }.
 * }.

where,


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



l_i(x) = \prod_{j=0,i \ne j}^{2} \frac{x-x_j}{x_i-x_j} $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (3)


 * }.
 * }.

and find $$\displaystyle c_0, c_1 \ and\ c_2 $$ in terms of the given points,


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



(x_i,f(x_i)), \ i = 0,1,2 $$
 * $$\displaystyle


 * }.
 * }.

Solution
Equation (3) is given by the following 3 Equations,


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



l_0(x) = \frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)} $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (4)


 * }.
 * }.


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



l_1(x) = \frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)} $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (5)


 * }.
 * }.


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



l_2(x) = \frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)} $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (6)


 * }.
 * }.

Substituting Equations (4), (5) and (6) in (2),


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



p_2(x) = \frac{(x^2-(x_1+x_2)x+x_1x_2)}{(x_0-x_1)(x_0-x_2)} f(x_0) + \frac{(x^2-(x_0+x_2)x+x_0x_2)}{(x_1-x_0)(x_1-x_2)} f(x_1) + \frac{(x^2-(x_0+x_1)x+x_0x_1)}{(x_2-x_0)(x_2-x_1)} f(x_2) $$
 * $$\displaystyle


 * }.
 * }.

Rearranging,


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



\begin{align} \Rightarrow p_2(x) =  & x^2 \underbrace{\left [\frac{f(x_0)}{(x_0-x_1)(x_0-x_2)}  + \frac{f(x_1)}{(x_1-x_0)(x_1-x_2)}  + \frac{f(x_2)}{(x_2-x_0)(x_2-x_1)} \right]}_{c_2} +  \\ & x \underbrace{\left [\frac{-f(x_0)(x_1+x_2)}{(x_0-x_1)(x_0-x_2)}  + \frac{-f(x_1)(x_0+x_2)}{(x_1-x_0)(x_1-x_2)}  + \frac{-f(x_2)(x_0+x_1)}{(x_2-x_0)(x_2-x_1)} \right]}_{c_1}+ \\ & \underbrace{\left [\frac{f(x_0)(x_1x_2)}{(x_0-x_1)(x_0-x_2)} + \frac{f(x_1)(x_0x_2)}{(x_1-x_0)(x_1-x_2)}  + \frac{f(x_2)(x_0x_1)}{(x_2-x_0)(x_2-x_1)} \right]}_{c_0}
 * $$\displaystyle

\end{align} $$


 * }.
 * }.

So,


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

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

\Rightarrow c_0 = \frac{f(x_0)(x_1x_2)}{(x_0-x_1)(x_0-x_2)}  + \frac{f(x_1)(x_0x_2)}{(x_1-x_0)(x_1-x_2)}  + \frac{f(x_2)(x_0x_1)}{(x_2-x_0)(x_2-x_1)}

$$


 * style= |


 * }.
 * }.


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

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

\Rightarrow c_1 = \frac{-f(x_0)(x_1+x_2)}{(x_0-x_1)(x_0-x_2)} + \frac{-f(x_1)(x_0+x_2)}{(x_1-x_0)(x_1-x_2)}  + \frac{-f(x_2)(x_0+x_1)}{(x_2-x_0)(x_2-x_1)}

$$
 * style= |
 * }.
 * }.


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

$$\displaystyle \Rightarrow c_2 = \frac{f(x_0)}{(x_0-x_1)(x_0-x_2)} + \frac{f(x_1)}{(x_1-x_0)(x_1-x_2)}  + \frac{f(x_2)}{(x_2-x_0)(x_2-x_1)} $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.
 * }.

= Problem 7: Lagrange Error Term =

Given
Refer Lecture slide 12-3 for problem statement.

From Equation 4 of Lecture slide 10-1,


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



q_{n+1}(x) := (x - x_0)(x - x_1)(x - x_2)(x - x_3)\cdots(x - x_n) $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)


 * }.
 * }.

Find
Show that the $$\displaystyle (n+1)^{th} $$ derivative of $$\displaystyle q_{n+1}(x) $$ is $$\displaystyle (n+1)! $$, i.e.,


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



q_{n+1}^{(n+1)}(x) = (n+1)! $$
 * $$\displaystyle


 * }.
 * }.

Solution
Clearly from Equation (1),


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



q_{n+1}(x) \in \mathcal{P}_{n+1} $$
 * $$\displaystyle


 * }.
 * }.

where $$\displaystyle \mathcal{P}_{n+1} $$ is a set of polynomials of order $$\displaystyle n+1 $$.

So, Equation (1) can be written as,


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



q_{n+1}(x) = a_{n+1} x^{n+1} + a_{n} x^{n} + a_{n-1} x^{n-1} + \cdots + a_{0} x^{0} $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)


 * }.
 * }.

Please note that $$\displaystyle a_{n+1} = 1 $$ in Equation (2).

On differentiating Equation (2), 1 time,


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



q_{n+1}^{1}(x) = (n+1) x^{n} + na_{n} x^{n-1} + (n-1)a_{n-1} x^{n-2} + \cdots + a_{1} $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (3)


 * }.
 * }.

On differentiating Equation (2), 2 times,


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



q_{n+1}^{2}(x) = (n+1)(n) x^{n-1} + n(n-1)a_{n} x^{n-2} + (n-1)(n-2)a_{n-1} x^{n-3} + \cdots + 2a_{2} $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (4)


 * }.
 * }.

On differentiating Equation (2), n times,


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



q_{n+1}^{n}(x) = (n+1)(n)\cdots(2) x^{1} + n(n-1)\cdots(2)a_{n}x^0 $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (5)


 * }.
 * }.

This can be realized by induction [in Equation (3), the constant term is $$\displaystyle a_1 $$ after differentiating 1 time; the constant term is $$\displaystyle 2a_2 $$ after differentiating 2 times;].

Differentiating Equation (5) one more time,


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



\begin{align} \Rightarrow q_{n+1}^{(n+1)}(x) &= (n+1)(n)\cdots(2)(1) \cancelto{1}{x^{1}} + n(n-1)\cdots(2)a_{n}\cancelto{0}{x^0} \\ &= (n+1)(n)\cdots(2)(1) \end{align} $$
 * $$\displaystyle


 * }.
 * }.

So,


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

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

\Rightarrow q_{n+1}^{(n+1)}(x) = (n+1)!

$$


 * style= |


 * }.
 * }.

= Problem 13: Error in Integration =

Given
Refer Lecture slide 15-2 for problem statement

From Lecture slide 15-1,


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



G^{1}(t) = e^{1}(t) - 5t^4e(1) $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)


 * }
 * }

where,


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



e(t) := \alpha(t) - \alpha_{2}(t) $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)


 * }
 * }

where $$\displaystyle \alpha(t), \alpha_{2}(t) $$ are given by,


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



\alpha(t) := \int_{-t}^{t}F(t)dt $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (3)


 * }
 * }


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



\alpha^{2}(t) := \frac{t}{3} \left[F(-t) + 4F(0)+ F(t)\right] $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (4)


 * }
 * }

and,


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



F(t) := f(x(t)) $$ $$
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (5)


 * }.
 * }.

Find
Show that,


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



G^{2}(0) = 0 $$
 * $$\displaystyle


 * }.
 * }.

Solution
On differentiating Equation (3),


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



\alpha^{1}(t) = F(-t) + F(t) $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (6)

.
 * }
 * }

Again differentiating Equation (6),


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



\alpha^{2}(t) = -F(-t) + F(t) $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (7)

.
 * }
 * }

On differentiating Equation (4),
 * {| style="width:90%" border="0" align="center"



\begin{align} \Rightarrow \alpha_{2}^{1}(t) &= \frac{1}{3} \left[ F(-t) + 4F(0) + F(t) \right] + \frac{t}{3} \left[-F^{1}(-t) + \cancelto{0}{4F^{1}(0)} + F^{1}(t)\right] \\ &= \frac{1}{3} \left[ F(-t) + 4F(0) + F(t) \right] + \frac{t}{3} \left[-F^{1}(-t) + F^{1}(t)\right] \end{align} $$
 * $$\displaystyle


 * }.
 * }.

Again on differentiating the above equation,


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



\begin{align} \Rightarrow \alpha_{2}^{2}(t) &= \frac{1}{3} \left[ -F^{1}(-t) + \cancelto{0}{4F^{1}(0)} + F^{1}(t) \right] + \frac{1}{3} \left[-F^{1}(-t) + F^{1}(t)\right] + \frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right]\\ &= \frac{2}{3} \left[ -F^{1}(-t) + F^{1}(t) \right] + \frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right] \end{align} $$
 * $$\displaystyle


 * }.
 * }.

So,


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




 * $$\displaystyle

\Rightarrow \alpha_{2}^{2}(t) = -\frac{2}{3} F^{1}(-t) + \frac{2}{3} F^{1}(t) + \frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right]

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


 * }.
 * }.

On differentiating Equation (1) we get,


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



G^{2}(t) = e^{2}(t) - 20t^3e(1) $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (9)


 * }.
 * }.

At point $$\displaystyle t = 0 $$,


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



G^{2}(0) = e^{2}(0) - \cancelto{0}{20(t)^3e(1)} \Rightarrow G^{2}(0) = e^{2}(0) $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (10)


 * }.
 * }.

$$\displaystyle e^{2}(t) $$ is given by differentiating Equation (2) twice,


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



e^{2}(t) = \alpha^{2}(t) - \alpha_{2}^{2}(t) $$ $$
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle \longrightarrow (11)


 * }.
 * }.

Substituting Equations (7) and (8) in (11),


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



\Rightarrow e^{2}(t) = -F(-t) + F(t) +\frac{2}{3} F^{1}(-t) - \frac{2}{3} F^{1}(t) - \frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right] $$
 * $$\displaystyle


 * }.
 * }.

At point $$\displaystyle t = 0 $$,


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



\begin{align} \Rightarrow e^{2}(0) &= -F(-0) + F(0) +\frac{2}{3} F^{1}(-0) - \frac{2}{3} F^{1}(0) - \cancelto{0}{\frac{t}{3} \left[F^{2}(-t) + F^{2}(t)\right]} \\ &= -\frac{1}{3} F^{1}(-0) + \frac{1}{3} F^{1}(0) \\ &= \frac{1}{3} \left[ -F^{1}(0) + F^{1}(0) \right] \end{align} $$
 * $$\displaystyle


 * }.
 * }.

So,


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




 * $$\displaystyle

\Rightarrow e^{2}(0) = 0

$$


 * }.
 * }.

which means from Equation (10),


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

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

\Rightarrow G^{2}(0) = 0

$$


 * style= |


 * }.
 * }.