Académique Documents
Professionnel Documents
Culture Documents
Jitse Niesen
Question CW2.1
(a) Let x1 < x2 < . . . < xn . Write down an expression for the polynomial Lk (x) of
degree n 1 that satisfies the conditions,
(
1 if x = xk ;
Lk (x) =
0 if x = xi with i 6= k.
Hence find the equation of the polynomial P (x) of degree n 1 such that
P (x) = f (x) for x = x1 , x2 , . . . , xn .
(b) Find the polynomial that interpolates f (x) = ex through the points x1 = 0.2,
x2 = 0 and x3 = 0.2. Use this polynomial to estimate the value of f (0.15) and find
the error from the actual value.
(c) Let three interpolation points be given by x1 = h, x2 = 0 and x3 = h with h > 0.
Using the general error formula for polynomial interpolation on n points,
n
f (n) () Y
(x xk ) for some [x1 , xn ],
f (x) P (x) =
n! k=1
show that the error in quadratic interpolation for f (x) = ex on [x1 , x3 ] satisfies
h3 eh
|ex P (x)| .
9 3
Check that the error calculated in part (b) is consistent with the error formula.
Jitse Niesen
Question CW2.2
The value of a function f (x) is known at the points x1 = 0, x2 = 2 and x3 = 3, and is
given by
f (x1 ) = 1, f (x2 ) = 1 and f (x3 ) = 4.
(1)
(a) Write down the Lagrange polynomials for interpolation through the points given
in (1), and hence find the quadratic polynomial P that interpolates f at these points.
Check that P indeed satisfies P (x) = f (x) at x = x1 , x2 , x3 . Finally, use P to
approximate f (x) at x = 23 .
(b) Use piecewise linear interpolation to approximate f (x) at x = 32 .
(c) Consider a spline function of the form
(
S1 (x) = a1 (x x1 )3 + b1 (x x1 )2 + c1 (x x1 ) + d1 , if x [x1 , x2 ],
S(x) =
S2 (x) = a2 (x x2 )3 + b2 (x x2 )2 + c2 (x x2 ) + d2 , if x [x2 , x3 ].
Write down the conditions for S1 and S2 to be the natural cubic spline that interpolates f at the points given in (1). Hence, find the coefficients. Use S to approximate
f (x) at x = 23 .
(d) Use the formula for the error in polynomial interpolation to bound the error in
approximating f (x) at x = 32 for
(a) the interpolating polynomial P (x) found in part (a), and
(b) the piecewise linear interpolation function found in part (b),
assuming that f and its derivatives satisfy the following bounds for all x [0, 3]:
|f (x)| 5,
|f 0 (x)| 10,
|f 00 (x)| 20,