1
$\begingroup$

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

$\endgroup$
  • $\begingroup$ Is $x_2=0.9$ irrelevant to the problem? $\endgroup$ – Olivier Moschetta Aug 22 at 20:45
  • $\begingroup$ Part of the question was to approximate $cos(0.45)$, so I took the two most relevant points out of the three. $\endgroup$ – Convex Leopard Aug 22 at 21:28
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ thank you that makes a lot of sense! $\endgroup$ – Convex Leopard Aug 22 at 21:27
  • $\begingroup$ You're welcome :) $\endgroup$ – Scientifica Aug 23 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.