User:Egm6341.spring-11.5.D/HW3

= Problem 1 - Find n st. $$Er^{T}\left(f_n^T\left(\frac{7 \pi }{8}\right)\right) < Er^{L}\left(f_5^L\left(\frac{7 \pi }{8}\right)\right)$$ = From (meeting 14 page 1)

Given
Taylor Series Expansion (meeting 3 page 2)

$$f_n^T(x)=f(x0)+\frac{(x-x0)^n}{n!} f^n(x0)$$

Lagringain Expansion (meeting 11 page 3)

$$f_n^L\left(x\right)=\sum _{i=0}^n f\left(x_i\right) l_{i,n}(x)$$

Where

$$l_{i,n}(x)= \prod _i^n \frac{x-xli}{xlj-xli}$$

$$ i\neq j$$ and $$xl\left(1,n\right)$$ is a set of n given points

Find
A value of n such that the error of the nth Taylor expansion is equal or less than the 5th Lagringain Expansion of the same funciton

$$\left|f\left(\frac{7 \pi }{8}\right)-f_n^T\left(\frac{7 \pi }{8}\right)\right|=\left|e_n^T\left(\frac{7 \pi }{8}\right)\right|\leq \left|f\left(\frac{7 \pi }{8}\right)-f_4^L\left(\frac{7 \pi }{8}\right)\right|=\left|e_4^L\left(\frac{7 \pi }{8}\right)\right|$$

$$f\left(x\right)=Sin\left(x\right)$$

Solution
 We solved this problem on our own 

The 5th Lagringain Interpolation Functions of $$Sin\left(x\right) $$  was calculated using 5 evenly divided data points from  $$\displaystyle 0  $$ to  $$\displaystyle 2\pi $$

$$xl=\left( \begin{array}{ccccc} 0 & \frac{\pi }{4} & \frac{\pi }{2} & \frac{3 \pi }{4} & \pi \end{array} \right)$$

Resulting in

$$f\left(x_i\right)=\left( \begin{array}{ccccc} 0 & \frac{1}{\sqrt{2}} & 1 & \frac{1}{\sqrt{2}} & 0 \end{array} \right)$$

$$l_{i,5}(x)=\left( \begin{array}{c} \frac{32 (x-\pi ) \left(x-\frac{3 \pi }{4}\right) \left(x-\frac{\pi }{2}\right) \left(x-\frac{\pi }{4}\right)}{3 \pi ^4} \\ -\frac{128 x (x-\pi ) \left(x-\frac{3 \pi }{4}\right) \left(x-\frac{\pi }{2}\right)}{3 \pi ^4} \\ \frac{64 x (x-\pi ) \left(x-\frac{3 \pi }{4}\right) \left(x-\frac{\pi }{4}\right)}{\pi ^4} \\ -\frac{128 x (x-\pi ) \left(x-\frac{\pi }{2}\right) \left(x-\frac{\pi }{4}\right)}{3 \pi ^4} \\ \frac{32 x \left(x-\frac{3 \pi }{4}\right) \left(x-\frac{\pi }{2}\right) \left(x-\frac{\pi }{4}\right)}{3 \pi ^4} \end{array} \right)$$

Error from the Lagringain Interpolation evaluated at $$ x = \frac{7 \pi }{8}$$ is

$$Er^{L}=sin\left( \frac{7 \pi }{8}\right)-f_5^L\left(x\right)$$

Where $$f_5^L\left(x\right)$$ simplifies to be $$\frac{4 (\pi -x) x \left(16 \left(2 \sqrt{2}-3\right) x^2+16 \left(3-2 \sqrt{2}\right) \pi x+\left(8 \sqrt{2}-9\right) \pi ^2\right)}{3 \pi ^4}$$

Resulting in

$$\displaystyle Er^L= 0.00148078$$

To determine the nth order of Taylor series expansion necessary to be at least as accurate as the Lagringain expansion the Taylor series was calculated one order at a time and the resulting error term comprared. The generated series is presented here:

$$f_n^T\left(\frac{7 \pi }{8}\right)=$$

$$\left( \begin{array}{l} \cos \left(\frac{\pi }{8}\right) \\ \left(x-\frac{3 \pi }{8}\right) \sin \left(\frac{\pi }{8}\right)+\cos \left(\frac{\pi }{8}\right) \\ \left(x-\frac{3 \pi }{8}\right) \sin \left(\frac{\pi }{8}\right)-\frac{1}{2} \left(x-\frac{3 \pi }{8}\right)^2 \cos \left(\frac{\pi }{8}\right)+\cos \left(\frac{\pi }{8}\right) \\ -\frac{1}{6} \left(x-\frac{3 \pi }{8}\right)^3 \sin \left(\frac{\pi }{8}\right)+\left(x-\frac{3 \pi }{8}\right) \sin \left(\frac{\pi }{8}\right)-\frac{1}{2} \left(x-\frac{3 \pi }{8}\right)^2 \cos \left(\frac{\pi }{8}\right)+\cos \left(\frac{\pi }{8}\right) \\ -\frac{1}{6} \left(x-\frac{3 \pi }{8}\right)^3 \sin \left(\frac{\pi }{8}\right)+\left(x-\frac{3 \pi }{8}\right) \sin \left(\frac{\pi }{8}\right)+\frac{1}{24} \left(x-\frac{3 \pi }{8}\right)^4 \cos \left(\frac{\pi }{8}\right)-\frac{1}{2} \left(x-\frac{3 \pi }{8}\right)^2 \cos \left(\frac{\pi }{8}\right)+\cos \left(\frac{\pi }{8}\right) \\ \frac{1}{120} \left(x-\frac{3 \pi }{8}\right)^5 \sin \left(\frac{\pi }{8}\right)-\frac{1}{6} \left(x-\frac{3 \pi }{8}\right)^3 \sin \left(\frac{\pi }{8}\right)+\left(x-\frac{3 \pi }{8}\right) \sin \left(\frac{\pi }{8}\right)+\frac{1}{24} \left(x-\frac{3 \pi }{8}\right)^4 \cos \left(\frac{\pi }{8}\right)-\frac{1}{2} \left(x-\frac{3 \pi }{8}\right)^2 \cos \left(\frac{\pi }{8}\right)+\cos \left(\frac{\pi }{8}\right) \\ \frac{1}{120} \left(x-\frac{3 \pi }{8}\right)^5 \sin \left(\frac{\pi }{8}\right)-\frac{1}{6} \left(x-\frac{3 \pi }{8}\right)^3 \sin \left(\frac{\pi }{8}\right)+\left(x-\frac{3 \pi }{8}\right) \sin \left(\frac{\pi }{8}\right)-\frac{1}{720} \left(x-\frac{3 \pi }{8}\right)^6 \cos \left(\frac{\pi }{8}\right)+\frac{1}{24} \left(x-\frac{3 \pi }{8}\right)^4 \cos \left(\frac{\pi }{8}\right)-\frac{1}{2} \left(x-\frac{3 \pi }{8}\right)^2 \cos \left(\frac{\pi }{8}\right)+\cos \left(\frac{\pi }{8}\right) \end{array} \right)$$

The resulting errors from the above Taylor series expansions evaluated at $$ x = \frac{7 \pi }{8}$$ is

$$Er^{T}=sin\left( \frac{7 \pi }{8}\right)-f_n^T\left(x\right)= \left( \begin{array}{c} 0.541196 \\ 1.14231 \\ 0.00252314 \\ 0.244677 \\ 0.0103165 \\ 0.0201805 \\ 0.000905156 \end{array} \right)$$

$$\therefore Er^{T}\left(f_7^T\left(\frac{7 \pi }{8}\right)\right) < Er^{L}\left(f_5^L\left(\frac{7 \pi }{8}\right)\right)$$

n=7

Author and proof-reader
[Author]J Davis 19:15, 11 February 2011 (UTC)

[Proof-reader]

= Problem 3 = From (meeting 15 page 1)

Given
= Problem 4 - Area of a Bifolium = From (meeting 15 page 2)

Given
The bifolium: $$\displaystyle r(t)=2sin(t)cos^{2}(t)$$, where $$\displaystyle t=[0,\pi]$$.

Find
1. Do literature search to find history and application, if any, of this classic curve. 2. Find the area of one folium,with an accuracy of $$10^{-6}$$ by:
 * 2.1 Composite trapezoidal
 * 2.2 Composite Simpson
 * 2.3 Area of triangles

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

1. Lit research 2. Area of one folium:


 * 2.1 Composite Trapezoidal
 * 2.2 Composite Simpson
 * 2.3 Area of triangles

Author and proof-reader
[Author]

[Proof-reader]