



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!




November 22, 2002
NAME (print)
(a) The three Lagrange polynomials are
L 1 (x) =
(x − x 2 )(x − x 3 ) (x 1 − x 2 )(x 1 − x 3 )
=
(x − 1)(x − 2) (0 − 1)(0 − 2)
x^2 − 3 x + 2 2
L 2 (x) =
(x − x 1 )(x − x 3 ) (x 2 − x 1 )(x 2 − x 3 )
=
(x − 0)(x − 2) (1 − 0)(1 − 2)
= −x^2 + 2x,
L 3 (x) =
(x − x 1 )(x − x 2 ) (x 3 − x 1 )(x 3 − x 2 )
=
(x − 0)(x − 1) (2 − 0)(2 − 1)
x^2 − x 2
(b) The quadratic interpolant is
F (x) = f (0)L 1 (x) + f (1)L 2 (x) + f (2)L 3 (x)
= 6
x^2 − 3 x + 2 2
x^2 − x 2 = x^2 − 4 x + 6.
(c) The weights are the easiest to compute for Lagrange interpolation. (d) The error associated with a single polynomial of high degree can be large, especially near the end points over the interval. Piecewise polynomial interpolation avoids this problem. (e) Cubic spline interpolation is a form of piecewise polynomial interpolation in which the piecewise polynomials are cubics. Continuity of the interpolant, and of its first and second derivatives, is enforced at each node.
I =
− 1
f (x) dx
takes the form Qn =
∑^ n
i=
cif (xi),
where the xi are the nodes and the ci the corresponding weights. The nodes lie in the interval [− 1 , 1], and obey − 1 ≤ x 1 < x 2 < · · · < xn− 1 < xn ≤ 1. (a) How does the node placement differ between Newton-Cotes quadrature and Gaussian quadrature? Which would you expect to be more accurate for the same number of nodes and why? (b) Take n = 3 and derive a closed Newton-Cotes formula. (c) Take n = 2 and derive a Gaussian formula.
(a) In Newton-Cotes quadrature the nodes are equally spaced, whereas in Gaussian quadrature they are optimally chosen for maximum accuracy. (b) For n = 3 the nodes for a closed formula are -1, 0 and 1. Then the approximation takes the form Q 3 = c 1 f (−1) + c 2 f (0) + c 3 f (1). The weights are derived by requiring that the formula be exact for f = 1, f = x and f = x^2. Then,
c 1 + c 2 + c 3 =
− 1
1 dx = 2,
−c 1 + c 3 =
− 1
x dx = 0,
c 1 + c 3 =
− 1
x^2 dx =
The solution of this linear system is c 1 = c 3 = 1/ 3 , c 2 = 4/ 3 , leading to the formula
Q 3 =
[f (−1) + 4f (0) + f (1)].
(c) Let the two nodes be x 1 and x 2. Then the approximation is G 2 = c 1 f (x 1 ) + c 2 f (x 2 ). The nodes and the weights are derived by requiring exactness for the polynomials 1, x, x^2 and x^3. Then,
c 1 + c 2 =
− 1
1 dx = 2,
c 1 x 1 + c 2 x 2 =
− 1
x dx = 0,
c 1 x^21 + c 2 x^22 =
− 1
x^2 dx =
c 1 x^31 + c 2 x^32 =
− 1
x^3 dx = 0.
The relevant solution is c 1 = c 2 = 1, −x 1 = x 2 = 1/
G 2 = f (− 1 /
f ′(x) = F (x, h) + ah^2 + bh^3 + · · · ,
where a, b, · · · are functions of x. (b) Suppose that for a particular value of x, F = 0.8500 for h = 0.2 and F = 0.9000 for h = 0. 1. Use Richardson’s extrapolation to compute an improved approximation.
(a) Consider the Taylor series
f (x + h) = f (x) + hf ′(x) +
h^2 2 f ′′(x) +
h^3 6 f ′′′(x) +
h^4 24 f iv^ (x) + · · ·
f (x + 2h) = f (x) + 2hf ′(x) + 4 h^2 2
f ′′(x) + 8 h^3 6
f ′′′(x) + 16 h^4 24
f iv^ (x) + · · ·.
Upon elimination of f ′′(x) we get
f (x + 2h) − 4 f (x + h) = − 3 f (x) − 2 hf ′(x) +
4 h^3 6
f ′′′(x) +
12 h^4 24
f iv^ (x) + · · · ,
whence f ′(x) = 4 f (x + h) − 3 f (x) − f (x + 2h) 2 h
h^2 3
f ′′′(x) + h^3 4
f iv^ (x) + · · ·.
Thus the approximation formula is
F (x, h) = 4 f (x + h) − 3 f (x) − f (x + 2h) 2 h and we can write f ′(x) = F (x, h) + ah^2 + bh^3 + · · · , where a =
f ′′′(x), b =
f iv^ (x).
(b) We have
f ′^ = 0 .8500 + a(0.2)^2 + b(0.2)^3 , f ′^ = 0 .9000 + a(0.1)^2 + b(0.1)^3.
Elimination of a leads to the improved result
f ′^ =
Worksheet