User:Egm6341.s10.Team4.andy/HW4-1

= Problem 1: Higher Order Corrected Trapezoidal Rule =

Given
Refer Lecture slide 20-1 for problem statement.

Error for Higher Order Error for Trapezoidal rule on slide 18-2, is given by:


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

$$ $$
 * $$\displaystyle E_n^1 := I - I_n
 * $$\displaystyle E_n^1 := I - I_n
 * $$\displaystyle \longrightarrow (1)
 * }.
 * }.

where $$\displaystyle I_n = T(n) $$ is the Composite Trapezoidal approximation of the Integral $$\displaystyle I = \int_{a}^{b} f(x)dx $$ with $$\displaystyle n $$ intervals and $$\displaystyle n+1 $$ points $$\displaystyle \forall x \in [a,b] $$.


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

T(n)=\frac{h}{2}(f_0+2f_1+2f_2+ \cdots +2f_{n-1}+f_n) $$ $$
 * $$ \displaystyle\
 * $$ \displaystyle\
 * $$\displaystyle \longrightarrow (2)
 * }.
 * }.

where $$\displaystyle\ f_i=f(x_i)$$.

Equation (1) is a Euler-Maclaurin series given by Refer 18-3:


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

$$ $$
 * $$\displaystyle E_n^1 = \sum_{q=1}^{\infty} a_q h^{2q}
 * $$\displaystyle E_n^1 = \sum_{q=1}^{\infty} a_q h^{2q}
 * $$\displaystyle \longrightarrow (3)
 * }.
 * }.

where $$\displaystyle h = \frac{b-a}{n} $$.

Find
1. To develop a general higher order corrected Trapezoidal Rule.

2. To find $$\displaystyle n, I_n, E_n^1 $$ using $$\displaystyle CT_1, CT_2, CT_3 $$ for which $$\displaystyle I - I_n $$ is of the order $$\displaystyle \Theta(10^{-6}) $$ for $$\displaystyle I = \int_{0}^{1} \frac{e^x-1}{x}dx $$.

Solution
1. To develop a general Higher Order Corrected Trapezoidal Rule:

Equation (3),


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

\begin{align} E_n^1 &= \sum_{q=1}^{\infty} a_q h^{2q} \\ \Rightarrow     E_n^1 &= I - T(n) = \sum_{q=1}^{\infty} a_q h^{2q} &= I - T(n) = a_1h^{2} + \sum_{q=2}^{\infty} a_q h^{2q} \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.


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

\begin{align} \Rightarrow     E_n^1 &= I - \left[\underbrace{T(n) - a_1h^{2}}_{CT_1}\right] = \sum_{q=2}^{\infty} a_q h^{2q} \\ &= I - CT_1(n) = a_2h^{4} + \sum_{q=3}^{\infty} a_q h^{2q} \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.


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

\begin{align} \Rightarrow     E_n^1 &= I - \left[\underbrace{CT_1 + a_2h^{4}}_{CT_2}\right] = \sum_{q=3}^{\infty} a_q h^{2q} \\ &= I - CT_2(n) = a_3h^{6} + \sum_{q=4}^{\infty} a_q h^{2q} \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.


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

\begin{align} \Rightarrow     E_n^1 &= I - \left[\underbrace{CT_2 + a_3h^{6}}_{CT_3}\right] = \sum_{q=4}^{\infty} a_q h^{2q} \\ &= I - CT_3(n) = a_4h^{8} + \sum_{q=5}^{\infty} a_q h^{2q} \\ &.\\ &.\\ &.\\ &.\\ &.\\ \Rightarrow     E_n^1 &= I - \left[\underbrace{CT_{(k-1)} + a_kh^{2k}}_{CT_k}\right] = \sum_{q=(k+1)}^{\infty} a_q h^{2q} \\ &= I - \underbrace{CT_k(n)}_{I_n} = a_{(k+1)}h^{2(k+1)} + \sum_{q=k+2}^{\infty} a_q h^{2q} \\
 * $$\displaystyle
 * $$\displaystyle

\end{align} $$
 * }.
 * }.

Hence the Higher Order Corrected Trapezoidal rule is given by,


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

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

\Rightarrow     I_n = CT_k(n) = CT_{(k-1)}(n) + a_kh^{2k}

$$ $$
 * style= |
 * $$\displaystyle \longrightarrow (4)


 * }.
 * }.

2. To find $$\displaystyle I_n $$ using $$\displaystyle CT_1, CT_2, CT_3 $$:

From Equation (4), $$\displaystyle I_n $$ using $$\displaystyle CT_1, CT_2, CT_3 $$ can be given by:


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



\begin{align} \Rightarrow     I_n &= CT_3 \\ &= CT_2 + a_3h^{6}\\ &= CT_1 + a_2h^{4} + a_3h^{6}\\ &= T(n) + a_1h^{2} + a_2h^{4} + a_3h^{6} \end{align} $$
 * $$\displaystyle


 * }.
 * }.

Here,


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



\begin{align} a_i &= d_i \left[ f^{(2i-1)}(b) - f^{(2i-1)}(a)\right]\\ d_i &= - \frac{B_{2i}}{2i}; \ \ \ B_{2i} \rightarrow Bernoulli\ Numbers;\ \ \ d_1 = \frac{-1}{12}; \ \ \ d_2 = \frac{1}{720}; \ \ \ d_3 = \frac{-1}{30240} \end{align}
 * $$\displaystyle

$$


 * }.
 * }.

At $$\displaystyle n = 8$$, the Error is reduced to an order of $$\displaystyle \Theta(10^{-6}) $$.



 Matlab Code: 

Author
Solved and typed by - Reviewed by -

= Problem 7: Theorem of Higher Order Error for Trap. rule [Step:2a - Part2] =

Given
Refer Lecture Slide Refer 21-2 for problem statement.

Higher Order Error for Trap. rule is given by [ Refer 21-1 ]:


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

E_n^1=\frac{h}{2} \sum_{k=0}^{n-1} \left[ \underbrace{\int_{-1}^{1}g_k(t)dt-(g_k(-1)+g_k(+1))}_{E}\right] $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)
 * }.
 * }.

where $$\displaystyle E $$ can be written as,


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

E =\int_{-1}^{1}(-t)g^{(1)}(t)dt $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)
 * }.
 * }.

Find
Show that,


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

$$\displaystyle E =\int_{-1}^{1}\underbrace{(-t)}_{p_{1}(t)}g^{(1)}(t)dt = \left[p_2(t)g^{(1)}(t) \right]_{-1}^{+1} - \int_{-1}^{+1}p_2(t)g^{(2)}(t)dt $$

$$
 * $$\displaystyle \longrightarrow (3)
 * }.
 * }.

where $$\displaystyle p_2(t) = \int p_1(t)dt$$.

Solution
Integrating by Parts,


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

\int u dv = uv - \int v du $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

where,


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

$$\displaystyle \begin{align} u &= g^{(1)}(t) \\ \Rightarrow du &= g^{(2)}(t)dt \end{align} $$


 * }.
 * }.

and,


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

$$\displaystyle \begin{align} dv &= p_1(t)dt \\ &= -tdt \\ & \\ \Rightarrow v &= \int p_1(t)dt &=p_2(t) \end{align} $$


 * }.
 * }.

Equation (3) is then,


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

$$\displaystyle \begin{align} \Rightarrow E &=\int_{-1}^{1}\underbrace{(-t)}_{p_{1}(t)}g^{(1)}(t)dt \\ &= \left[p_2(t)g^{(1)}(t) \right]_{-1}^{+1} - \int_{-1}^{+1}p_2(t)g^{(2)}(t)dt \end{align} $$


 * }.
 * }.

Author
Solved and typed by - Reviewed by -