How can I find the values of $a,b,c,d$ for the equation $f(x)=ax^3+bx^2+cx+d$ ?
There are $4$ points given: $(-1,0)$, $(0,1)$, $(2,0)$, $(1,2)$.
Thanks!
How can I find the values of $a,b,c,d$ for the equation $f(x)=ax^3+bx^2+cx+d$ ?
There are $4$ points given: $(-1,0)$, $(0,1)$, $(2,0)$, $(1,2)$.
Thanks!
Hint: Since $f(-1) = 0$, we see that
$$a(-1)^3 + b(-1)^2 + c(-1) + d = 0 \implies -a + b - c + d = 0$$
Likewise, $f(0) = 1$ means that
$$0a + 0b + 0c + d = 1$$
Continue with the other two data points, and get a system of four equations for four unknowns, and solve them.
One may use Lagrange interpolation, but here it's very easy to determine $f$ as follows. From $f(-1)=f(2)=0$ we know that $f(x)=(x+1)(x-2)(rx+s)$ for some numbers $r$ and $s$. From $f(0)=1$ we derive $r=-1/2$ in a few seconds; it doesn't take longer to get $s=-1/2$ from $f(1)=2$. Hence $$f(x)=(x+1)(x-2)(-1/2x-1/2)=-\frac12(x+1)^2(x-2).$$