Find $p(x)=a_1 x+a_2 x^2$ with $p(x_i)=f_i, i=0,1$

47 Views Asked by At

Given $x_0,x_1,x_0\neq x_1, x_i\neq 0, i=0,1$, and $f_0,f_1$, find $p(x)=a_1 x+a_2 x^2$ with $p(x_i)=f_i, i=0,1$. Can you say if the interpolating polynomial in this case is unique? Why? Can you write a formula similar to the Lagrange interpolation formula for this case? Explain your answer in detail and show the formula if there exists one.

My attempt:

We have $a_1 x_0+a_2 x_0^2=f_0$ and $a_1 x_1+a_2 x_1^2=f_1$.

So we only need to solve the above two equations to obtain $a_1, a_2$.

In my opinion, it is unique since there are two equations and two unknowns.

And $a_1=\frac{f_0x_1^2-f_1x_0^2}{x_0x_1(x_1-x_0)}, a_2=\frac{f_0x_1-f_1x_0}{x_0x_1(x_0-x_1)}$

I am really not sure if this is right. Could anyone kindly help? Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

You are correct up to a sign. You have the system of equations

$$ \begin{pmatrix} x_0 & x_0^2 \\ x_1 & x_1^2 \end{pmatrix} \begin{pmatrix} a_1 \\ a_2 \end{pmatrix} = \begin{pmatrix} f_0 \\ f_1 \end{pmatrix}. $$

The system has a unique solution because the determinant of the matrix on the left hand side of the equation is $x_0 x_1^2 - x_0^2 x_1 = x_0 x_1 (x_1 - x_0)$ and it doesn't vanish by assumption. The unique solutions are given by Cramer's rule and are

$$ a_1 = \frac{f_0 x_1^2 - f_1 x_0^2}{x_0 x_1 (x_1 - x_0)}, \\ a_2 = \frac{f_1 x_0 - f_0 x_1}{x_0 x_1 (x_1 - x_0)}. $$