# Evaluating a polynomial of degree 4, given some values of the polynomial

If $p(x)$ is a polynomial of degree 4 such that $p(2)=p(-2)=p(-3)=-1$ and $p(1)=p(-1)=1$, then find $p(0)$.

-
Since the polynomial has degree 4 it is in the form $p(x) = ax^4 + bx^3 + cx^2 + dx + e$. Now how would you figure out the coefficients? – Null Sep 2 '14 at 18:16
Have you had matrices in a class? – Paul Sundheim Sep 2 '14 at 18:18
Hint: Lagrange interpolation. – Robert Israel Sep 2 '14 at 18:44

Using a difference table, with $p(0)=c$, gives

$-1\hspace{.5 in}-1\hspace{.5 in}1\hspace{.5 in}c\hspace{.6 in}1\hspace{.5 in}-1$

$\hspace{.4 in}0\hspace{.64 in}2\hspace{.43 in}c-1\hspace{.35 in}1-c\hspace{.4 in}-2$

$\hspace{.7 in}2\hspace{.47 in}c-3\hspace{.2 in}-2c+2\hspace{.2 in}-3+c$

$\hspace{.9 in}c-5\hspace{.3 in}-3c+5\hspace{.3 in}3c-5$

$\hspace{1.1 in}-4c+10\hspace{.3 in}6c-10$

$\hspace{1.5 in}10c-20$

Then $10c-20=0\implies c=2$.

-
Very well observed! – Yves Daoust Sep 2 '14 at 20:11
@Yves Daoust Thanks - I just wanted to check that this method gave the same answer as Lagrangian interpolation. – user84413 Sep 2 '14 at 20:13

Let $\displaystyle p(x)=(Ax+B)(x-2)(x+2)(x+3)-1,$ where $A,B$ are arbitrary finite constants

$$p(0)=(+B)(-2)(+2)(+3)+1$$

Set $x=1,-1$ one by one to find $B$

-
You have $p(2)=1$ not -1 as the OP has stated. – Paul Sundheim Sep 2 '14 at 18:21
@PaulSundheim, Hope you understood the typo. Thanks for your observation – lab bhattacharjee Sep 2 '14 at 18:23
Would have been useful to explain that you first factorize $p(x)+1$, knowing three roots. – Yves Daoust Sep 2 '14 at 19:43

This is a case of Lagrangian interpolation.

$$P(x)=\sum_i\left(y_i\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}\right).$$

It is most efficiently computed using Neville's scheme.

Using the abscissas in the order $-3, -2, -1, 1, 2$, the triangle of interpolated values is: $$-1,\ -1,\ 1,\ 1,\ -1$$ $$-1,\ 3,\ 1,\ 3$$ $$5,\ \frac53,\ \frac53$$ $$\frac52,\ \frac53$$ $$\color{blue}2$$

-

Put $q(x)=p(x)-p(-x)$. Then $p$ is an odd polynomial, of degree $\leq 3$. Hence $p(x)-p(-x)=xq(x^2)$ with degree of $q\leq 1$, say $q(y)=ay+b$. We have $q(1)=q(4)=0$, hence as degree of $q$ $\leq 1$, $q=0$ and $p(x)=p(-x)$. We get $p(-3)=p(3)=-1$, and so $p(x)=c(x^2-4)(x^2-9)-1$ for a constant $c$, and we finish easily.

-

For later simplification, consider $p_1(x)=p(x)+1$, that has three known roots. We see that $p_1(x)$ is an even function, so that $p_1(x)=ax^4+bx^2+c=a(x^2)^2+bx^2+c=q(x^2)$.

$q(x^2)$ is of the second degree in $x^2$, and much easier to interpolate. We have $q(1)=2$, $q(4)=q(9)=0$, hence by Lagrange $q(0)=2\frac{(0-4)(0-9)}{(1-4)(1-9)}=3=p_1(0)$, and $p(0)=\color{blue}2$.

-