Interpolation Polynomial of $\cos(x)$

interpolationlagrange-interpolationnumerical methodsnumerical-calculus

This is a question from Exercise set 3.1, Numerical Analysis by Faires and Burden:

Let $x_0 = 0$, $x_1 = 0.6$, and $x_2 = 0.9$.

Construct an interpolation polynomial of degree at most 1 for $f(x) = cos(x)$.

Relevant Equations:

$L_k(x) = \frac{x-x_i}{x_k – x_i}$

Attempt:

The polynomial can be constructed as $P_1(x) = f(x_0)L_0(x) + f(x_1)L_1(x)$, where:

$L_0(x) = \frac{x-0.6}{0-0.6} = \frac{-5x}{3} + 1$, $f(0) = 1$

$L_1(x) = \frac{x-0}{0.6-0} = \frac{-5x}{3}$, $f(0.6) =0.825333$

In the equations above, I have used the points 0 and 0.6, and have calculated the function values using radians.

Plugging these back in to the interpolation formula, I get:

$P_1(x) = -0.2911x + 1$. However, in the book it states $P_1(x) = -0.148878x + 1$.

Can someone please explain how the book answer is possible?

Thank you.

Similar question here:
Interpolation polynomial of degree at most n

Best Answer

The polynomial they gave doesn't pass neither through $(x_1,\cos(x_1))$ nor through $(x_2,\cos(x_2))$. I guess they made a mistake? Your answer is certaintly more suited to theirs.

Either way, reading the whole statement of the exercice in the book, the authors also ask to find the interpolation of degree at most 2, and then compare the precision of the approximation of $\cos(0.45)$ by both polynomials. I guess the objective of the exercise is to let the reader see how more points approximate better, although in some cases that's totally false.