User:Egm6341.s11.team5/HW4

=''' Problem 4.1 - Simpson's rule integrates the 3rd order polynomial exactly. '''= From [[media:nm1.s11.mtg18.djvu|Mtg 18-2]]

Given

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

f(x) = P_3(x) = 1 + 3x -9x^2 +12x^3 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (1-1)
 * }
 * }

Find
 Find, I (exact) and I_2 (Simple simpson) 

Solution
 We solved on our own 


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

\begin{align} I &= \int_{-2}^{1} f(x) \ dx \\ &= \left[ x + \frac{3}{2} x^2 -3x^3 +3x^4\right]_{-2}^{1} \\ &= -73.5 \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (1-2)
 * }
 * }


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


 * }
 * }
 * }


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

\begin{align} I_2 &= \frac{h}{3} \left[ f(x_0) +4f(x_1) + f(x_2) \right] \\ &= \frac{1}{2} \left[ f(-2) +4f(- \frac{1}{2}) + f(1) \right] \\ &= \frac{1}{2} \left[ -137 -17 +7 \right] \\ &= -73.5 \end{align} $$
 * $$\displaystyle
 * $$\displaystyle

Where, $$\displaystyle \ \left( h = \frac{1-(-2)}{2} = \frac{3}{2}, \qquad x_0 = -2, \ x_1 = - \frac{1}{2}, \ x_2 = 1 \right)$$

$$.
 * $$\displaystyle (1-3)
 * }
 * }

Author and proof-reader
[Author] Oh

[Proof-reader]

= Problem 4.2 - Change of Variables = From [[media:nm1.s11.mtg20.djvu|Mtg 20-2]]

Given
$$A(t) = \int_{-t}^{k}f(x(t))dt +\int_{k}^{+t} f(x(t))dt $$, where $$ k \in (-t, +t)$$

Find
Prove that $$A^{(1)}(t) = F(-t) + F(t)$$

Solution
''' We solved this problem on our own. '''

Starting with our given equation, $$A(t) = \int_{-t}^{k}f(x(t))dt +\int_{k}^{+t} f(x(t))dt $$, we will take the derivative: $$A^{(1)}(t)=\frac{d}{dt}\left [ \int_{-t}^{k}f(x(t))dt +\int_{k}^{+t}f(x(t))dt \right ]$$ $$A^{(1)}(t)=\frac{d}{dt}\left [ f(x(k)) - f(x(-t)) + f(x(t)) - f(x(k)) \right ]$$, where the $$f(x(k))$$ cancel out. We then get: $$A^{(1)}(t)=\frac{d}{dt} \left( -f(x(-t)) \right) + \frac{d}{dt} \left( -f(x(t)) \right) $$, where $$F(t)=\frac{d}{dt} \left( -f(x(t)) \right)$$ and $$F(-t) = \frac{d}{dt} \left( -f(x(-t)) \right) $$.


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

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

\therefore A^{(1)}(t)= F(-t) + F(t)

$$
 * }
 * }
 * }


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

.
 * }
 * }
 * }

Author and proof-reader
[Author] Cavalcanti

[Proof-reader] Reiss

= Problem 4.3 - Proof of Simple Simpson Error Theorm = From [[media:nm1.s11.mtg20.djvu|Mtg 20-3]]

Given
Let, $$\displaystyle G(t):=e(t)-t^5e(1)$$ where, $$\displaystyle e(t)=\int_{-t}^{t}F(\tau )d\tau - \frac{t}{3}[ F(-t) + 4F(0) +F(t)]$$

Find
Show that $$\displaystyle G^{(2)}(0)=0$$

Solution
 We solved it on our own 

The first derivative of e(t)is as follows: Second Derivative is as follows: At $$t=0$$, With the given equation $$\displaystyle G(t)$$ and its derivatives are calculated. At $$t=0$$,

Author and proof-reader
[Author] Raghunathan

[Proof-reader] Reiss

= Problem 4.4 -Finding e(3)in the Simple Simpson's rule with tighter bounds = From [[media:nm1.s11.mtg20.djvu|Mtg 20-3]]

Given
$$\displaystyle 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)]$$

Find
Show that, $$\displaystyle e^{(3)}(t)=-\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)] $$

Solution
 We solved it on our own  First Derivative Given in20-2 and is also proved in HW4.2 $$\displaystyle 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)]$$ Second Derivative Taking derivative,we get: $$\displaystyle e^{(2)}(t)=[-F^{(1)}(-t)+F^{(1)}(t)]-\frac{1}{3}[-F^{(1)}(-t)+F^{(1)}(t)]-\frac{1}{3}[-F^{(1)}(-t)+F^{(1)}(t)] -\frac{t}{3}[F^{(2)}(-t)+F^{(2)}(t)]$$ which is simplified to: $$\displaystyle e^{(2)}(t)= \frac{1}{3}[-F^{(1)}(-t)+F^{(1)}(t)] -\frac{t}{3}[F^{(2)}(-t)+F^{(2)}(t)]$$ Third Derivative Taking the derivative again, we get: $$\displaystyle e^{(3)}(t)=\frac{1}{3}[F^{(2)}(-t)+F^{(2)}(t)] -\frac{1}{3}[F^{(2)}(-t)+F^{(2)}(t)]-\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)]$$ Simplifying, we get: $$\displaystyle e^{(3)}(t)= -\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)]$$ Hence derived.

Author and proof-reader
[Author] Raghunathan

[Proof-reader]

= Problem 4.5 - Proof of e(1) in Simple Simpson Error = From [[media:nm1.s11.mtg20.djvu|Mtg 20-3]]

Given

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

e(1)=-\frac{1}{90}F^{4}(\zeta_4) $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (5-1) $$
 * }
 * }

Find
Prove that $$\displaystyle e(1)=-\frac{(b-a)^4}{1440}f^{(4)}(\xi)$$ and find the relationship between $$\displaystyle \zeta_4 $$ and $$\displaystyle \xi $$.

Solution
Before solving this problem, the following should be noted.
 * {| style="width:100%" border="0" align="left"

\begin{align} F(t) &= f(x(t)) \\ x&=x_1+ht \\ \mathrm{d}x &=h \mathrm{d}t \\ \xi&=x_1+h \zeta_4 \mbox{, } (t=\zeta_4,x=\xi) \\ \end{align} $$ With the equations above, the proof can be made as below.
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (5-2)$$
 * }
 * }
 * {| style="width:100%" border="0" align="left"

\begin{align} F^{(4)}(\zeta_4)&=\frac{\mathrm{d}^4}{\mathrm{d}t^4}F(\zeta_4) \\ &=\frac{\mathrm{d}^4}{(\frac{\mathrm{d}x}{h})^4}f(\xi) \\ &=h^4\frac{\mathrm{d}^4}{\mathrm{d}x^4}f(\xi) \\ &=(\frac{b-a}{2})^4f^{(4)}(\xi) \mbox{ ,} h=\frac{b-a}{2} \end{align} $$ Substitute Eq.(5-3) into Eq.(5-1).
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (5-3)$$
 * }
 * }
 * {| style="width:100%" border="0" align="left"

\begin{align} e(1)&=-\frac{1}{90}\frac{(b-a)^4}{16}f^{(4)}(\xi) \\ &=-\frac{(b-a)^4}{1440}f^{(4)}(\xi) \end{align} $$.
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (5-4)$$
 * }
 * }

Author and proof-reader
[Author] Shin

[Proof-reader] Raghunathan

=''' Problem 4.6 -Integration Comparison. '''= From [[media:nm1.s11.mtg21.djvu|Mtg 21-1]]

Given
$$f(x)=\frac{e^{x}-1}{x}$$

Find
Integrate f(x) using roots of Legendre polynominal and Chebyshev polynominal in Newton-Cotes as well as Gauss Legendre quadrature and compare results.

Solution
 We solved this our selves 

Doubble click on the thumbnail to view.

Author and proof-reader
[Author] J Davis 19:30, 28 February 2011 (UTC) [Proof-reader]

= Problem 4.7 - Composite Simpson's rule verification = From [[media:nm1.s11.mtg22.djvu|Mtg 22-2]]

Given

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

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle 	\left | {E_n}^{S}\right |\leqslant\dfrac{(b-a)^5}{2880n^4}M_4=\dfrac{(b-a)h^4}{2880} M_4


 * $$ \left( M_4:=max\left |f^{(4)}(\xi)\right | \qquad \xi\in[a,b] \right)$$

$$
 * $$\displaystyle (7-1)
 * }.
 * }.

Find
 Verify $$\displaystyle (7-1) $$ 

Solution
 We solved on our own 

 According to $$\displaystyle \ (4) $$[[media:nm1.s11.mtg7.djvu|Mtg 7-4]] 
 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle 	E_{n}^{S} := I - I_{n}^{s} = \int_{a}^{b} f(x)dx - \dfrac{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/2} \left\{ \ \int_{x_{2i-2}}^{x_{2i}} f(x)dx-\dfrac{h}{3} \left[ f(x_{2i-2})+4f(x_{2i-1})+f(x_{2i}) \right] \right\} $$

$$
 * $$\displaystyle (7-2)
 * }
 * }

 According to SSET [[media:nm1.s11.mtg18.djvu|Mtg 18-2]] 
 * {| style="width:100%" border="0" align="left"

$$  $$
 * $$\displaystyle
 * $$\displaystyle
 * $$ \left| E_{n}^{S} \right| \leq \frac{h^{5}}{90} \underbrace {\sum_{i=1}^{n} \left( \max \left|f^{(4)}(\xi )\right| \right) \qquad \xi \in \ ]\ x_{i-1}, x_i\ [}_{\bar{M}_{4} :=}  $$
 * $$\displaystyle (7-3)
 * }
 * }

 According to $$\displaystyle \ (4) $$[[media:nm1.s11.mtg17.djvu|Mtg 17-1]] 
 * {| style="width:100%" border="0" align="left"

$$ 
 * $$\displaystyle
 * $$\displaystyle
 * $$ \bar{M}_{4} \leq n M_4 $$

$$
 * $$\displaystyle (7-4)
 * }
 * }


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

$$\displaystyle \left| E_{n}^{S} \right| \leq \frac{(b-a)^{5}}{2880 n^5} n M_4 = \frac{(b-a)h^{4}}{2880 }  M_4 $$
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * }.
 * }.
 * }.

Author and proof-reader
[Author] Oh

[Proof-reader] Reiss

= Problem 4.8 - Finding n st Errors are in the order of $$10^{-6}$$ = From [[media:nm1.s11.mtg22.djvu|Mtg 22-2]]

Given
Error estimates for Taylor Series, Comp. Trapezoidal, and Comp. Simpson of: $$I:=\int_{-1}^{1}\frac{e^{x}-1}{x} dx$$

Find
1. Use the error estimate for the Taylor Series, the Comp. Trapezoidal, and the Comp. Simpson to find n, such that $$E= I - I_{n}$$ is of the order of $$10^{-6}$$, and compare to numerical results. 2. Numerically find the power of h in the error. Plot log error vs log h, and measure slope with least square.

Solution
''' We solved this on our own. '''

1. The error is found by: $$E = I - I_{n}$$. Taylor Series: The error can be estimated by $$ \int_{-1}^{1}e^{\xi}\frac{x^{n}}{(n+1)!}dx $$. Integrating: $$e^{\xi} \int_{-1}^{1}\frac{x^{n}}{(n+1)!}dx = \frac{e^{\xi}}{(n+1)!} \int_{-1}^{1}x^{n}dx = \frac{e^{\xi}}{(n+1)(n+1)!} \left[ x^{(n+1)} \right]_{-1}^{1}$$. Using this result and the fact that our boundary is $$[-1,1]$$, we get out error for the Taylor Series as: $$\frac{e^{-1}}{(n+1)(n+1)!} \left[ (-1)^{n} +1 \right]<E_{n}< \frac{e}{(n+1)(n+1)!} \left[ (-1)^{n} +1 \right]$$ For this error calculation, the following simple Octave code was used: %Taylor n = input("Enter n") E=(1+((-1)^n))*exp(1)/(factorial(n+1)*(n+1)) Here is the table of results:

'''Comp. Trapezoidal:''' The error can be estimated as: $$ E_{n}\leq \frac{(b-a)^{3}}{12n^{3}}M_{2}$$, where $$[a,b] = [-1, 1]$$. Therefore the error is $$ E_{n}\leq \frac{2}{3n^{3}}M_{2}$$. Also, $$M_{2}= max\left| f^{(2)}(\xi)\right |$$. Maximizing $$ f^{(2)}$$: $$f^{(2)}= \frac{e^{x}(x^{2}-2x+2)-2}{x^{3}}$$ $$max \left|f^{(2)}(\xi) \right| $$ happens at $$\xi = 1$$ and is $$e -2 $$ The error is then $$ E_{n}\leq \frac{2}{3n^{3}}(e-2)$$ The Comp. Trapezoidal error was found using Wolfram Alpha (| WA), and that is $$n\geq 692$$.

'''Comp. Simpson's:''' For the Simpson's, the error is estimated by: $$ E_{n}=\frac{-32}{2880n^{4}}f^{(4)}(\xi)=\frac{-1}{90n^{4}}f^{(4)}{\xi}$$. The maximum of the fourth derivative also happens at 1, so we then get: $$E_{n}=\frac{-1}{90n^{4}}(9e-24)$$. The following octave code was used: %Simpsons n = input("Enter n") E=(9*exp(1)-24)/(90*n^4)

The results are shown on the table:


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

The values for n, in the order Taylor Series, Comp. Trapezoidal, Comp. Simpson's, were found to be: $$\displaystyle n=8, n=692, n=5 $$
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }


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

2. Power of h and graph of log error vs log h. The values we got on the first part were plotted on a log scale. The x-axis is the log(h), while the y-axis is the log(E). If we take the log of both these equation, we can find the power of h:
 * }
 * }
 * }


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

The values for the power of h, in the order Comp. Trapezoidal, Comp. Simpson's, were found to be: $$\displaystyle h=3, h=4 $$
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:50%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }


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


 * }
 * }
 * }

Author and proof-reader
[Author] cavalcanti

[Proof-reader]

= Problem 4.9 - Examination of Proof of SSET = From [[media:nm1.s11.mtg22.djvu|Mtg 22-3]]

Given
From [[media:nm1.s11.mtg18.djvu|Mtg18-2]], Error for Simple Simpson's rule is given by,


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



\begin{align} E_{2} & = -\frac{(b-a)^5}{2880}f^{(4)}(\xi)\ \, \xi \in [a,b] \\ & = -\frac{h^5}{90}f^{(4)}(\xi)\ \, h := \frac{b-a}{2} \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle (9-1)


 * }.
 * }.

In order to prove the above Error for Simple Simpson's rule we defined


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




 * $$\displaystyle

G(t) := e(t) - t^5 e(1)

$$ $$
 * $$\displaystyle (9-2)


 * }.
 * }.

where,


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




 * $$\displaystyle

e(t) := \int_{-t}^{+t} F(t)dt - \frac{t}{3} \left[F(-t)+4F(0)+F(t)\right] \ \, F(t) := f(x(t))

$$ $$
 * $$\displaystyle (9-3)


 * }.
 * }.

Find
Try to prove the Simple Simpsons Error Theorem using


 * {| 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) $$ And point out where proof breaks down
 * $$ \displaystyle
 * $$ \displaystyle
 * }

Also find $$ G^{(3)}(0)$$ and show that $$ G^{(4)}$$ also breaks down

Solution
We referred to Team 3 S10 but clarified and tried to be more thorough

Background Rolle's Theorem states that for a function $$f(x)$$ that is continuous on $$\left] {a,b} \right[$$ there exists a $$\xi$$ such that $${f^{(1)}}(\xi ) = 0$$ Here we will attempt to show that $$G^{(n)}$$ has two points where the value is zero so we can apply Rolle's Theorem

For part a

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

G(t) = e(t) - t^{4}e(1) $$
 * $$ \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^{4}e(1)=0 $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-4)
 * }


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

G(1) = e(1) - 1^{4}e(1)= 0 $$ $$ We can see from eqations 9-4 and 9-5 that there are two values of x for which $$G(x)=0$$. therefor we can use Rolle's Theorem which states that
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-5)
 * }
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _1  \in  ]0,1[,  G^{(1)}(\zeta _1) = 0   $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-6)
 * }
 * {| 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}F(0)-\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 $$ $$ Equations 9-6 and 9-7 allow us to implement Rolle's Theorem again giving
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-7)
 * }
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _2 \in ]0,\zeta_1[,  G^{(2)}(\zeta _2) = 0   $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-8)
 * }
 * {| 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"

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


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

e^{(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"

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


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

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

Again we can see from equations 9-8 and 9-9 that there are two points at which the value of $$ G(x)=0$$ so we can again apply Rolle's Theorem to get
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _3 \in ]0,\zeta_2[,  G^{(3)}(\zeta _3) = 0   $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-10)
 * }
 * {| style="width:100%" border="0" align="left"

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


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

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


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

e^{(3)}(t)& = \frac{1}{3}[F^{(2)}(-t)+F^{(2)}(t)]-\frac{1}{3}[F^{(2)}(-t)+F^{(2)}(t)]-\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)]\\ &= -\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)]\\ \end{align} $$ $$ Now substituting $$\zeta_3$$ and equation 9-12 into equation 9-11 we get
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-12)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

G^{(3)}(\zeta_3) = -\frac{\zeta_3}{3}[-F^{(3)}(-\zeta_3)+F^{(3)}(\zeta_3)] - 24\zeta_3e(1) $$ $$ Using the derivative mean value theorem wikipedia, of which Rolle's theorem is a special case, on the first term in equation 9-13 we see that
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-13)
 * }
 * {| style="width:100%" border="0" align="left"

F^{(4)} &= \frac{[-F^{(3)}(-\zeta_3)+F^{(3)}(\zeta_3)]}{\zeta_3-(-\zeta_3)}\\ &\Rightarrow [-F^{(3)}(-\zeta_3)+F^{(3)}(\zeta_3)]= 2\zeta_3F^{(4)} \end{align} $$ $$ Therefor equation 9-13 becomes
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-14)
 * }
 * {| style="width:100%" border="0" align="left"

G^{(3)}(\zeta_3) &= -\frac{\zeta_3}{3}[2\zeta_3F^{(4)}(\zeta_4)] - 24\zeta_3e(1)\\ &= 0 \end{align} $$ $$ Rearranging
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-15)
 * }
 * {| style="width:100%" border="0" align="left"

24\zeta_3e(1) &= -\frac{\zeta_3}{3}[2\zeta_3F^{(4)}(\zeta_4)] \\ e(1) &= -\frac{\zeta_3}{36}F^{(4)}(\zeta_4) \end{align} $$ $$ Using the definition of $$F^{(4)}(\zeta_4)$$ from question 5 above, we see that
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-16)
 * }
 * {| style="width:100%" border="0" align="left"

e(1) = -\frac{f^4}(\xi ) $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-17)
 * }

We know from [[media:nm1.s11.mtg18.djvu|Mtg18-3]] that the error for the Simple Simpson's Rule is given by
 * {| style="width:100%" border="0" align="left"

E_2=I-I_2&=he(1)\\ &=-\frac{f^4}(\xi ) \end{align} $$ $$ The result has $$E_2$$ in terms of two interior values $$\zeta_3$$ and $$\xi$$. This is not a useful solution to the proof. The proof goes wrong in equation 9-15. Here the $$\zeta_3$$ term does not cancel out, because $$G^{(3)}$$ gives $$\zeta_3e(1)$$ not $$\zeta_3^2$$, leaving $$\zeta_3$$ in the final solution.
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-18)
 * }

For part b

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

G(t) = e(t) - t^{6}e(1) $$
 * $$ \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
 * <p style="text-align:right;">$$\displaystyle (9-19)
 * }


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

G(1) = e(1) - 1^{6}e(1)= 0 $$ $$ We can see from eqations 9-19 and 9-20 that there are two values of x for which $$G(x)=0$$. therefor we can use Rolle's Theorem which states that
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-20)
 * }
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _1  \in  ]0,1[,  G^{(1)}(\zeta _1) = 0   $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-21)
 * }
 * {| 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}F(0)-\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 $$ $$ Equations 9-21 and 9-22 allow us to implement Rolle's Theorem again giving
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-22)
 * }
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _2 \in ]0,\zeta_1[,  G^{(2)}(\zeta _2) = 0   $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-23)
 * }
 * {| style="width:100%" border="0" align="left"

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


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

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


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

e^{(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"

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


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

G^{(2)}(0) = e^{(2)}(0) - 30(0^{2})e(1) = 0 $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-24)
 * }

Again we can see from equations 9-23 and 9-24 that there are two points at which the value of $$ G(x)=0$$ so we can again apply Rolle's Theorem to get
 * {| style="width:100%" border="0" align="left"

\exists  \zeta _3 \in ]0,\zeta_2[,  G^{(3)}(\zeta _3) = 0   $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-25)
 * }
 * {| style="width:100%" border="0" align="left"

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


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

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


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

e^{(3)}(t)& = \frac{1}{3}[F^{(2)}(-t)+F^{(2)}(t)]-\frac{1}{3}[F^{(2)}(-t)+F^{(2)}(t)]-\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)]\\ &= -\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)]\\ \end{align} $$ $$ Now substituting $$\zeta_3$$ and equation 9-27 into equation 9-26 we get
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-27)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

G^{(3)}(\zeta_3) = -\frac{\zeta_3}{3}[-F^{(3)}(-\zeta_3)+F^{(3)}(\zeta_3)] - 120\zeta_3^3e(1) $$ $$ Using the derivative mean value theorem wikipedia, of which Rolle's theorem is a special case, on the first term in equation 9-28 we see that
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-28)
 * }
 * {| style="width:100%" border="0" align="left"

F^{(4)} &= \frac{[-F^{(3)}(-\zeta_3)+F^{(3)}(\zeta_3)]}{\zeta_3-(-\zeta_3)}\\ &\Rightarrow [-F^{(3)}(-\zeta_3)+F^{(3)}(\zeta_3)]= 2\zeta_3F^{(4)} \end{align} $$ $$ Therefor equation 9-28 becomes
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-29)
 * }
 * {| style="width:100%" border="0" align="left"

G^{(3)}(\zeta_3) &= -\frac{\zeta_3}{3}[2\zeta_3F^{(4)}(\zeta_4)] - 120\zeta_3^3e(1)\\ &= 0 \end{align} $$ $$ Rearranging
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-30)
 * }
 * {| style="width:100%" border="0" align="left"

120\zeta_3^3e(1) &= -\frac{\zeta_3}{3}[2\zeta_3F^{(4)}(\zeta_4)] \\ e(1) &= -\frac{1}{180\zeta_3}F^{(4)}(\zeta_4) \end{align} $$ $$ Using the definition of $$F^{(4)}(\zeta_4)$$ from question 5 above, we see that
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-31)
 * }
 * {| style="width:100%" border="0" align="left"

e(1) = -\frac{h^4}{180\zeta_3}{f^4}(\xi ) $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-32)
 * }

We know from [[media:nm1.s11.mtg18.djvu|Mtg18-3]] that the error for the Simple Simpson's Rule is given by (and then replacing 9-32 into the error)
 * {| style="width:100%" border="0" align="left"

E_2=I-I_2&=he(1)\\ &=-\frac{h^5}{180\zeta_3}{f^4}(\xi ) \end{align} $$ $$ The result has $$E_2$$ in terms of two interior values $$\zeta_3$$ and $$\xi$$. This is not a useful solution to the proof. The proof goes wrong in equation 9-30. Here the $$\zeta_3$$ term does not cancel out, because $$G^{(3)}$$ gives $$\zeta_3^3e(1)$$ not $$\zeta_3^2$$, leaving $$\frac{1}{\zeta_3}$$ in the final solution.
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-33)
 * }

Continuation of G(x)
From [[media:nm1.s11.mtg19.djvu|Mtg19-1]]
 * {| style="width:100%" border="0" align="left"

G(t)=e(t)-t^5e(1) $$ From equation 9-12 we can see that
 * $$ \displaystyle
 * $$ \displaystyle
 * }


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

G^{(3)}(t)&=-\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)]-60t^2e(1)\\ G^{(3)}(0)&=0 \end{align} $$ $$ Using equation 9-34 and equation 3 from [[media:nm1.s11.mtg20.djvu|Mtg20-3]] which says $$G^{(3)}(\zeta_3)=0$$ we can apply Rolle's Theorem to say
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">$$\displaystyle (9-34)
 * }


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

\exists  \zeta _4 \in ]0,\zeta_3[,  G^{(4)}(\zeta _4) = 0   $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-35)
 * }
 * {| style="width:100%" border="0" align="left"

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

\begin{align} e^{(4)}(t)&=\frac{d}{dx}e^{(3)}(x)\\ &=\frac{d}{dx}\left[[-\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)]\right]\\ &=-\frac{1}{3}[-F^{(3)}(-t)+F^{(3)}(t)]-\frac{t}{3}[F^{(4)}(-t)+F^{(4)}(t)] \end{align} $$ $$ This gives us
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-36)
 * }
 * {| style="width:100%" border="0" align="left"

G^{(4)}(\zeta_4)&=-\frac{1}{3}[-F^{(3)}(-\zeta_4)+F^{(3)}(\zeta_4)]-\frac{\zeta_4}{3}[F^{(4)}(-\zeta_4)+F^{(4)}(\zeta_4)]-120\zeta_4e(1)\\ &=0 \end{align} $$ From the derivative mean value theorem we have
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * }
 * {| style="width:100%" border="0" align="left"

[-F^{(3)}(-\zeta_4)+F^{(3)}(\zeta_4)]=2\zeta_4F^{(4)}(\zeta_5) $$ Therefor
 * $$ \displaystyle
 * $$ \displaystyle
 * }
 * {| style="width:100%" border="0" align="left"

G^{(4)}(\zeta_4)=-\frac{1}{3}[2\zeta_4F^{(4)}(\zeta_5)]-\frac{\zeta_4}{3}[F^{(4)}(-\zeta_4)+F^{(4)}(\zeta_4)]-120\zeta_4e(1) $$ $$ Rearranging and using $$G^{(4)}(\zeta_4)=0$$ we have
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-37)
 * }
 * {| style="width:100%" border="0" align="left"

120\zeta_4e(1)=-\frac{1}{3}[2\zeta_4F^{(4)}(\zeta_5)]-\frac{\zeta_4}{3}[F^{(4)}(-\zeta_4)+F^{(4)}(\zeta_4)] $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-38)
 * }
 * {| style="width:100%" border="0" align="left"

e(1)=\frac{1}{360}\left[2F^{(4)}(\zeta_5)-F^{(4)}(-\zeta_4)+F^{(4)}(\zeta_4)\right]$$ $$ Again we can see that we have two interior points. So the error of the simple Simpson's rule will have two interior points. Again the proof breaks down. From all of the above we can see that our initial selection, $$G(t)=e(t)-t^5e(1)$$ as given in [[media:nm1.s11.mtg19.djvu|Mtg 19-1]], will satisfy the proof for the Simple Simpson's Error Theorem only if we take the third derivative of $$G(t)$$. Using any other power than 5 and the proof will break down. The proof also breaks down if we try to take further derivatives of our defined function.
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-39)
 * }

Author and proof-reader
[Author] Reiss [Proof-reader]

= Problem 4.10 -Error evaluation using Composite Trapezoidal & Simpson rules = From [[media:Nm1.s11.mtg22.djvu|Mtg 22-3]]

Given
Part a,b.
 * $$\displaystyle

I=\int_0^{\pi} \! e^x \sin{x} \, \mathrm{d}x. $$ Part c.
 * $$\displaystyle

I=\int_0^{1} \! x^{3.7} \, \mathrm{d}x. $$

Find
Part a.
 * Produce Table 5.1, page 255, Atkinson text book using the composite Trapezoidal rule.

Part b.
 * Produce Table 5.3, page 258, Atkinson text book using the composite Simpson rule.

Part c.
 * Produce Table 5.4, page 261, Atkinson text book using the composite Trapezoidal & composite Simpson rule.

Part a.

 * From the class notes (p.7-4), the composite Trapezoidal rule is defined as below.
 * {| style="width:100%" border="0" align="left"

I_n=h(\dfrac{1}{2}f(x_0)+f(x_1)+f(x_2)+...+f(x_{n-1})+\dfrac{1}{2}f(x_{n})) \mbox{, }h=\dfrac{b-a}{n} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (10-1)
 * }
 * The asymptotic error is defined as the following equation.
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

\overline{E_n^T}=-\frac{h^2}{12}[f^{(1)}(b)-f^{(1)}(b)] $$ $$ The exact integration was performed using Wolfram Alpha as below.
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (10-2)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

I = \int_0^{\pi} \! e^x \sin{x} \, \mathrm{d}x = 12.0703 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (10-3)
 * }
 * }

 Table: 

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

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

Part b.

 * From the class notes (p.7-4), the composite Simpson's rule is defined as below.
 * {| style="width:100%" border="0" align="left"

I_n=\dfrac{h}{3}(f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+...+2f(x_{n-2})+4f(x_{n-1})+f(x_n))\mbox{, }h=\frac{b-a}{n} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (10-4)
 * }
 * The asymptotic error is defined as the following equation.
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

\overline{E_n^S}=-\frac{h^4}{180}[f^{(3)}(b)-f^{(3)}(b)] $$ $$  Table: 
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (10-5)
 * }
 * }

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

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

Part c.
The exact integration was performed using Wolfram Alpha as below.
 * {| style="width:100%" border="0" align="left"

I = \int_0^{1} \! x^{3.7} \, \mathrm{d}x = 0.212766 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (10-6)
 * }
 * }

 Table: 

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

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

Author and proof-reader
[Author] Shin [Proof-reader]

= References =

= Contributing members =