User:Egm6341.s11.team4/HW4

Homework 4

=Problem 4.1 Using Simple Simpson's Rule to Integrate the 3rd Order Polynomial Exactly=

Problem Given on Lecture Slide 18-2

Given
Given an arbitrary 3rd degree polynomial
 * $$ \displaystyle f(x)=P_{3}(x)=c_{0}+c_{1}x^{1}+c_{2}x^{2}+c_{3}x^{3} $$

which can be expressed in sigma notation as
 * $$\displaystyle \sum_{i=0}^{3} c_{i}x^{i} $$

examine the interval
 * $$ \displaystyle [a,b]=[-2,1] $$

With the following coefficients
 * $$\displaystyle c_{0}=1, c_{1}=3, c_{2}=-9, c_{3}=12 $$

Objective
1. Evaluate the integral using simple Simpson's Rule

2. Evaluate the integral exactly

3. Compare the two integral calculations to show that simple Simpson's rule exactly integrates the 3rd order polynomial.

Exact Integral
First, we will evaluate the integral exactly. Since this is a simple polynomial, the integral evaluation can be performed analytically with ease.


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

Substituting in our function


 * $$ I(f)=\displaystyle \int_{a}^{b} 12x^{3}-9x^{2}+3x+1 dx $$

Performing the integration


 * $$ I(f)=[3x^{4}-3x^{3}+\frac{3}{2}x^{2}+x]_{a}^{b} $$


 * $$ \begin{align} I(f)&=[3(1)^{4}-3(1)^{3}+\frac{3}{2}(1)^{2}+(1)] \\

& {} \qquad {}  -[3(-2)^{4}-3(-2)^{3}+\frac{3}{2}(-2)^{2}+(-2)] \end{align} $$


 * $$ I(f)=[3-3+\frac{3}{2}+1]-[48+24+\frac{3}{2}4-2] $$


 * $$ I(f)=\displaystyle [2.5]-[76] $$


 * $$ I(f)= \displaystyle -73.5 $$

So, if simple Simpson's rule exactly integrates a 3rd degree polynomial as expected we expect that it will produce a value of -73.5 through quadrature.

Simple Simpson's Rule Quadrature
Simple Simpson's is expressed below


 * $$ I_{n}(f)=\frac{b-a}{6}[f(a)+4f(\frac{a+b}{2})+f(b)] $$

Substituting in for a and b, we get


 * $$ I_{n}(f)=\frac{1+2}{6}[f(-2)+4f(\frac{-2+1}{2})+f(1)] $$

Evaluating our function at the given points, we have


 * $$ I_{n}(f)=\frac{1}{2}[-137+4(-4.25)+7] $$


 * $$ I_{n}(f)=\frac{1}{2}[-137-17+7] $$


 * $$ I_{n}(f)=\frac{-147}{2} $$

Now we have a final answer through quadrature, comparing it to our exact integral, we see


 * $$ I_{n}(f)=I(f)=\frac{-147}{2}=-73.5 $$

Thus simple Simpson's rule, though it approximates the function as a simple 2nd order parabola, can exactly integrate a polynomial of degree 3.

Error Cancellation
Though the quadrature rule does not exactly approximate the function it exactly integrates the function through cancellation of areas. This principle is shown in the graph below.



Simpson's rule underestimates the area under the curve initially and then overestimates the area. These errors in the approximation exactly cancel each other out for a 3rd order polynomial and the simple Simpson's rule exactly integrates the function.

This problem was solved by Brendan Mahon

Given
Given that:
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

A(t)=\int\limits_{-t}^{+t}{F(x)dx=}\int\limits_{-t}^{k}{F(x)dx+}\int\limits_{k}^{+t}{F(x)dx}

$$ Prove:
 * 
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

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

$$
 * 
 * }

Answer:
Take a derivative on this equation,
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

A(t)=\int\limits_{-t}^{+t}{F(x)dx=}\int\limits_{-t}^{k}{F(x)dx+}\int\limits_{k}^{+t}{F(x)dx}

$$ We assume that $$\displaystyle \begin{align} & G(t)=\int{F(t)dt},\frac{dG(t)}{dt}=F(t) \\ & \\ \end{align}$$
 * 
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\int\limits_{-t}^{k}{F(x)dx}=G(k)-G(-t)

$$
 * 
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\int\limits_{k}^{+t}{F(x)dx}=G(t)-G(k)

$$ Where k is constant value,
 * 
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & \frac{dA(t)}{dt}=\frac{d\left( G(k)-G(-t) \right)}{dt}+\frac{d\left( G(t)-G(k) \right)}{dt} \\ & =-\frac{d\left( G(-t) \right)}{dt}\frac{d\left( -t \right)}{dt}+\frac{d\left( G(t) \right)}{dt}=F(-t)+F(t) \\ \end{align}

$$ So,
 * 
 * }
 * {| style="width:100%" border="0"

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

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

$$
 * 
 * }

=Problem 4.3 Show that the second derivative of G(0) equals to zero=

Given
To prove Simple Simpson Error Theorem. Let, where,

Objectives
Show that

Solution
From given equation, the first derivative of e(t) is below.

Differentiate once more from eq(3.1) we get eq(3.2).

Substitute 0 into the eq(3.2), we get eq(3.3).

From the given equation about G(t). Calculate the first derivatives.

Calculate the first derivatives from eq(3.4).

Substitute 0 into the eq(3.5).

Given

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

& {} \qquad {}                     -\frac{t}{3}[-F^{(1)}(-t)+F^{(1)}(t)]    \end{align} $$

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

First Derivative
Starting with our given equation for $$ e^{(1)} $$ which was given in class on lecture slide 20-2 and is proven in homework problem 4.2.


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

& {} \qquad {} -\frac{t}{3}[-F^{(1)}(-t)+F^{(1)}(t)] \end{align} $$

Second Derivative
We take the derivative with respect to t and obtain.


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

& {} \qquad {} -\frac{1}{3}[-F^{(1)}(-t)+F^{(1)}(t)] -\frac{t}{3}[F^{(2)}(-t)+F^{(2)}(t)] \end{align} $$

This function can be simplified to


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

Third Derivative
Now, if we take the derivative again, we obtain


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

& {} \qquad {} -\frac{t}{3}[-F^{(3)}(-t)+F^{(3)}(t)] \end{align} $$

Simplifying again, we obtain


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

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

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

$$
 * }
 * }

Which is the desired equation.

This problem was solved by Brendan Mahon

Given
From the equation of SSET.

Objectives
Find the relationship between $$ \zeta $$ and $$ \xi $$.

Solution
In the proof of SSET, we used transformation of variable.

Let

Substitute 1,-1 into the eq(2.2), we get eq(5.3) and eq(5.4).

From eq(5.3) and eq(5.4), we can get eq(5.5) and eq(5.6).

From addition of eq(5.5) and eq(5.6), we get eq(5.7)

From subtraction of eq(5.5) and eq(5.6), we get eq(5.8)

Substitute eq(5.7) and eq(5.8) into eq(5.2), we get eq(5.9).

Given
Refer to lecture notes [[media:nm1.s11.mtg21.djvu|21-1]] for more details.

Objective
1. Use roots of Legendre Polynomial to the accuracy of $$10^{-6}$$. Plot $$f _n^L(x)$$ and $$f(x)$$.

2. Use roots of Chebyshev Polynomial, to the accuracy of $$10^{-6}$$ by Newton-cotes methods. Plot $$f _n^L(x)$$ and $$f(x)$$.

3. Comparison of Lagrangian Interpolation using three different types of nodes.

Using nodes of Legendre Polynomial




Using nodes of Chebyshev Polynomial




Since there the difference in above figure is not much clear, we plot above picture using $$n=6$$ again.



Comment
From above results, we see that:

Among three different types of interpolation nodes, using roots of Chebyshev Polynomial is much accurate and can best fix Runge phenomenon, although using roots of Legendre Polynomial can also settle it.

In this problem, Runge phenomenon happens only when we use odd number of nodes to do Lagrangian interpolation.

Reference
1.	Lagrange_polynomial 2.	Legendre_polynomials 3.     Chebyshev_polynomials 4.     Gauss-Legendre_quadrature

=Problem 4.7: Composite Simpson Rule Error Boundary=

Refer to lecture slide [[media:Nm1.s11.mtg22.djvu|22-2]] for problem assignment.

Objective
Prove that the error when using the composite Simpson rule to approximate the integral of a function, $$\displaystyle f$$, from a to b is bound by

where

Solution
From equation [[media:Nm1.s11.mtg7.djvu|(4)p.7-4]]

Breaking (7.2) into discrete intervals yields

Now applying the simple Simpon's error theorem presented on lecture slide [[media:Nm1.s11.mtg18.djvu|18-2]] to each interval:

Next, define $$\displaystyle \overline{M_4}$$

(7.7) becomes

Since

Substituting (7.11) into (7.9)


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

$$\displaystyle $$ $$
 * style="width:35%" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * E_n^S| \leq \frac{(b-a)h^4}{180}M_4 = \frac{(b-a)^5}{180n^4}M_4
 * $$\displaystyle
 * style= |
 * }
 * }

Note: This solution differs from the problem statement but is confirmed by Atkinson pp.257&258

Solved by William Kurth.

=Problem 4.8: Taylor, Trapezoidal and Simpson's Error Estimate Comparisons=

Refer to lecture slide [[media:nm1.s11.mtg22.djvu|22-2]] for the problem statement.

Given

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



(8.1)
 * $$\displaystyle I:=\int_{a}^{b}\underbrace{\frac{e^x-1}{x}}_{f(x)}dx$$
 * 
 * }
 * }

For the Taylor Series Expansion, the max error in the integral is limited by the following from lecture [[media:nm1.s11.mtg7.djvu|7-2]]


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



(8.2)
 * $$\displaystyle E_n \le \frac{e}{(n+1)!(n+1)}$$
 * 
 * }
 * }

For the composite Trapezoidal rule, the max error is limited by the following from lecture [[media:nm1.s11.mtg22.djvu|22-1]]


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



(8.3)
 * $$\displaystyle \vert E_n \vert \le \frac{(b-a)h^2}{12}M_2$$
 * 
 * }
 * }

For the composite Simpson's rule, the max error is limited by the following from lecture [[media:nm1.s11.mtg22.djvu|22-2]]


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



(8.4)
 * $$\displaystyle \vert E_n \vert \le \frac{(b-a)h^4}{2880}M_4$$
 * 
 * }
 * }

Where


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




 * $$\displaystyle a = -1$$


 * }
 * }


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




 * $$\displaystyle b = 1$$


 * }
 * }

and,


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




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


 * }
 * }

Objective
1.a.) Find n such that En = O(10^-6) and compare to numerical results in HW2.4 using Taylor Series error.

1.b.) Find n such that En = O(10^-6) and compare to numerical results in HW2.4 using Composite Trapezoidal rule error.

1.c.) Find n such that En = O(10^-6) and compare to numerical results in HW2.4 using Composite Simpson's rule error.

2.a.) Numerically find the power of h in the Composite Trapezoidal rule error.

2.b.) Numerically find the power of h in the Composite Simpson's rule error.

Solution
Using Wolfram Alpha we find that the exact value of the integral to 12 significant digits is:

I = 2.11450175075

1.a.) Taylor Series Error Comparison
From equation (8.1) we can easily show that when n = 7 the error will be less than or equal to 8.4272 x 10^-6.

To compare the predicted value of the integral with the actual value of the integral we will use the following:

I = 2.11450175075

And from HW2.4:


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



(8.5)
 * $$\displaystyle I_7 = \left[\sum_{i=1}^{7}\frac{x^{i}}{i!i}\right]_{x=-1}^{x=1} = 2.11450113379$$
 * 
 * }
 * }

Now,


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




 * $$\displaystyle E_{7} = |I - I_{7}| = |2.11450175075 - 2.11450113379| = 6.1696 \times 10^{-7}$$


 * }
 * }

In this case the actual error is approximately one order of magnitude less than the maximum possible error.

1.b.) Composite Trapezoidal Rule Error Comparison
From equation (8.3) with


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




 * $$\displaystyle M_2 = max |f^{(2)}(x)| = e - 2 \approx 0.718281828459$$


 * }
 * }

We get


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




 * $$\displaystyle En \le 7.3067 \times 10^{-6} \quad at \quad n = 256$$


 * }
 * }

From equation (1) on lecture slide [[media:nm1.s11.mtg7.djvu|7-4]] we get:


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



(8.6)
 * $$\displaystyle I_{256} = h \left[\frac{1}{2}f_0 + f_1 + \cdots + f_{n-1} + \frac{1}{2}f_n\right] = 2.11450549301$$
 * 
 * }
 * }

This compares well with


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



(8.7)
 * $$\displaystyle E_{256} = |I - I_{256}| = |2.11450175075 - 2.11450549301| = 3.7423 \times 10^{-6}$$
 * 
 * }
 * }

1.c.) Composite Simpson's Rule Error Comparison
From equation (8.4) with


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




 * $$\displaystyle M_4 = max |f^{(4)}(x)| = 9e - 24 \approx 0.464536456131$$


 * }
 * }

We get


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




 * $$\displaystyle En \le 1.2601 \times 10^{-6} \quad at \quad n = 8$$


 * }
 * }

From equation (4) on lecture slide [[media:nm1.s11.mtg7.djvu|7-4]] we get:


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



(8.8)
 * $$\displaystyle I_8 = \frac{h}{3} \left[f_0 + 4f_1 + 2f_2 + \cdots + 4f_{n-2} + 2f_{n-1} + f_n\right] = 2.11451145359$$
 * 
 * }
 * }

However when we compare I8 with I we get an actual E8 that is greater than what the error equation tells us we should get. See below:


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



(8.9)
 * $$\displaystyle E_{8} = |I - I_{8}| = |2.11450175075 - 2.11451145359| = 9.70284 \times 10^{-6}$$
 * <p style="text-align:right">
 * }
 * }

2.a.) Composite Trapezoidal Rule Error Power of h Determination
Using equations (8.6) and (8.7) we construct the following two tables:

By graphing the above table with log(h) on the x-axis and log(En) on the y-axis with MS Excel and fitting a linear regression line across the points we get the graph below. As can be seen on the graph the slope of the line is approximately two which corresponds to the power of h in the composite Trapezoidal rule error equation.



2.b.) Composite Simpson's Rule Error Power of h Determination
Using equations (8.8) and (8.9) we construct the following two tables:

By graphing the above table with log(h) on the x-axis and log(En) on the y-axis with MS Excel and fitting a linear regression line across the points we get the graph below. As can be seen on the graph the slope of the line is approximately four which corresponds to the power of h in the composite Simpson's rule error equation.



This problem was solved by Erle Fields

=Problem 4.9 proof of SSET in different cases= Refer to lecture slide [[media:nm1.s11.mtg22.djvu|mtg-22]] for the problem statement.

Objectives
A). Redo the proof for two cases:

1).
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

G(t):=e(t)-{{t}^{4}}e(1)

$$ 2). :{| style="width:100%" border="0" $$ \displaystyle
 * <p style="text-align:right">
 * }
 * style="width:95%" |
 * style="width:95%" |

G(t):=e(t)-{{t}^{6}}e(1)

$$ Point out where proof breaks down.
 * <p style="text-align:right">
 * }

B). for G(t) as in (1) p.19-1(w/t5), find G(3)(0) and follow same steps in proof to see what happen.

Solutions
A). Redo the proof for two cases: 1). $$\displaystyle G(t):=e(t)-{{t}^{4}}e(1)$$
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

e(t)=\int\limits_{-t}^{+t}{F(t)dt}-\frac{t}{3}[F(-t)+4F(0)+F(t)]

$$ Where $$\displaystyle F(t)=f(x(t))$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\text{G}\left( 0 \right)=e(0)-{{0}^{4}}e(1)=\int\limits_{-0}^{+0}{F(t)dt}-\frac{0}{3}[F(-0)+4F(0)+F(0)]=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\text{G}\left( 1 \right)=e(1)-{{1}^{4}}e(1)=0

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{1}}\in \left( 0,1 \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 1 \right)}}({{\xi }_{1}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(1)}}\left( t \right)={{e}^{(1)}}(t)-4{{t}^{3}}e(1)={{A}^{(1)}}(t)-A{{_{2}^{L}}^{(1)}}(t)-4{{t}^{3}}e(1) \\ & \begin{matrix} \begin{matrix} {} & {} \\ \end{matrix} & {}  \\ \end{matrix}=F(-t)+F(t)-\{\frac{1}{3}[F(-t)+4F(0)+F(t)]+\frac{t}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]\}-4{{t}^{3}}e(1) \\ \end{align}

$$ So,
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(1)}}\left( 0 \right)=F(-0)+F(0)-\{\frac{1}{3}[F(-0)+4F(0)+F(0)]+\frac{0}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]\}-4\centerdot {{0}^{3}}e(1) \\ & \begin{matrix} {} & {} & {} \\ \end{matrix}=0 \\ \end{align}

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{2}}\in \left( 0,{{\xi }_{1}} \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 2 \right)}}({{\xi }_{2}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(2)}}\left( t \right)={{e}^{(2)}}(t)-12{{t}^{2}}e(1)={{A}^{(2)}}(t)-A{{_{2}^{L}}^{(2)}}(t)-12{{t}^{2}}e(1) \\ & \begin{matrix} \begin{matrix} {} & {} \\ \end{matrix} & {}  \\ \end{matrix}=-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)-\{\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)] \\ & \begin{matrix} {} & {} & {} & {} \\ \end{matrix}+\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]+\frac{t}{3}[{{F}^{(2)}}(-t)+{{F}^{(2)}}(t)]\}-12{{t}^{2}}e(1) \\ & \begin{matrix} \begin{matrix} {} & {} \\ \end{matrix} & {}  \\ \end{matrix}=\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]-\frac{t}{3}[{{F}^{(2)}}(-t)+{{F}^{(2)}}(t)]\}-12{{t}^{2}}e(1) \\ \end{align}

$$ So,
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(2)}}\left( 0 \right)=\frac{1}{3}[-{{F}^{(1)}}(-0)+{{F}^{(1)}}(0)]-\frac{0}{3}[{{F}^{(2)}}(-0)+{{F}^{(2)}}(0)]\}-12\centerdot {{0}^{2}}e(1) \\ & \begin{matrix} {} & {} & = \\ \end{matrix}0 \\ \end{align}

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{3}}\in \left( 0,{{\xi }_{2}} \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 3 \right)}}({{\xi }_{3}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(3)}}\left( t \right)=\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]-\frac{t}{3}[{{F}^{(2)}}(-t)+{{F}^{(2)}}(t)]-24te(1) \\ & \begin{matrix} {} & {} & = \\ \end{matrix}\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)]-24te(1) \\ & \begin{matrix} {} & {} & = \\ \end{matrix}-\frac{t}{3}[-{{F}^{(3)}}(-t)+{{F}^{(3)}}(t)]-24te(1) \\ \end{align}

$$ So, $$\displaystyle {{\text{G}}^{(3)}}\left( {{\xi }_{3}} \right)=\frac{3}[{{F}^{(3)}}(-{{\xi }_{3}})-{{F}^{(3)}}({{\xi }_{3}})]-24\left( {{\xi }_{3}} \right)e(1)=0$$, then using DMVT:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

e(1)=\frac{\frac{3}[{{F}^{(3)}}(-{{\xi }_{3}})-{{F}^{(3)}}({{\xi }_{3}})]}{24\left( {{\xi }_{3}} \right)}=\frac{\frac{3}[-2{{\xi }_{3}}{{F}^{(4)}}({{\xi }_{4}})]}{24\left( {{\xi }_{3}} \right)}=\frac{-{{\xi }_{3}}{{F}^{(4)}}({{\xi }_{4}})}{36}

$$ Where, $$\displaystyle {{\xi }_{4}}\in \left( -{{\xi }_{3}},{{\xi }_{3}} \right)$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

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

{{\text{E}}_{2}}=h\centerdot e(1)=h\frac{-{{\xi }_{3}}{{F}^{(4)}}({{\xi }_{4}})}{36}

$$     (Eq ) The proof will break down here because the magnitude of error is related to $$\displaystyle {{\xi }_{3}}$$in the above equation.
 * <p style="text-align:right">
 * }

2)

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

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

e(t)=\int\limits_{-t}^{+t}{F(t)dt}-\frac{t}{3}[F(-t)+4F(0)+F(t)]

$$ Where $$\displaystyle F(t)=f(x(t))$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\text{G}\left( 0 \right)=e(0)-{{0}^{6}}e(1)=\int\limits_{-0}^{+0}{F(t)dt}-\frac{0}{3}[F(-0)+4F(0)+F(0)]=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\text{G}\left( 1 \right)=e(1)-{{1}^{6}}e(1)=0

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{1}}\in \left( 0,1 \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 1 \right)}}({{\xi }_{1}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(1)}}\left( t \right)={{e}^{(1)}}(t)-6{{t}^{5}}e(1)={{A}^{(1)}}(t)-A{{_{2}^{L}}^{(1)}}(t)-6{{t}^{5}}e(1) \\ & \begin{matrix} \begin{matrix} {} & {} \\ \end{matrix} & {}  \\ \end{matrix}=F(-t)+F(t)-\{\frac{1}{3}[F(-t)+4F(0)+F(t)]+\frac{t}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]\}-6{{t}^{5}}e(1) \\ \end{align}

$$ So,
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(1)}}\left( 0 \right)=F(-0)+F(0)-\{\frac{1}{3}[F(-0)+4F(0)+F(0)]+\frac{0}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]\}-6\centerdot {{0}^{5}}e(1) \\ & \begin{matrix} {} & {} & {} \\ \end{matrix}=0 \\ \end{align}

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{2}}\in \left( 0,{{\xi }_{1}} \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 2 \right)}}({{\xi }_{2}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(2)}}\left( t \right)={{e}^{(2)}}(t)-30{{t}^{4}}e(1)={{A}^{(2)}}(t)-A{{_{2}^{L}}^{(2)}}(t)-30{{t}^{4}}e(1) \\ & \begin{matrix} \begin{matrix} {} & {} \\ \end{matrix} & {}  \\ \end{matrix}=-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)-\{\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)] \\ & \begin{matrix} {} & {} & {} & {} \\ \end{matrix}+\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]+\frac{t}{3}[{{F}^{(2)}}(-t)+{{F}^{(2)}}(t)]\}-30{{t}^{4}}e(1) \\ & \begin{matrix} \begin{matrix} {} & {} \\ \end{matrix} & {}  \\ \end{matrix}=\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]-\frac{t}{3}[{{F}^{(2)}}(-t)+{{F}^{(2)}}(t)]\}-30{{t}^{4}}e(1) \\ \end{align}

$$ So,
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(2)}}\left( 0 \right)=\frac{1}{3}[-{{F}^{(1)}}(-0)+{{F}^{(1)}}(0)]-\frac{0}{3}[{{F}^{(2)}}(-0)+{{F}^{(2)}}(0)]\}-30\centerdot {{0}^{4}}e(1) \\ & \begin{matrix} {} & {} & = \\ \end{matrix}0 \\ \end{align}

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{3}}\in \left( 0,{{\xi }_{2}} \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 3 \right)}}({{\xi }_{3}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(3)}}\left( t \right)=\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]-\frac{t}{3}[{{F}^{(2)}}(-t)+{{F}^{(2)}}(t)]-120{{t}^{3}}e(1) \\ & \begin{matrix} {} & {} & = \\ \end{matrix}\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)]-120{{t}^{3}}e(1) \\ & \begin{matrix} {} & {} & = \\ \end{matrix}-\frac{t}{3}[-{{F}^{(3)}}(-t)+{{F}^{(3)}}(t)]-120{{t}^{3}}e(1) \\ \end{align}

$$ So, $$\displaystyle {{\text{G}}^{(3)}}\left( {{\xi }_{3}} \right)=\frac{3}[{{F}^{(3)}}(-{{\xi }_{3}})-{{F}^{(3)}}({{\xi }_{3}})]-120{{\left( {{\xi }_{3}} \right)}^{3}}e(1)=0$$, then using DMVT:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

e(1)=\frac{\frac{3}[{{F}^{(3)}}(-{{\xi }_{3}})-{{F}^{(3)}}({{\xi }_{3}})]}{120{{\left( {{\xi }_{3}} \right)}^{3}}}=\frac{\frac{3}[-2{{\xi }_{3}}{{F}^{(4)}}({{\xi }_{4}})]}{120{{\left( {{\xi }_{3}} \right)}^{3}}}=\frac{-{{F}^{(4)}}({{\xi }_{4}})}{180{{\xi }_{3}}}

$$ Where, $$\displaystyle {{\xi }_{4}}\in \left( -{{\xi }_{3}},{{\xi }_{3}} \right)$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

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

{{\text{E}}_{2}}=h\centerdot e(1)=h\frac{-{{F}^{(4)}}({{\xi }_{4}})}{180{{\xi }_{3}}}

$$
 * <p style="text-align:right">
 * }The proof will break down here because the magnitude of error is related to $$\displaystyle {{\xi }_{3}}$$in the above equation.

B)
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

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

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

e(t)=\int\limits_{-t}^{+t}{F(t)dt}-\frac{t}{3}[F(-t)+4F(0)+F(t)]

$$ Where $$\displaystyle F(t)=f(x(t))$$
 * <p style="text-align:right">
 * }


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

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\text{G}\left( 0 \right)=e(0)-{{0}^{5}}e(1)=\int\limits_{-0}^{+0}{F(t)dt}-\frac{0}{3}[F(-0)+4F(0)+F(0)]=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\text{G}\left( 1 \right)=e(1)-{{1}^{5}}e(1)=0

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{1}}\in \left( 0,1 \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 1 \right)}}({{\xi }_{1}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(1)}}\left( t \right)={{e}^{(1)}}(t)-5{{t}^{4}}e(1)={{A}^{(1)}}(t)-A{{_{2}^{L}}^{(1)}}(t)-5{{t}^{4}}e(1) \\ & \begin{matrix} \begin{matrix} {} & {} \\ \end{matrix} & {}  \\ \end{matrix}=F(-t)+F(t)-\{\frac{1}{3}[F(-t)+4F(0)+F(t)]+\frac{t}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]\}-5{{t}^{4}}e(1) \\ \end{align}

$$ So,
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(1)}}\left( 0 \right)=F(-0)+F(0)-\{\frac{1}{3}[F(-0)+4F(0)+F(0)]+\frac{0}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]\}-5\centerdot {{0}^{4}}e(1) \\ & \begin{matrix} {} & {} & {} \\ \end{matrix}=0 \\ \end{align}

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{2}}\in \left( 0,{{\xi }_{1}} \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 2 \right)}}({{\xi }_{2}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(2)}}\left( t \right)={{e}^{(2)}}(t)-20{{t}^{3}}e(1)={{A}^{(2)}}(t)-A{{_{2}^{L}}^{(2)}}(t)-20{{t}^{3}}e(1) \\ & \begin{matrix} \begin{matrix} {} & {} \\ \end{matrix} & {}  \\ \end{matrix}=-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)-\{\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)] \\ & \begin{matrix} {} & {} & {} & {} \\ \end{matrix}+\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]+\frac{t}{3}[{{F}^{(2)}}(-t)+{{F}^{(2)}}(t)]\}-20{{t}^{3}}e(1) \\ & \begin{matrix} \begin{matrix} {} & {} \\ \end{matrix} & {}  \\ \end{matrix}=\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]-\frac{t}{3}[{{F}^{(2)}}(-t)+{{F}^{(2)}}(t)]\}-20{{t}^{3}}e(1) \\ \end{align}

$$ So,
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(2)}}\left( 0 \right)=\frac{1}{3}[-{{F}^{(1)}}(-0)+{{F}^{(1)}}(0)]-\frac{0}{3}[{{F}^{(2)}}(-0)+{{F}^{(2)}}(0)]\}-20\centerdot {{0}^{3}}e(1) \\ & \begin{matrix} {} & {} & = \\ \end{matrix}0 \\ \end{align}

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{3}}\in \left( 0,{{\xi }_{2}} \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 3 \right)}}({{\xi }_{3}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\begin{align} & {{\text{G}}^{(3)}}\left( t \right)=\frac{1}{3}[-{{F}^{(1)}}(-t)+{{F}^{(1)}}(t)]-\frac{t}{3}[{{F}^{(2)}}(-t)+{{F}^{(2)}}(t)]-60{{t}^{2}}e(1) \\ & \begin{matrix} {} & {} & = \\ \end{matrix}\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)]-60{{t}^{2}}e(1) \\ & \begin{matrix} {} & {} & = \\ \end{matrix}-\frac{t}{3}[-{{F}^{(3)}}(-t)+{{F}^{(3)}}(t)]-60{{t}^{2}}e(1) \\ \end{align}

$$ So,
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

{{\text{G}}^{(3)}}\left( 0 \right)=-\frac{0}{3}[-{{F}^{(3)}}(-t)+{{F}^{(3)}}(t)]-60\centerdot {{0}^{2}}e(1)=0

$$ Apply Rolle ‘ s theorem, it yields:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

\exists {{\xi }_{4}}\in \left( 0,{{\xi }_{3}} \right)\begin{matrix} {} & st. \\ \end{matrix}{{G}^{\left( 4 \right)}}({{\xi }_{4}})=0

$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

{{\text{G}}^{(4)}}\left( t \right)=\frac{1}{3}[{{F}^{(3)}}(-t)-{{F}^{(3)}}(t)]-\frac{t}{3}[{{F}^{(4)}}(-t)+{{F}^{(4)}}(t)]-120te(1)

$$ So,
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

{{\text{G}}^{(4)}}\left( {{\xi }_{4}} \right)=\frac{1}{3}[{{F}^{(3)}}(-{{\xi }_{4}})-{{F}^{(3)}}({{\xi }_{4}})]-\frac{3}[{{F}^{(4)}}(-{{\xi }_{4}})+{{F}^{(4)}}({{\xi }_{4}})]-120{{\xi }_{4}}e(1)=0

$$ Using DMVT:
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle
 * style="width:95%" |
 * style="width:95%" |

e(1)=\frac{\frac{1}{3}[-2{{\xi }_{4}}{{F}^{(4)}}({{\xi }_{5}})]-\frac{3}[{{F}^{(4)}}(-{{\xi }_{4}})+{{F}^{(4)}}({{\xi }_{4}})]}{120{{\xi }_{4}}}=\frac{-[2{{F}^{(4)}}({{\xi }_{5}})+{{F}^{(4)}}(-{{\xi }_{4}})+{{F}^{(4)}}({{\xi }_{4}})]}{360}

$$ Where, $$\displaystyle {{\xi }_{5}}\in \left( -{{\xi }_{4}},{{\xi }_{4}} \right)$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

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

{{\text{E}}_{2}}=h\centerdot e(1)=h\frac{-[2{{F}^{(4)}}({{\xi }_{5}})+{{F}^{(4)}}(-{{\xi }_{4}})+{{F}^{(4)}}({{\xi }_{4}})]}{360}

$$ Here, it is observed that the magnitude of error is related to the value of function at these two points$$\displaystyle {{\xi }_{4}},{{\xi }_{5}}$$in the above equation.
 * <p style="text-align:right">
 * }

=Problem 4.10: Error Convergence for the Trapezoidal and Simpon's Rules=

Refer to lecture slides [[media:Nm1.s11.mtg22.djvu|22-3 through 22-5]] for problem assignment.

Given
Consider the exact integrals

and

Objectives

 * 1.) Create a table showing the approximations of (10.1) by using the Trapezoidal rule with successively doubling values of n, as well as the corresponding error involved in the approximation. Also, the table should include the ratio of successive errors to show the effect of doubling the value of n on the error.


 * 2.) Create a table showing the approximations of (10.1) by using Simpson's rule with successively doubling values of n, as well as the corresponding error involved in the approximation. Also, the table should include the ratio of successive errors to show the effect of doubling the value of n on the error.


 * 3.) Create a table showing the errors of approximating (10.2) by using both the Trapezoidal and Simpon's rules, as well as the ratio of successive errors to show the effect of doubling the value of n on the error.

Calculation of the True Values of the Integrals
Wolfram Alpha was used to compute the exact values of (10.1) and (10.2):

Approximation of the Integral of $$f(x) = e^x sin(x)$$ by Trapezoidal Rule
The following MATLAB code was used to calculate the approximation of (10.1) for increasing values of n using the Trapezoidal rule, as well as the associated approximation errors and the ratios of successive approximation errors.

As can be seen in this table the error is quartered when the interval size is halved, indicating that the error indeed scales with $$ O(h^2)$$.

Approximation of the Integral of $$f(x) = e^x sin(x)$$ by Simpon's Rule
The following MATLAB code was used to calculate the approximation of (10.1) for increasing values of n using Simpson's rule, as well as the associated approximation errors and the ratios of successive approximation errors.

As can be seen in this table that as the interval size is halved the error is reduced by a factor of sixteen, indicating that the error indeed scales with $$ O(h^4)$$.

Error of Approximating the Integral of $$ f(x) = x^{3.7}$$ Using Both Trapezoidal and Simpon's Rules
The following MATLAB code was used to calculate the approximation of (10.2) for increasing values of n using both the Trapezoidal and Simpson's rules, as well as the associated approximation errors and the ratios of successive approximation errors for each method.

As can be seen in this table that as the interval size is halved the error associated with the Trapezoidal rule is quartered and the error associated with Simpson's rule is reduced by a factor of sixteen, indicating that the errors indeed scale with $$ O(h^2)$$ and $$ O(h^4)$$, respectively.

Solved by William Kurth.

=Contributing Members & Referenced Lecture=

= Signatures =


 * Brendan Mahon 04:45, 2 March 2011 (UTC)


 * Erle Fields 04:53, 2 March 2011 (UTC)


 * William Kurth 04:58, 2 March 2011 (UTC)


 * Hailong Chen 1:30PM, 1 March 2011 (EST)


 * Taeho Kim 12:35, 3 March 2011 (UTC)


 * shengfeng yang 9:30AM, 2 March 2011 (EST)