User:Egm6341.s11.team2.zou/HW3

=Problem 3.1 Compare Taylor series approximation with Lagrangian Interpolation=

Problem Statement
Use two methods to approximate the function $$\displaystyle f(x)=\sin x$$,

1) Taylor series expaned with respect to $$\displaystyle \hat{x}=\frac{3\pi }{8}$$ to the order $$\displaystyle n$$,

2) Lagrangian interpolation to the order 4

Compare the error by two methods at $$\displaystyle x=\frac{7\pi }{8}$$, find $$\displaystyle n$$ such that the error of Taylor series expansion is less than 4th order Lagrangian interpolation. And then give the maximum value of Lagrangian interpolation error.

Solution
Taylor series expansion

The Taylor expansion to $$\displaystyle f(x)=\sin x$$ is

Lagrangian interpolation

Use equidistance discretion, the 4th order Lagrangian interpolation requires 5 nodes: While the Lagrangian Interpolation evaluated at $$\displaystyle x=\frac{7\pi }{8}$$ is,

where,

Plug them back into the Eq 1.4 we have,

Compare the two methods

The exact value of $$\displaystyle f(\frac{7\pi }{8})$$ is,

Then we have the error of Lagrangian interpolation,

To find the order n which makes the Taylor series produce small error, we need to try different order.

From the calculation above, the 6th order of Taylor expansion can give better result than Lagrangian interpolation.

The maximum value of Lagrangian interpolation error

By Lagrangian interpolation error theorem,

Thus the maximum error is contained by $$\displaystyle \left| {{q}_{5}}(t) \right|$$. If $$\displaystyle t$$ is confined within $$\displaystyle (0,\pi )$$, the maximal error is given by

=Problem 3.8: Deriving the Error in Simple Simpson's=

Given: The Convergence of Numerical Integration
The convergence of numerical integration when applied to the error associated with the Simple Simpson's formula as seen in [[media:nm1.s11.mtg17.djvu|Lecture 17]] is given by


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

$$ \displaystyle $$    (8.1)
 * style="width:98%" |
 * style="width:98%" |
 * E_n| \leq \frac{M_{n+1}}{(n+1)!} \int_a^b{|q_{n+1}(x)|dx}
 * 
 * }

Where $$ \displaystyle M_{n+1}(x):= $$ be defined as,


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

$$ \displaystyle M_{n+1}(x):=\underset{a\le x\le b}{\mathop{\max }}\,f^{(n+1)}(x)$$ (8.2)
 * style="width:98%" |
 * style="width:98%" |
 * 
 * }

Derive: The Error in the Simple Simpson's Rule
Derive the error $$ \displaystyle |E_2| $$ for the simple Simpson's rule such that $$ \displaystyle n=2 $$ and where


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

$$\displaystyle n=2 \quad \implies \quad q_3(x)=(x-x_0)(x-x_1)(x-x_2)=(x-a)(x-\frac{a+b}{2})(x-b) $$     (8.3)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Then go on to show that


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

$$ \displaystyle (8.4)
 * style="width:98%" |
 * style="width:98%" |
 * E_2| \leq \frac{M_{3}}{3!} \int_a^b{|q_{3}(x)|dx} = \frac{192}{{M}_{3}}$$
 * 
 * }

Solution
To find the bounded error for $$\displaystyle \left| {{E}_{2}} \right|$$ one can simply expand the polynominal in the integrand of (8.4) and integrate, as shown here.

Since function $$\displaystyle g(x)=\left| (x-a)(x-\frac{a+b}{2})(x-b) \right|$$ is symmetric with respect to $$\displaystyle x=\frac{a+b}{2}$$(from the fact $$\displaystyle g(\frac{a+b}{2}+t)=g(\frac{a+b}{2}-t)$$), then we use this property to eliminate the absolute value sign.

Then we have ,

The length of the panel is $$\displaystyle h=\frac{b-a}{2}$$, so we can write the solution like,