$f(x) = x^3 + 2x^2 + x + 1$. Find a polynomial of degree $4$ that interpolates the values of $f$ at $x = -2, -1, 0, 1, 2$.
I was trying to use the Langrange algorithm, but I think i'm doing it wrong as I'm not getting a correct answer.
$f(x) = x^3 + 2x^2 + x + 1$. Find a polynomial of degree $4$ that interpolates the values of $f$ at $x = -2, -1, 0, 1, 2$.
I was trying to use the Langrange algorithm, but I think i'm doing it wrong as I'm not getting a correct answer.
Copyright © 2021 JogjaFile Inc.
The polynomial is $$P_4(x)=\frac{(x+1)(x-0)(x-1)(x-2)}{(-1)(-2)(-3)(-4)}f(-2)+\\ \frac{(x+2)(x-0)(x-1)(x-2)}{(1)(-1)(-2)(-3)}f(-1)+\\ \frac{(x+2)(x+1)(x-1)(x-2)}{(2)(1)(-1)(-2)}f(0)+\\ \frac{(x+2)(x+1)(x-0)(x-2)}{(3)(2)(1)(-1)}f(1)+\\ \frac{(x+2)(x+1)(x-0)(x-1)}{(4)(3)(2)(1)}f(2)$$