User:Egm6341.s10.team3.sa/HW3

HW Poblem Set 3 = Proof the error bound for Simple Simpson' Rule = Ref: Lecture Notes [[media:Egm6341.s10.mtg17.djvu|p.17-1]]

Problem Statement
 Part 1  Replicate the proof of tighter error bound for Simple Simpson for two cases:
 * {| style="width:100%" border="0" align="left"

a) G(t) = e(t) - t^{4}e(1) $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

b) G(t) = e(t) - t^{6}e(1) $$ Point out where proof breaks down  Part 2  $$ \displaystyle G(t) = e(t) - t^{6}e(1) $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

Find $$ \displaystyle G^{(3)}(0) $$ and follow same steps in proof and see what happens

Solution
 Part 1 

a) For case 1
 * {| style="width:100%" border="0" align="left"

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

From (3) in lecture[[media:Egm6341.s10.mtg14.pdf|p.14-2]]we have
 * {| style="width:100%" border="0" align="left"

e(t) = \int_{+t}^{-t}F(t)\, dt-\frac{t}{3}[F(-t)+4f(0)+F(t)] $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }


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

e(0)= \int_{0}^{0}f(x)\, dx -\frac{0}{3}[F(-0)+4f(0)+F(0)]=0 $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

G(0) = e(0) - 0^{4}e(1)=0 $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }


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

G(1) = e(1) - 1^{4}e(1)= 0 $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

According to Rolle' thm,
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _1 \ni ]0,1[,  G^{(1)}(\zeta _1) = 0   $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }


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

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


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

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


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

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


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

G^{(1)}(0) = e^{(1)}(0) - 4(0^{3})e(1)= 0 $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

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

G^{(1)}(\zeta _1) = 0  $$ Thus According to Rolle' thm,
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _2 \ni ]0,\zeta _1[,  G^{(2)}(\zeta _2) = 0   $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

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

G^{(2)}(t) = e^{(2)}(t) - 12t^{2}e(1) $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }


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

G^{(2)}(0) = e^{(2)}(0) - 12(0^{2})e(1) = e^{(2)}(0)  $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

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

e^{(2)}(t) &= \frac{2}{3}[-F^{(1)}(-t)+F^{(1)}(t)] - \frac{1}{3}[-F^{(1)}(-t)+F^{(1)}(t)]-\frac{1}{3}[F^{(2)}(-t)+F^{(2)}(t)]\\ &=\frac{1}{3}[-F^{(1)}(-t)+F^{(1)}(t)]-\frac{t}{3}[F^{(2)}(-t)+F^{(2)}(t)]\\ \end{align} $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

e^{(2)}(0) = \frac{1}{3}[-F^{(1)}(-0)+F^{(1)}(0)]-\frac{0}{3}[F^{(2)}(-0)+F^{(2)}(0)]=0 $$ Thus
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * }
 * {| style="width:100%" border="0" align="left"

G^{(2)}(0) = e^{(2)}(0)=0   $$ Recall
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

G^{(2)}(\zeta _2) = 0  $$ Thus According to Rolle' thm,
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _3 \ni ]0,\zeta _2[,  G^{(3)}(\zeta _3) = 0   $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

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

G^{(3)}(t) = e^{(3)}(t) - 24te(1) $$ Where
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

e^{(3)}(t) = -\frac{t}{3}[F^{(3)}(t)+F^{(3)}(-t)] $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * }


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

G^{(3)}(\zeta_3) & = -\frac{\zeta_3}{3}\underbrace{[F^{(3)}(\zeta_3)+F^{(3)}(-zeta_3)]}_{use DMVT}- 24\zeta_3e(1)\\ &=-\frac{\zeta_3}{3}[2\zeta_3F^{(4)}(\zeta_4)]- 24\zeta_3e(1)\\ &=0 \end{align} $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}

$$
 * $$\displaystyle (Eq. 1)
 * }
 * }

Where $$\zeta _{4} \in [-\zeta _{3}, \zeta _{3}]$$ Since $$\zeta _{3} \neq 0, $$

Solve for


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

$$\displaystyle e(1)= -\frac{\zeta_3}{36}F^{(4)}(\zeta_4) $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * }
 * }

From the relation ship between $$\zeta_4 and \xi $$ See HW2, No 15 for details

$$ \displaystyle F(t)=f(x(t)) $$

$$ \displaystyle x(t)=x_{1}+ht $$

$$ \displaystyle F^{(4)}(t) = \frac{d\left(F(t)^{(3)}\right)}{dt} = \frac{d\left(h^{3}f(x)^{(3)}\right)}{dx}\frac{dx}{dt} = h^{3}f^{(4)}(x) \times h = h^{4}f^{(4)}(x) $$

Let

$$ \displaystyle \xi = x_{1}+h \zeta_{4} $$


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

$$\displaystyle e(1)= -\frac{\zeta_3}{36}h^{4}f^{(4)}(\xi )=-\frac{\zeta_3(b-a)^{4}}{576}f^{(4)}(\xi )
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |

$$ We know the Error for Simple Simpson's rule from lecture[[media:Egm6341.s10.mtg14.pdf|p.14-2]] $$ \displaystyle
 * style = |
 * }
 * }

E_{2} = I - I_2 = \frac{b-a}{2}e(1) = h e(1) $$

Thus the error is
 * {| style="width:100%" border="0" align="left"

$$\displaystyle E_{2} = h e(1)=-\frac{\zeta_3(b-a)^{5}}{1152}f^{(4)}(\xi )
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |

$$
 * style = |
 * }
 * }

Sum: the proof breaks though at Eq 1, where we can not cancel $${\zeta_3}^2$$, because the third derivative of G(t) at $$\zeta_3$$ gives $$\zeta_3 e(1)$$ instead of $${\zeta_3}^2 e(1)$$

b) For case 2
 * {| style="width:100%" border="0" align="left"

G(t) = e(t) - t^{6}e(1) $$ The proof procedure is similar to case 1 <\br> From (3) in lecture[[media:Egm6341.s10.mtg14.pdf|p.14-2]]we have
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

e(t) = \int_{+t}^{-t}F(t)\, dt-\frac{t}{3}[F(-t)+4f(0)+F(t)] $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }


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

e(0)= \int_{0}^{0}f(x)\, dx -\frac{0}{3}[F(-0)+4f(0)+F(0)]=0 $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

G(0) = e(0) - 0^{6}e(1)=0 $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }


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

G(1) = e(1) - 1^{6}e(1)= 0 $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

According to Rolle' thm,
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _1 \ni ]0,1[,  G^{(1)}(\zeta _1) = 0   $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }


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

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


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

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


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

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


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

G^{(1)}(0) = e^{(1)}(0) - 6(0^{5})e(1)= 0 $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

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

G^{(1)}(\zeta _1) = 0  $$ Thus According to Rolle' thm,
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _2 \ni ]0,\zeta _1[,  G^{(2)}(\zeta _2) = 0   $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

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

G^{(2)}(t) = e^{(2)}(t) - 30t^{3}e(1) $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }


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

G^{(2)}(0) = e^{(2)}(0) - 30(0^{4})e(1) = e^{(2)}(0)  $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

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

e^{(2)}(t) &= \frac{2}{3}[-F^{(1)}(-t)+F^{(1)}(t)] - \frac{1}{3}[-F^{(1)}(-t)+F^{(1)}(t)]-\frac{1}{3}[F^{(2)}(-t)+F^{(2)}(t)]\\ &=\frac{1}{3}[-F^{(1)}(-t)+F^{(1)}(t)]-\frac{t}{3}[F^{(2)}(-t)+F^{(2)}(t)]\\ \end{align} $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

e^{(2)}(0) = \frac{1}{3}[-F^{(1)}(-0)+F^{(1)}(0)]-\frac{0}{3}[F^{(2)}(-0)+F^{(2)}(0)]=0 $$ Thus
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * }
 * {| style="width:100%" border="0" align="left"

G^{(2)}(0) = e^{(2)}(0)=0   $$ Recall
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

G^{(2)}(\zeta _2) = 0  $$ Thus According to Rolle' thm,
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _3 \ni ]0,\zeta _2[,  G^{(3)}(\zeta _3) = 0   $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

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

G^{(3)}(t) = e^{(3)}(t) - 120t^{3}e(1) $$ Where
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

e^{(3)}(t) = -\frac{t}{3}[F^{(3)}(t)+F^{(3)}(-t)] $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * }


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

G^{(3)}(\zeta_3) & = -\frac{\zeta_3}{3}\underbrace{[F^{(3)}(\zeta_3)+F^{(3)}(-\zeta_3)]}_{use DMVT}- 120{\zeta_3}^{3}e(1)\\ &=-\frac{\zeta_3}{3}[2\zeta_3F^{(4)}(\zeta_4)]- 120{\zeta_3}^{3}e(1)\\ &=0 \end{align} $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}

$$
 * $$\displaystyle (Eq. 2)
 * }
 * }

Where $$\zeta _{4} \in [-\zeta _{3}, \zeta _{3}]$$ Since $$\zeta _{3} \neq 0, $$

Solve for


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

$$\displaystyle e(1)= -\frac{1}{180\zeta_3}F^{(4)}(\zeta_4) $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * }
 * }

From the relation ship between $$\zeta_4 and \xi $$ See HW2, No 15 for details

$$ \displaystyle F(t)=f(x(t)) $$

$$ \displaystyle x(t)=x_{1}+ht $$

$$ \displaystyle F^{(4)}(t) = \frac{d\left(F(t)^{(3)}\right)}{dt} = \frac{d\left(h^{3}f(x)^{(3)}\right)}{dx}\frac{dx}{dt} = h^{3}f^{(4)}(x) \times h = h^{4}f^{(4)}(x) $$

Let

$$ \displaystyle \xi = x_{1}+h \zeta_{4} $$


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

$$\displaystyle e(1)= -\frac{1}{180\zeta_3}h^4F^{(4)}(\xi)= -\frac{(b-a)^4}{2880\zeta_3}F^{(4)}(\xi)
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |

$$
 * style = |
 * }
 * }

We know the Error for Simple Simpson's rule from lecture[[media:Egm6341.s10.mtg14.pdf|p.14-2]] $$ \displaystyle

E_{2} = I - I_2 = \frac{b-a}{2}e(1) = h e(1) $$

Thus the error is
 * {| style="width:100%" border="0" align="left"

$$\displaystyle E_{2} = h e(1)= -\frac{(b-a)^4}{2880\zeta_3}hF^{(4)}(\xi)=-\frac{(b-a)^5}{5760\zeta_3}F^{(4)}(\xi)
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |

$$
 * style = |
 * }
 * }

Sum: the proof breaks though at Eq 2, where we can not cancel $${\zeta_3}^2$$, but the third derivative of G(t) at $$\zeta_3$$ gives $${\zeta_3}^3 e(1)$$ instead of $${\zeta_3}^2 e(1)$$

 Part 2  Continue the proof from lecture [[media:Egm6341.s10.mtg15.djvu|Lecture p.15-2]] where we have
 * {| style="width:100%" border="0" align="left"

G^{(3)}(t) = e^{(3)}(t) - 60t^{2}e(1) $$
 * $$ \displaystyle
 * $$ \displaystyle

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


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

G^{(3)}(\zeta _3)=0 $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

e^{(3)}= \frac{t}{3}[F^{(3)}(t)-F^{(3)}(-t)] $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * $$\displaystyle (Eq. 4)
 * }
 * }

From Eq 3. and Eq 4, we have


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

G^{(3)}(t) = \frac{t}{3}[F^{(3)}(t)-F^{(3)}(-t)] - 60t^{2}e(1) $$ Thus
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

$$\displaystyle G^{(3)}(0) = \frac{0}{3}[F^{(3)}(0)-F^{(3)}(-0)] - 60(0)^{2}e(1) = 0 $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * }
 * }

Again, according to Rolle's thm,
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _4 \ni ]0,\zeta _3[,  G^{(4)}(\zeta _4) = 0   $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

Next is to find the 4th derivative of G(t), we calculate the 4th derivative of e(t) first
 * {| style="width:100%" border="0" align="left"

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

The 4th derivative of G(t) is given as:
 * {| style="width:100%" border="0" align="left"

G^{(4)}(t) & = e^{(4)}(t) - 120te(1) \\ & = -\frac{1}{3}[F^{(3)}(t)-F^{(3)}(-t)]-\frac{t}{3}[F^{(4)}(t)+F^{(4)}(-t)] - 120te(1)\\ \end{align} $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * }
 * }


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

G^{(4)}(\zeta _{4}) &= -\frac{1}{3}\underbrace{[F^{(3)}(\zeta _{4})-F^{(3)}(-\zeta _{4})]}_{use DMVT}-\frac{\zeta _{4}}{3}[F^{(4)}(\xi_4)+F^{(4)}(-\xi_4)] - 120\xi_4e(1)\\ &=-\frac{1}{3}[2\zeta _{4}F^{(4)}(\xi_5)]-\frac{\zeta _{4}}{3}[F^{(4)}(\xi_4)+F^{(4)}(-\xi_4)]-120\zeta _{4}e(1)\\ &=0 \end{align}$$ Where $$\zeta _{5} \in [-\zeta _{4}, \zeta _{4}]$$ Since $$\zeta _{4} \neq 0, $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * }
 * }

Solve for


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

$$\displaystyle e(1)= -\frac{1}{360}[2F^{(4)}(\zeta _{5})+F^{(4)}(\zeta _{4})+F^{(4)}(-\zeta _{4})] $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * }
 * }

Since

$$ \displaystyle F(t)=f(x(t)) $$

$$ \displaystyle x(t)=x_{1}+ht $$

$$ \displaystyle F^{(4)}(t) = \frac{d\left(F(t)^{(3)}\right)}{dt} = \frac{d\left(h^{3}f(x)^{(3)}\right)}{dx}\frac{dx}{dt} = h^{3}f^{(4)}(x) \times h = h^{4}f^{(4)}(x) $$

See HW2, No 15 for details 

Let

$$ \displaystyle \xi_1 = x_{1}+h \zeta_{4} $$

$$ \displaystyle \xi_2 = x_{1}+h \zeta_{5} $$


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

$$\displaystyle e(1)= -\frac{1}{360}[2h^{4}f^{(4)}(\xi_2 )+h^{4}f^{(4)}(\xi_1 )+h^{4}f^{(4)}(-\xi_1 )] =-\frac{(b-a)^4}{5760}[2f^{(4)}(\xi_2 )+f^{(4)}(\xi_1 )+f^{(4)}(-\xi_1 )] $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * }
 * }

We know the Error for Simple Simpson's rule from lecture[[media:Egm6341.s10.mtg14.pdf|p.14-2]] $$ \displaystyle

E_{2} = I - I_2 = \frac{b-a}{2}e(1) = h e(1) $$

Thus the error is
 * {| style="width:100%" border="0" align="left"

$$\displaystyle E_{2} = h e(1)= -\frac{(b-a)^5}{11520}[2f^{(4)}(\xi_2 )+f^{(4)}(\xi_1 )+f^{(4)}(-\xi_1 )]
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |

$$
 * style = |
 * }
 * }

Sum: Simple simpson is exact for poly deg less than 3. Because $$f ^4(t) = 0$$, thus $$ E_{2} = 0 $$

-- By Min Zhong 12:43, 17 February 2010 (UTC)

= Error bound for Composite Simpson's Rule=

Problem Statement
$$ \displaystyle Show\, the\, error\, for\, Composite\, Simpson's\, Rule,\, $$

$$ \displaystyle \left| {E}_{n}^{2} \right| \leq \frac{(b-a)^{5}}{2880 n^{4}} M_{4} = \frac{(b-a)h^{4}}{2880} M_{4} $$

$$ \displaystyle Where\,\, M_{4} := max \left| f^{4}(\xi) \right| \,\, and \,\, \xi \in [a,b]$$

Ref: Lecture Notes [[media:Egm6341.s10.mtg17.djvu|p.17-2]]

Solution
Ref: Lecture Notes [[media:Egm6341.s10.mtg16.pdf|p.16-2&3]]

$$ \begin{align} \displaystyle E_{n}^{2} &:= I - I_{n} \\ &=\int_{a}^{b}f(x)dx - \frac{h}{3}[f(x_{0})+4f(x_{1})+2f(x_{2})+...+2f(x_{n-2})+4f(x_{n-1})+f(x_{n})] \\ &=\sum_{i=1}^{n} [ \int_{x_{i-1}}^{x_{i}}f(x)dx - \frac{h}{3}[f(x_{i-1}) + 4f(\frac{(x_{i-1}+x_{i})}{2}) + f(x_{i})] \\\end{align}\ $$

$$ \left| E_{n}^{2} \right| \leq \left| \frac{h^{5}}{90} \underbrace {\sum_{n}^{i=1}max\left(F^{(4)}(\xi )\right)}_{Call \bar{M}_{4}} \right| $$

$$ \displaystyle \xi \in [x_{i-1},x_{i}] $$

Ref: Lecture Notes [[media:Egm6341.s10.mtg14.pdf|p.14-1]]

$$ \Rightarrow M_{4} := max \left| f^{(4)}(\xi)\right| $$

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

$$ \bar{M}_{4} \leq n \times M_{4} $$

$$ \Rightarrow \left| E_{n}^{2} \right| \leq \left| \frac{(b-a)^{5}}{2880n^{5}}nM_{4} \right| = \left| \frac{(b-a)(b-a)^{4}}{2880n^{4}} \right| = \frac{(b-a)h^{4}}{2880}M_{4} $$

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

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

$$\displaystyle \displaystyle \left| {E}_{n}^{2} \right| \leq \frac{(b-a)^{5}}{2880 n^{4}} M_{4} = \frac{(b-a)h^{4}}{2880} M_{4} $$
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * }
 * }

--Heejun Chung 18:15, 17 February 2010 (UTC)

= Use Error estimate for Taylor series, composite trapezoidal and composite Simpsons rule =

Problem Statement
Use Error estimate for Taylor series, composite trapezoidal and composite Simpson's rule to find n such that $$ E_n = I - I_n = O(10^{-6}) $$ and compare to numerical results.

Solution

 * $$I=\int_{0}^{1}\frac{e^{x}-1}{x}dx$$

Taylor Series


 * $$e^{x}=\sum _{j=0}^{\infty }\frac{x^j}{j!}\Rightarrow \frac{e^{x}-1}{x}=\sum _{j=1}^{\infty }\frac{x^{j-1}}{j!}$$
 * $$I_n=\int_{0}^{1}f_n(x)dx=\int_{0}^{1}\sum _{j=1}^{\infty} \frac{x^{j-1}}{j!}dx=\sum _{j=1}^{n}\frac{x^j}{j!j}|_0^1=\sum _{j=1}^n \frac{1}{j!j}$$
 * $$f(x)-f_n(x)=R_n(x)=\frac{(x-x_0)^n}{(n+1)!}f^{(n+1)}(\xi)$$ with $$\xi \in [0,x] \,$$ and $$x_0=0 \,$$
 * $$\Rightarrow f(x)-f_n(x)=\frac{x^n}{(n+1)!}f^{(n+1)}(\xi)$$
 * $$E_n=I-I_n=\int_{0}^{1}\left [ f(x)-f_n(x) \right ]dx=\int_{0}^{1}\underbrace{\frac{x^n}{(n+1)!}}_{w(x)}\underbrace{f^{(n+1)}\left (\xi(x) \right )}_{g(x)}dx$$
 * $$\Rightarrow g(\alpha)\int_{0}^{1}w(x)dx$$ for $$\alpha \in [0,1]$$
 * $$E_n =\,$$
 * $$\Rightarrow max = \frac{g(\alpha)}{(n+1)!(n+1)}$$, $$\alpha= \frac{e}{(n+1)!(n+1)} \,$$
 * $$\Rightarrow min = \frac{g(\alpha)}{(n+1)!(n+1)}$$, $$\alpha= \frac{1}{(n+1)!(n+1)}\,$$
 * $$n=2, E_2 \leq .151016 \,$$
 * $$n=4, E_5 \leq .00453 \,$$
 * $$ n=6, E_6 \leq 6.2792 X 10^{-4} \,$$
 * $$ n=8, E_8 \leq 8.42 X 10^{-6} \,$$

Below are the values from Numerical Analysis of Taylor series from HW_1


 * $$n=2, E_2 \leq .151016 \,$$
 * $$n=4, E_5 \leq .00453 \,$$
 * $$ n=6, E_6 \leq 6.2792 X 10^{-4} \,$$
 * $$ n=8, E_8 \leq 8.42 X 10^{-6} \,$$

We are getting same values from both analysis for Taylor series

Trapazoidal Rule

Error for Composite Trapazoidal rule is given by

$$  \displaystyle \left | E_n^1 \right |\leq \frac{(b-a)^3}{12n^2}M_2 $$

where $$M_2 = max \left | f^{(2)} (\zeta )\right |$$ for $$\zeta \varepsilon [a,b]$$

For the given function $$f(x)= \frac{e^x - 1}{x}$$, we have

$$  \displaystyle f^{(2)}(x)= \frac{e^x [x^2-2x+2]-2}{x^3} $$

For the given interval [0,1] the maximum value of function $$f^{(2)}(x)$$ is achieved at $$x=1$$

$$  \displaystyle M_2= f^{(2)}(x=1)=\frac{e[1+2-2]-2}{1}=0.71828182 $$

$$ E_n^1 \leq \frac{(1-0)^3}{12n^2}X 0.71828182 $$

$$ E_2^1 \leq .014964204 $$

$$ E_4^1 \leq 3.74105 X 10^{-3} $$

$$ E_6^1 \leq 1.662689 X 10^{-3} $$

$$ E_8^1 \leq 9.3526278 X 10^{-4}$$

$$ E_{16}^1 \leq 2.3381569 X 10 ^{-4}$$

$$ E_{32}^1 \leq 5.845392 X 10 ^{-5}$$

$$ E_{64}^1 \leq 1.4613481 X 10^{-5}$$

$$ E_{128}^1 \leq 3.65337026 X 10^{-6} $$

$$ E_{256}^1 \leq 9.1334256 X 10^{-7}$$

Below are the results from Numerical analysis from HW 1

$$ E_2^1 \leq 0.010389576$$

$$ E_4^1 \leq 0.002602468 $$

$$ E_8^1 \leq 0.650935 X 10^{-3}$$

$$ E_{16}^1 \leq 162753 X 10^{-4}$$

$$ E_{32}^1 \leq 4.06892 X 10 ^{-5}$$

$$ E_{64}^1 \leq 1.0172 X 10^{-5}$$

$$ E_{128}^1 \leq 2.54263 X 10^{-6} $$

$$ E_{256}^1 \leq 6.3528 X 10^{-7}$$

We can see that we are getting order $$ 10^{-6}$$ at n=128 from both the analysis.

Composite Simpsons Rule

The error estimate of the Composite Simpson's rule is given as

$$   E_n^2 \leq \frac{(b-a)^5}{2880n^4}M_4 $$

where $$M_4 = max \left | f^{(4)} (\zeta )\right |$$ for $$\zeta \varepsilon [a,b]$$

For the given function $$f(x)= \frac{e^x - 1}{x}$$, we have

$$  \displaystyle f^{(4)}(x)= \frac{e^x [x^4-4x^3+12x^2-24x]-24}{x^5} $$

The function $$f^{4}(x)$$ has maximum value at $$x=1$$

$$  \displaystyle M_4= \frac{e[1-4+12-24+24]-24}{1}=0.46453645

$$

$$ E_n^1 \leq \frac{(1-0)^5}{2880n^4}X 0.46453645 $$

$$ E_2^2 \leq 1.00810 X 10^{-5} $$

$$ E_4^2 \leq 6.300678 X 10^{-7} $$

Below are the results from Numerical analysis from HW 1

$$ E_2^2 \leq 1.06514 X 10^{-4} $$

$$ E_4^2 \leq 6.76473 X 10^{-6} $$

We can see that we are getting order $$ 10^{-6}$$ at n=4 from both the analysis.

Numerical determination of power of h

Below are the plots for Taylor series, Composite Trapazoidal rule and Composite Simpson's rule.

Taylor Series

Above is a log Error vs Log h plot(we have used the numerical data from HW1-Problem 8 .We can see that slope of the line is 6.56 which is close to the exact value of 7. Composite Trapazoidal Rule

Above is a log Error vs Log h plot(we have used the numerical data from HW1-Problem 8).We are getting slope of 1.9997 which is very close of exact value 2.

Composite Simpson's rule

Above is a log Error vs Log h plot(we have used the numerical data from HW1-Problem 8).We are getting slope of 3.9987 which is very close to the exact value 4 of the slope for Simpson's rule.

=Asymptotic Errors and Peano Kernel error estimates=

Asymptotic Error: Composite Trapezoidal rule
Ref: Lecture Notes [[media:Egm6341.s10.mtg17.djvu|p.17-3]]

Problem Statement
$$ \displaystyle I=\int_{0}^{\pi}e^{x}cos(x)dx,\,\, $$

$$\displaystyle Evaluate\, I_{n}, E_{n}, Ratio \,\, and \,\, \bar{E}_{n}\, by\, Trapezoidal\, rule.\,\,\, where\,\,\, n=1,2...,9 \,$$

Solution
=Matlab Code for Trapezoidal Rule= MATLAB Code

Results: Trapezoidal Rule

Formula

a) Comp. Trap. rule

$$ \int_{a}^{b}f(x)dx=\frac{b-a}{2n}*[f(x_{0})+2f(x_{1})+2f(x_{2})+.........+2f(x_{n-1})+f(x_{n})] $$

b) Corrected Trap. rule

$$ \int_{a}^{b}f(x)dx=\frac{b-a}{2n}*[f(x_{0})+2f(x_{1})+2f(x_{2})+.........+2f(x_{n-1})+f(x_{n})]-\frac{h^2}{12}*[f^{'}(b)-f^{'}(a)] $$

c) Asymptotic error

$$ \bar{E}_{n} \equiv -\frac{h^{2}}{12}[f^{'}(b)-f^{'}(a)] $$

--Heejun Chung 01:31, 17 February 2010 (UTC)

Asymptotic errors: Composite Simpson rule
Ref: Lecture notes [[media:Egm6341.s10.mtg17.djvu|p.17-3]]

Problem Statement

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

$$\displaystyle Evaluate\, \int_{a}^{b} f(x)\,dx \,using\, Composite\,  Simpson\, rule\, with\,\,  n\;\; =2,4,8,16,32,64\, and\,128.$$ $$\displaystyle Also\, evaluate\,\,  asymptotic\,  errors\,.$$
 * $$\displaystyle f(x) = e^{x}cos(x) \,\,, x\in [a,b] = [0,\pi]$$
 * $$\displaystyle f(x) = e^{x}cos(x) \,\,, x\in [a,b] = [0,\pi]$$
 * }
 * }

Solution

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


 * The asymptotic error for the composite Simpson rule is given by,
 * }
 * }
 * }


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


 * $$\displaystyle \bar{E_n}(f) = \frac{-h^4}{180}\big[ f^{(3)}(b) - f^{(3)}(a)\big]$$
 * }
 * }
 * }


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

i.e, $$\displaystyle h:= \frac{b-a}{n} $$,
 * where,h is the step size
 * where,h is the step size
 * }
 * }


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


 * The Composite Simpson rule is given by,
 * }
 * }
 * }


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

where n = 2k  and k = 1,2,3,4.....
 * $$ \displaystyle I_{\text{n}} = \frac {h}{3} [f_{\text{o}}+4 f_1+2f_2+4f_{\text{3}}+2f_4+4f_5+f_6.......+2f_{\text{n-2}}+4 f_{\text{n-1}} +f_{\text{n}}] $$
 * $$ \displaystyle I_{\text{n}} = \frac {h}{3} [f_{\text{o}}+4 f_1+2f_2+4f_{\text{3}}+2f_4+4f_5+f_6.......+2f_{\text{n-2}}+4 f_{\text{n-1}} +f_{\text{n}}] $$
 * }
 * }


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


 * The above integrals are calculated using MATLAB codes and the errors are tabulated.
 * }
 * }
 * }


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


 * }
 * }
 * }
 * }

Simpson Rule : Asymptotic error

Subramanian Annamalai 18:35, 17 February 2010 (UTC)

Application: Peano Kernel errors estimates : $$ f^{(4)}(x)$$ is singular at x=0
Ref: Lecture notes [[media:Egm6341.s10.mtg18.djvu|p.18-1]]

Problem Statement

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

$$\displaystyle Find\, the\,  Peano\, Kernel\, error\, estimates\, for\, Composite\,  Trapezoidal\, $$ $$\displaystyle and\, Composite\,  Simpson\,  rules\, with\,  n\;\; =2,4,8,16,32,64\, and\,128.$$ $$\,Comment.$$
 * $$\displaystyle f(x) = x^3 \sqrt{x} \,\,, x\in [a,b] = [0,1]$$
 * $$\displaystyle f(x) = x^3 \sqrt{x} \,\,, x\in [a,b] = [0,1]$$
 * }
 * }

Solution

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


 * The Peano Kernel error estimate for the composite Trapezoidal rule is given by,
 * }
 * }
 * }


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


 * $$\displaystyle E_n(f) = \int_{a}^{b} K(t) f ^{(2)}(t)\,dt$$
 * }
 * }
 * }


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


 * where,the Peano Kernel error estimate,
 * }
 * }
 * }


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


 * $$\displaystyle K(t) = \frac{1}{2}(t-t_{j-1})(t-t_j) \;\;\; t_{j-1}<t<t_j \;\;\;\;\; j=1,2,....,n.$$
 * }
 * }
 * }


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

$$\displaystyle t_{j-1} < t <t_j  \;\;\;\;\; j=1,2,....,n$$ represents the intervals.
 * Here
 * Here
 * }
 * }


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


 * The Peano Kernel error estimate for the composite Simpson rule is given by,
 * }
 * }
 * }


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


 * $$\displaystyle E_n(f) = \int_{a}^{b} K(t) f ^{(4)}(t)\,dt$$
 * }
 * }
 * }


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


 * where,the Peano Kernel error estimate,
 * }
 * }
 * }


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

$$\displaystyle K(t) = \begin{cases} \frac{1}{72} (t-t_{j-2})^3 (3t - t_{j-2} - 2t_j),\;\;\;\;  t_{j-2} \leq t \leq \frac{t_{j-2}+t_j}{2} \\ \frac{1}{72} (t_{j}-t)^3 (t_{j} + 2t_{j-2} -3t), \;\;\;\;\;  \frac {t_{j-2}+t_j}{2}  \leq t \leq {t_j} \end{cases} $$


 * }
 * }


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


 * The above integrals are calculates using MATLAB codes and the corresponding errors are tabulated.
 * }
 * }
 * }

Observation: It can be observed that: $$\displaystyle f^{(4)}(x) \rightarrow \infty\, as\, x\rightarrow 0$$. Here the actual error formula for the Simpson's rule cannot be used as it involves $$f^{(4)}(x)$$.

Subramanian Annamalai 18:35, 17 February 2010 (UTC)

Peano Kernel errors estimates -The ratio of errors need not necessarily be 4 and 16 for the Trapezoidal and Simpson's rules respectively on halfing the step size
Ref: Lecture notes [[media:Egm6341.s10.mtg18.djvu|p.18-1]]

Problem Statement

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

$$\displaystyle Find\, the\,  Peano\, Kernel\, error\, estimates\, for\, Composite\,  Trapezoidal\, $$ $$\displaystyle and\, Composite\,  Simpson\,  rules\, with\,  n\;\; =2,4,8,16,32,64\, and\,128. $$ $$\,Comment.$$
 * $$\displaystyle f(x) = \frac{1}{1+(x-\pi)^2} \,\,, x\in [a,b] = [0,5]$$
 * $$\displaystyle f(x) = \frac{1}{1+(x-\pi)^2} \,\,, x\in [a,b] = [0,5]$$
 * }
 * }

Solution

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


 * The Peano Kernel error estimate for the composite Trapezoidal rule is given by,
 * }
 * }
 * }


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


 * $$\displaystyle E_n(f) = \int_{a}^{b} K(t) f ^{(2)}(t)\,dt$$
 * }
 * }
 * }


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


 * where,the Peano Kernel error estimate,
 * }
 * }
 * }


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


 * $$\displaystyle K(t) = \frac{1}{2}(t-t_{j-1})(t-t_j) \;\;\; t_{j-1}<t<t_j \;\;\;\;\; j=1,2,....,n.$$
 * }
 * }
 * }


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

$$\displaystyle t_{j-1} < t <t_j  \;\;\;\;\; j=1,2,....,n$$ represents the intervals.
 * Here
 * Here
 * }
 * }


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


 * The Peano Kernel error estimate for the composite Simpson rule is given by,
 * }
 * }
 * }


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


 * $$\displaystyle E_n(f) = \int_{a}^{b} K(t) f ^{(4)}(t)\,dt$$
 * }
 * }
 * }


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


 * where,the Peano Kernel error estimate,
 * }
 * }
 * }


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

$$\displaystyle K(t) = \begin{cases} \frac{1}{72} (t-t_{j-2})^3 (3t - t_{j-2} - 2t_j),\;\;\;\;  t_{j-2} \leq t \leq \frac{t_{j-2}+t_j}{2} \\ \frac{1}{72} (t_{j}-t)^3 (t_{j} + 2t_{j-2} -3t), \;\;\;\;\;  \frac {t_{j-2}+t_j}{2}  \leq t \leq {t_j} \end{cases} $$


 * }
 * }


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


 * The above integrals are calculates using MATLAB codes and the corresponding errors are tabulated.
 * }
 * }
 * }

Observation: In this case when 'n' is doubled the the error ratio is doesn't reduce by 4 times (Trapezoidal rule) and by 16 times (for Simpson's rule). This is because the function is peaked and hence takes time to converge.

Subramanian Annamalai 18:37, 17 February 2010 (UTC)

Application of Peano Kernel errors estimates : $$f^{(1)}(x)$$ tends to infinity as x tends to zero
Ref: Lecture notes [[media:Egm6341.s10.mtg18.djvu|p.18-1]]

Problem Statement

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

$$\displaystyle Find\, the\,  Peano\, Kernel\, error\, estimates\, for\, Composite\,  Trapezoidal\, $$ $$\displaystyle and\, Composite\,  Simpson\,  rules\, with\,  n\;\; =2,4,8,16,32,64\, and\,128. $$ $$\,Comment.$$
 * $$\displaystyle f(x) = \sqrt{x} \,\,, x\in [a,b] = [0,1]$$
 * $$\displaystyle f(x) = \sqrt{x} \,\,, x\in [a,b] = [0,1]$$
 * }
 * }

Solution

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


 * The Peano Kernel error estimate for the composite Trapezoidal rule is given by,
 * }
 * }
 * }


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


 * $$\displaystyle E_n(f) = \int_{a}^{b} K(t) f ^{(2)}(t)\,dt$$
 * }
 * }
 * }


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


 * where,the Peano Kernel error estimate,
 * }
 * }
 * }


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


 * $$\displaystyle K(t) = \frac{1}{2}(t-t_{j-1})(t-t_j) \;\;\; t_{j-1}<t<t_j \;\;\;\;\; j=1,2,....,n.$$
 * }
 * }
 * }


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

$$\displaystyle t_{j-1} < t <t_j  \;\;\;\;\; j=1,2,....,n$$ represents the intervals.
 * Here
 * Here
 * }
 * }


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


 * The Peano Kernel error estimate for the composite Simpson rule is given by,
 * }
 * }
 * }


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


 * $$\displaystyle E_n(f) = \int_{a}^{b} K(t) f ^{(4)}(t)\,dt$$
 * }
 * }
 * }


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


 * where,the Peano Kernel error estimate,
 * }
 * }
 * }


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

$$\displaystyle K(t) = \begin{cases} \frac{1}{72} (t-t_{j-2})^3 (3t - t_{j-2} - 2t_j),\;\;\;\;  t_{j-2} \leq t \leq \frac{t_{j-2}+t_j}{2} \\ \frac{1}{72} (t_{j}-t)^3 (t_{j} + 2t_{j-2} -3t), \;\;\;\;\;  \frac {t_{j-2}+t_j}{2}  \leq t \leq {t_j} \end{cases} $$


 * }
 * }


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


 * The above integrals are calculates using MATLAB codes and the corresponding errors are tabulated.
 * }
 * }
 * }

Observation: It should be noted that: $$\displaystyle f^{(4)}(x) \rightarrow \infty as x\rightarrow 0$$. So the Peano curve error estimate is helpful in such cases. The errors reduce by the same ratio in both Trapezoidal and Simpson's rule.

Subramanian Annamalai 18:36, 17 February 2010 (UTC)

Peano Kernel errors estimates -Trapezoidal and Simpson rules - Periodic functions
Ref: Lecture notes [[media:Egm6341.s10.mtg18.djvu|p.18-1]]

Problem Statement

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

$$\displaystyle Find\, the\,  Peano\, Kernel\, error\, estimates\, for\, Composite\,  Trapezoidal\, $$ $$\displaystyle and\, Composite\,  Simpson\,  rules\, with\,  n\;\; =2,4,8,16,32,64\, and\,128. $$ $$\,Comment.$$
 * $$\displaystyle f(x) = e^{cos(x)} \,\,, x\in [a,b] = [0,2\pi]$$
 * $$\displaystyle f(x) = e^{cos(x)} \,\,, x\in [a,b] = [0,2\pi]$$
 * }
 * }

Solution

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


 * The Peano Kernel error estimate for the composite Trapezoidal rule is given by,
 * }
 * }
 * }


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


 * $$\displaystyle E_n(f) = \int_{a}^{b} K(t) f ^{(2)}(t)\,dt$$
 * }
 * }
 * }


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


 * where,the Peano Kernel error estimate,
 * }
 * }
 * }


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


 * $$\displaystyle K(t) = \frac{1}{2}(t-t_{j-1})(t-t_j) \;\;\; t_{j-1}<t<t_j \;\;\;\;\; j=1,2,....,n.$$
 * }
 * }
 * }


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

$$\displaystyle t_{j-1} < t <t_j  \;\;\;\;\; j=1,2,....,n$$ represents the intervals.
 * Here
 * Here
 * }
 * }


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


 * The Peano Kernel error estimate for the composite Simpson rule is given by,
 * }
 * }
 * }


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


 * $$\displaystyle E_n(f) = \int_{a}^{b} K(t) f ^{(4)}(t)\,dt$$
 * }
 * }
 * }


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


 * where,the Peano Kernel error estimate,
 * }
 * }
 * }


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

$$\displaystyle K(t) = \begin{cases} \frac{1}{72} (t-t_{j-2})^3 (3t - t_{j-2} - 2t_j),\;\;\;\;  t_{j-2} \leq t \leq \frac{t_{j-2}+t_j}{2} \\ \frac{1}{72} (t_{j}-t)^3 (t_{j} + 2t_{j-2} -3t), \;\;\;\;\;  \frac {t_{j-2}+t_j}{2}  \leq t \leq {t_j} \end{cases} $$


 * }
 * }


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


 * The above integrals are calculates using MATLAB codes and the corresponding errors are tabulated.
 * }
 * }
 * }

Observation: It can be seen that when we have periodic functions the composite trapezoidal and composite Simpson's rules converge rapidly. And moreover the trapezoidal rule proves itself superior to that of Simpson's.

Subramanian Annamalai 18:36, 17 February 2010 (UTC)

= Comparison of Romberg table with Taylor, Trap and Simpson's Rules = Ref: Lecture notes [[media:Egm6341.s10.mtg19.djvu|p.19-2]]

Problem Statement
This problem is continued from the HW on [[media:Egm6341.s10.mtg6.pdf|p.6-5]]

i) Modify matlab code to make the computation of $$\displaystyle T_{0}(2^{j}) $$ efficient, i.e. $$\displaystyle T_{0}(2^{j}) = T_{0}(2^{(j-1)}) + \cdot\cdot\cdot $$.

ii) Construct Romberg table and compare to previous results, i.e. compare Romberg table to Taylor, Trap. and Simpson's rules.

Solution
i)

Recall the formula of comp. Trap. rule.


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

T_{0}(n) = h\left[\frac{1}{2}f(x_{0}) + f(x_{1}) + f(x_{2}) + \cdot\cdot\cdot + f(x_{n-1}) + \frac{1}{2}f(x_{n}) \right] $$ $$ where $$\displaystyle h = \frac{b-a}{n} $$ and $$\displaystyle x_{0} = a,\quad x_{n} = b $$.
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (Eq. 1)
 * }
 * }

Also, realize the fact that if we want to double the number of sub-intervals, we don't have to calculate the functions at even point, i.e. $$\displaystyle f(x_{0}), f(x_{2}), \cdot\cdot\cdot, f(x_{n-2}), f(x_{n}) $$ because we already calculated the functions at these even point at the previous step. Therefore, all we have to do is evaluating the functions only at the odd points and combine them with the calculated values at the previous step. As a result, we can use the following inductive formula.
 * {| style="width:100%" border="0" align="left"

T_{0}(2n) = T_{0}(n) + h\sum_{i=1}^{n}f(x_{2i-1}). $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (Eq. 2)
 * }
 * }

In the following table, we summarize $$\displaystyle T_{0}(n) $$ for $$\displaystyle n = 1, 2, 4, 8, 16, 32, 64, 128 $$. The Matlab code for this calculation is provided in the end of this document.

ii)

In order to construct Romberg table, recall that the following inductive formula from the lecture note [[media:Egm6341.s10.mtg19.djvu|p.19-2]],


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

T_{k}(2n) = \frac{2^{2k}T_{k-1}(2n) - T_{k-1}(n)}{2^{2k}-1}. $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (Eq. 3)
 * }
 * }

Since we already obtain $$\displaystyle T_{0}(n) $$ in part i), the following Romberg table can be constructed using Eq.(3).  Matlab code to make this table is provided in the end part of this document. 

'''Note the fact that the first and second columns of the above table correspond to Trap. and Simpson's rules respectively.'''

In order to compare the Romberg integration table to Taylor, Trap. and Simpson's rules, let's evaluate errors of the Romberg integration table.

In the previous HW (i.e. HW on [[media:Egm6341.s10.mtg6.pdf|p.6-5]] of the lecture note), we already found that we can achieve $$\displaystyle E_{n} = O(10^{-7})$$ when $$\displaystyle n = 8$$ in Taylor series expansion. As we shows the first and second column of above table, to achieve $$\displaystyle E_{n} = O(10^{-7})$$, $$\displaystyle n > 128$$ for trap. rule and $$\displaystyle n = 8$$ for Simpson's rule. On the other hand, we can achieve the same order of error when $$\displaystyle n = 4$$ using Romberg table (see. the third column of above table).

Therefore, Romberg integration table is the most efficient and accurate integration method.

Matlab code for part i) and ii)

Yong Nam Ahn 15:18, 17 February 2010 (UTC)

= Contributing Team Members = 1. Subramanian Annamalai 18:52, 17 February 2010 (UTC) Authored: 4.2,4.3,4.4,4.5 and 4.6  Proof-read: 4.1 and 5

2. Heejun Chung 19:38, 17 February 2010 (UTC) Authored: 2 and 4.1  Proof-read: 4.2,4.3,4.4,4.5 and 4.6

3. Min Zhong 19:56, 17 February 2010 (UTC) Authored: 1   Proof-read: 2

4. Yong Nam Ahn 21:03, 17 February 2010 (UTC) Authored: 5   Proof-read: 2 and 4.1

5. Abhishekksingh 21:03, 17 February 2010 (UTC) Authored: 3   Proof-read: 1 and 4.1

=References= 1. Introduction to Numerical Methods,2nd Edition by Kendall E Atkinson Second Edition 2. Numerical Methods for Engineers,5th Edition by Steven C Chapra and Raymond P Canale