Solution of EXAM #2 - Northern Illinois Universitydattab/math435.2009/SOLUTION_EXAM2.pdfSolution of...

5

Click here to load reader

Transcript of Solution of EXAM #2 - Northern Illinois Universitydattab/math435.2009/SOLUTION_EXAM2.pdfSolution of...

Page 1: Solution of EXAM #2 - Northern Illinois Universitydattab/math435.2009/SOLUTION_EXAM2.pdfSolution of EXAM #2 1. (a) Derive the composite Trapezoidal rule. So, the composite trapezoidal

Solution of EXAM #2 1. (a) Derive the composite Trapezoidal rule.

So, the composite trapezoidal Rule is:

The error of composite trapezoidal Rule:

(b) Determine h so that the composite Trapezoidal rule gives the value of

21

0

xe dx−∫

With an accuracy of . 710ε −=

2(1 0) ( )12

h f η ε− ′′ <

2 22| ( ) | | ( ) | | ( 2 4 ) | 2x xf e x eη −′′ ′′= = − + ⋅ ≤

72 712 12 10 6 10

max{ ( )} 2h

fεη

−−⋅ ⋅

< = =′′

× , so 47.74597 10h −< × .

Page 2: Solution of EXAM #2 - Northern Illinois Universitydattab/math435.2009/SOLUTION_EXAM2.pdfSolution of EXAM #2 1. (a) Derive the composite Trapezoidal rule. So, the composite trapezoidal

2. Approximate using Gaussian Quadrature with n=2. 21.5

1

xe dx−∫Sol: Changing of variables: 1 1[(1.5 1) (1 1.5)]

2 4x t= − + + = +

54

t

So, 14

dx dt=

22

51.5 1 ( )4 4

1 1 2 21 1

1 ( ) ( )4

txe dx e dt a f t a f t

− +−

−= = +∫ ∫

Where 25( )

4 41( )4

t

f t e− +

=

For 2n =

1 2 1a a= = ,

and the roots of the Legendre polynomial of degree 2 : 1,213

t = ±

So, 2 2

21 5 1 5( ) ( )1.5 4 44 3 4 3

1 1 2 21

1 1( ) ( )4 4

xe dx a f t a f t e e− + − +

− = + = +∫ .

(b) Construct a quadrature rule of the form:

1

0 1 21

1 1( ) ( ) (0) ( )2 2

f x dx A A f A f−

≈ − + +∫

Which is exact for all polynomial of degree 2≤ .

( ) 1f x =

1

0 111 2dx A A A

−= = + +∫ 2

( )f x x=

1

0 21

1 102 2

xdx A A−

= = − +∫

2( )f x x=

1 20 21

2 1 13 4 4

x dx A A−

= = +∫

Page 3: Solution of EXAM #2 - Northern Illinois Universitydattab/math435.2009/SOLUTION_EXAM2.pdfSolution of EXAM #2 1. (a) Derive the composite Trapezoidal rule. So, the composite trapezoidal

3. Determine an upper bound for the global error at t=1 of Euler’s Method in

solving , fromy y′ = (0) 1y = 0t = , to 1t = , 0.5h = . (Note that the exact

solution is ( ) ty t e= ).

Sol: The global error ( )| | | ( ) | ( 12

iL t aEG i i

hME y t y e )L

−= − ≤ −

Where ( , )| | 1f t yLy

∂≥ =

∂| ( ) | | |t, t e M e′′ ≤ = , 0.5h = , 1 20.5, 1t t= = y =

( ) 0.5| | ( 1) ( 1) 1.167692 2

iL t aEG

hM eE e eL

− ⋅≤ − = − = .

Page 4: Solution of EXAM #2 - Northern Illinois Universitydattab/math435.2009/SOLUTION_EXAM2.pdfSolution of EXAM #2 1. (a) Derive the composite Trapezoidal rule. So, the composite trapezoidal

4. (a) Given2 3

3( ) 12 6x xP x x= + + + , find a polynomial of degree 2 such that

is minimized. What is the minimum value?

2 ( )P x

3 21 1max | ( ) ( ) |

xP x P x

− ≤ ≤−

Sol: , 2 3 3 3( ) ( ) ( )P x P x a T x= −

3 33 3

3( ) 4 3 ( )4

T x x x T x x x= − ⇒ = − ,

So, 2 3

32 3 3 3

1 3 9( ) ( ) ( ) 1 ( ) 12 6 6 4 8 2

2x x xP x P x a T x x x x x= − = + + + − − = + + .

(b) Use Legendre polynomial of degree 2 to approximate 3( )f x x= on the [ 1 . ,1]−

Sol: , 0 0 1 1 2 2( ) ( ) ( ) ( )P x a x a x a x= Φ + Φ + Φ

Where 0 ( )xΦ , 1( )xΦ , 2 ( )xΦ are the legendre polynomial of degree 0, 1

and 2, respectively. And,

1

11 2

1

( ) ( )

( )

ii

i

x f x dxa

x dx−

Φ=

Φ

∫∫

.

0 ( ) 1xΦ = , 1( )x xΦ = , 22

1( )3

x xΦ = − ,

So,

1 3

10 1

1

x dxa

dx−

= ∫∫

,

1 3

11 1 2

1

x x dxa

x dx−

⋅= ∫∫

,

1 2 3

12 1 2 2

1

1( )31( )3

x x dxa

x dx

− ⋅=

∫.

Page 5: Solution of EXAM #2 - Northern Illinois Universitydattab/math435.2009/SOLUTION_EXAM2.pdfSolution of EXAM #2 1. (a) Derive the composite Trapezoidal rule. So, the composite trapezoidal

5. Bonus Problem

Find the best possible interpolating nodes for interpolation of ( ) xf x xe= in

using a polynomial of degree at most 2. [0,1.5]

Sol: The roots of the polynomial 33 ( ) 4 3T x x x= − are 1,2,3

30,2

x = ± .

Changing of nodes: 1.5 0 0 1.5 3 32 2 4i i ix x x

4− +

= + = + ,

So, 1 0.75x = , 2 1.39952x = , 3 0.10049x = are the best possible

interpolating nodes for interpolation of ( ) xf x xe= in using a

polynomial of degree at most 2.

[0,1.5]