Problem Set 8
Problem Set 8
Problem Set 8
Schwendeman
Numerical Computing
Problem Set 8
Due:
Monday, 4/21/14
1. Find the coefficients of the quadrature using Lagrange basis and consider
Z
3h
(xh)(x3h)
(0h)(03h)
(xh)(x3h)
3h2
2 (x) =
(x0)(x3h)
(h0)(h3h)
x(x3h)
2h2
3 (x) =
(x0)(xh)
(3h0)(3hh)
x(xh)
6h2
3h
(a) Find the coefficients 1 2 such that the quadrature is exact for zeroth and first order
polynomial.
It is not hard to come up with the following:
1 + 2 = 3h,
01 + 2h2 =
forf (x) = 1
9h2
2
, forf (x) = x
E = 9h3 4h2 = 0,
81 4 9
9
E = h h8h3 = h4
4
4
4
243
9
63
5
4
E =
h h16h = h5 ,
5
4
5
for f (x) = x2
for f (x) = x3
for f (x) = x4
From the above calculation we can see that E = 0 for f (x) = 1, x, x2 , and therefore
p = 2.
3
5
4 000
000
Also, when f (x) = x3 E = 63
5 h = Ch f (x) and f (x) = 6 C = 8
3. Text exercises 4 and 5, page 278
We shall combine the two questions in each case.
Note that for question 4, we shall use the formula
b
f (x)dx =
f(
1
(b a)t + b + a b a
)
dt
2
2
And for the Gaussian Quadrature using three nodes, we shall use the formula, for the
converted integral
Z
1
where 1 = 95 , 2 = 0, 3 =
a
R4
R1
R1
R3
x
dx
x2 +9
x3
0 x2 +1 dx
0
1
xex dx =
R1
5
9
q
q
and x1 = 35 , x2 = 0, x3 = 35 .
4t+4
dt
4t2 +8t+13
t3 +3t2 +3t+1
1 4(t2 +2t+5) dt
R1
R1
1
x2 ln xdx =
t+1 t+1
2 dt
4 e
R1
1 (t
1.999825193
0.153406998
0.999994630
4. Estimate the subintervals needed so that the absolute error in the numerical quadrature
is less than 104 .
Note that
f (x) =
x
1
2
f 0 (x) =
f 00 (x) =
2
x+1
(x + 1)
(x + 1)3
E=|
(2 ( 12 ) 2
(b a) 2 00
2
h f ()| = |
h
|
24
24
( + 1)3
5
2
24
h2
5
2
4
3
2
|
<
10
h
<
7.746
10
m
=
> 322.75 m = 323
h
( 12 + 1)3
The exact solution is 0.27320770837919 and one can verify that our code works pretty
well for all three values of m.