Docsity

Solution to Mathematics Exam: Numerical Integration and Differential Equations - Prof. Bis, Exams of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
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
2
1
0
x
edx
−
∫
With an accuracy of .
7
10
ε
−
=
2
(1 0) ()
12 hf
η
ε
−′′ <
22
2
| ( )| |( ) | |( 2 4 ) | 2
xx
fe xe
η
−
′′ ′′
==−+⋅
≤
7
27
12 12 10 610
max{ ( )} 2
hf
ε
η
−
−
⋅⋅
<==
′′ ×
, so 4
7.74597 10h
−
<×
.
pf3
pf4
pf5

Partial preview of the text

Download Solution to Mathematics Exam: Numerical Integration and Differential Equations - Prof. Bis and more Exams Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Solution of EXAM #

  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

(^12)

0

x e dx

−

With an accuracy of.

7 ε 10

−

h f η ε

2 2 2 | ( ) | | ( ) | | ( 2 4 ) | 2

x x

f η e x e

− ′′ (^) = ′′= − + ⋅ ≤

7 2 12 12 10^7 6 10 max{ ( )} 2

h f

ε

η

− ⋅ ⋅ − < = = ′′

× , so

4 h 7.74597 10

− < ×.

  1. Approximate using Gaussian Quadrature with n=2.

1.5 2

1

x e dx

−

Sol: Changing of variables:

[(1.5 1) (1 1.5)]

x = − t + + = +

t

So,

dx = dt

2 2

5 1.5 1 ( ) 4 4 1 1 1 1 2 2

t x e dx e dt a f t a f t

− + −

−

Where

( 5 )^2 4 4

t

f t e

− +

For n = 2

1 2

a = a = 1 ,

and the roots of the Legendre polynomial of degree 2 : (^) 1,

t = ±

So,

2 2 2

1 5 1 5 1.5 (^ )^ (^ ) 4 3 4 4 34

1 1 1 2 2

x e dx a f t a f t e e

− + − + − = + = +

(b) Construct a quadrature rule of the form:

1

0 1 2 1

f x dx A A f A f −

Which is exact for all polynomial of degree ≤ 2.

f ( ) x = 1

1

∫ − 1 1 dx^^ =^2 =^ A^0^^ +^ A^1^ + A^2

f ( ) x = x

1

1 0 2

xdx A A −

2 f ( ) x = x

1 2 0 2 1

x dx A A −

  1. (a) Given

2 3

3 ( )^1

x x P x = + x + + , find a polynomial of degree 2 such that

is minimized. What is the minimum value?

P 2 (^) ( ) x

3 2 1 1

max | ( ) ( ) | x

P x P x − ≤ ≤

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

3 3 3 3

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

So,

2 3 3 2 3 3 3

2 x x x P 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: P x ( ) = a 0 (^) Φ 0 ( ) x + a 1 Φ 1 ( ) x + a 2 (^) Φ 2 ( ) x ,

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

and 2, respectively. And,

1

1 1 2

1

i

i

i

x f x dx

a

x dx

−

−

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

2 2

Φ x = x − ,

So,

1 3

1 0 1

1

x dx

a

dx

−

−

1 3

1 1 1 2

1

x x dx

a

x dx

−

−

(^1 2 )

1

(^2 ) 2 2

1

x x dx

a

x dx

−

−

  1. Bonus Problem

Find the best possible interpolating nodes for interpolation of ( )

x f x = xe in

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

Sol: The roots of the polynomial

3 T 3 (^) ( ) x = 4 x − 3 x are (^) 1,2,

x = ±.

Changing of nodes:

x i xi xi 4

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

interpolating nodes for interpolation of ( )

x f x = xe in using a

polynomial of degree at most 2.

[0,1.5]