Jump to content

University of Florida/Egm6341/s10.team3.aks/HW3

(4)Use Error estimate for Taylor series, composite trapezoidal and composite Simpsons rule

Problem Statement

[edit | edit source]

Use Error estimate for Taylor series, composite trapezoidal and composite Simpson's rule to find n such that

  En=I−In=O(10−6)

and compare to numerical results.

Solution

[edit | edit source]
I=∫01ex−1xdx

Taylor Series

ex=∑j=0∞xjj!⇒ex−1x=∑j=1∞xj−1j!
In=∫01fn(x)dx=∫01∑j=1∞xj−1j!dx=∑j=1nxjj!j|01=∑j=1n1j!j
f(x)−fn(x)=Rn(x)=(x−x0)n(n+1)!f(n+1)(ξ) with ξ∈[0,x] and x0=0
⇒f(x)−fn(x)=xn(n+1)!f(n+1)(ξ)
En=I−In=∫01[f(x)−fn(x)]dx=∫01xn(n+1)!⏟w(x)f(n+1)(ξ(x))⏟g(x)dx
⇒g(α)∫01w(x)dx for α∈[0,1]
En=
⇒max=g(α)(n+1)!(n+1), α=e(n+1)!(n+1)
⇒min=g(α)(n+1)!(n+1), α=1(n+1)!(n+1)
n=2,E2≤.151016
n=4,E5≤.00453
n=6,E6≤6.2792X10−4
n=8,E8≤8.42X10−6

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

n=2,E2≤.151016
n=4,E5≤.00453
n=6,E6≤6.2792X10−4
n=8,E8≤8.42X10−6

We are getting same values from both analysis for Taylor series

Trapazoidal Rule

Error for Composite Trapazoidal rule is given by

|En1|≤(b−a)312n2M2


where M2=max|f(2)(ζ)| for ζε[a,b]

For the given function f(x)=ex−1x, we have


f(2)(x)=ex[x2−2x+2]−2x3


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


M2=f(2)(x=1)=e[1+2−2]−21=0.71828182


En1≤(1−0)312n2X0.71828182

E21≤.014964204

E41≤3.74105X10−3

E61≤1.662689X10−3

E81≤9.3526278X10−4

E161≤2.3381569X10−4

E321≤5.845392X10−5

E641≤1.4613481X10−5

E1281≤3.65337026X10−6

E2561≤9.1334256X10−7

Below are the results from Numerical analysis from HW 1

E21≤0.010389576

E41≤0.002602468

E81≤0.650935X10−3

E161≤162753X10−4

E321≤4.06892X10−5

E641≤1.0172X10−5

E1281≤2.54263X10−6

E2561≤6.3528X10−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

En2≤(b−a)52880n4M4

where  M4=max|f(4)(ζ)| for ζε[a,b]

For the given function f(x)=ex−1x, we have


f(4)(x)=ex[x4−4x3+12x2−24x]−24x5

The function f4(x) has maximum value at x=1

M4=e[1−4+12−24+24]−241=0.46453645


En1≤(1−0)52880n4X0.46453645

E22≤1.00810X10−5

E42≤6.300678X10−7

Below are the results from Numerical analysis from HW 1

E22≤1.06514X10−4

E42≤6.76473X10−6

We can see that we are getting order 10−6 at n=4 from both the analysis.