



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Solution of EXAM #
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
2 2 2 | ( ) | | ( ) | | ( 2 4 ) | 2
x x
− ′′ (^) = ′′= − + ⋅ ≤
7 2 12 12 10^7 6 10 max{ ( )} 2
h f
ε
η
− ⋅ ⋅ − < = = ′′
× , so
4 h 7.74597 10
− < ×.
1.5 2
1
x e dx
−
Sol: Changing of variables:
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
f ( ) x = x
1
1 0 2
xdx A A −
2 f ( ) x = x
1 2 0 2 1
x dx A A −
2 3
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
−
−
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.