# Thread: Polynomial Interpolation

1. ## Polynomial Interpolation

(3) For each of the mysterious functions below, use the given properties to find a,b,c.

(a) f(x) = ax^2+bx=c, where f(1)=3 f(0) = -1 f(1) = 2.

Now, I think I'm comfortable doing this with 3 points of f(x), but I'm confused as to how to do this with 1 or more points of f(x).
Normally, I would create an augmented matrix and plug the points in, but again I don't know what to do with the f(x) points.

(b) g(x) = asin(x) + bcos(x) +c where, g(0) = 2 g(pi)=1 g(0)=-2

(c) h(x) a +b(e^x) + c(e^-x) where, h(1)=e^2+1 , h(1) = e^2 - 1 integral of h(x)dx = e^2 from 0 to 1

Don't even know how to start with b and c...

2. ## Re: Polynomial Interpolation

a) $f(x) = a x^2 + b x + c$

$f^\prime(x) = 2 a x + b$

plug in the values given and we end up with 3 equations and since you mentioned matrix I will write them as

$\begin{pmatrix} 1 &1 &1 &| &3 \\ 0 &1 &0 &| &-1 \\ 2 &1 &0 &| &2 \end{pmatrix}\begin{pmatrix}a \\ b \\ c \end{pmatrix} = \begin{pmatrix}3 \\ -1 \\ 2\end{pmatrix}$

use your favorite form of matrix reduction to solve this for $\begin{pmatrix}a &b &c \end{pmatrix}$

(b) and (c) use essentially the same method.

3. ## Re: Polynomial Interpolation

Would the general matrix look like this:

x^2 x c | y1
2x c 0 | y2
2x c 0 | y3?

4. ## Re: Polynomial Interpolation Originally Posted by MrJank (3) For each of the mysterious functions below, use the given properties to find a,b,c.

(a) f(x) = ax^2+bx=c, where f(1)=3 f(0) = -1 f(1) = 2.

Now, I think I'm comfortable doing this with 3 points of f(x), but I'm confused as to how to do this with 1 or more points of f(x).
Normally, I would create an augmented matrix and plug the points in, but again I don't know what to do with the f(x) points.
(b) g(x) = asin(x) + bcos(x) +c where, g(0) = 2 g(pi)=1 g(0)=-2
(c) h(x) a +b(e^x) + c(e^-x) where, h(1)=e^2+1 , h(1) = e^2 - 1 integral of h(x)dx = e^2 from 0 to 1
I would find the inverse of the matrix.
$\begin{pmatrix} 1 &1 &1 \\ 0 &1 &0 \\ 2 &1 &0 \end{pmatrix}\begin{pmatrix}a \\ b \\ c \end{pmatrix} = \begin{pmatrix}3 \\ -1 \\ 2\end{pmatrix}$ See Here

5. ## Re: Polynomial Interpolation

Personally, I dislike using matrices for small sets of equations like this.

(a) f(x) = ax^2+b+ c, where f(1)=3 f(0) = -1 f(1) = 2. (You have "(a) f(x) = ax^2+bx=c" but I presume that second "=" is a typo.)

We are given that $\displaystyle f(x)= ax^2+ bx+ c$. So we know that $\displaystyle f'(x)= 2ax+ b$.

We are told that f(1)= 3. Okay, $\displaystyle f(1)= a(1^2)+ b(1)+ c= a+ b+ c= 3$.
We are told that f'(0)= -1. Okay, $\displaystyle f'(0)= 2a(0)+ b= b= -1$.
We are told that f'(1)= 2. Okay, $\displaystyle f'(1)= 2a(1)+ b= 2a+ b= 2$
So we have the three equation a+ b+ c= 3, b= -1, and 2a+ b= 2. Since b= -1, 2a+ b= 2a- 1= 2 so 2a= 3 and a= 3/2. Then a+ b+ c= 3/2- 1+ c= 1/2+ c= 2 so c= 2- 1/2= 3/2.
$\displaystyle f(x)= (3/2)x^2- x+ 3/2$.

(b) g(x) = asin(x) + bcos(x) +c where, g(0) = 2 g(pi)=1 g(0)=-2
Now g'(x)= a cos(x)- b sin(x)

g(0)= a sin(0)+ b cos(0)+ c= b+ c= 2.
g'(pi)= a cos(pi)- b sin(pi)= -a= 1.
g'(0)= a cos(0)- b sin(0)= -a= -2.
The last two equations say "a= -1" and "a= -2". Those are impossible. There is no function of that form satisfying these conditions.

(c) h(x)= a +b(e^x) + c(e^-x) where, h(1)=e^2+1 , h(1) = e^2 - 1 integral of h(x)dx = e^2 from 0 to 1.
With h(x)= a+ be^x+ ce^(-x), h'(x)= be^x- ce^(-x) and the integral is
$\displaystyle \int_0^1 a+ be^x+ c^{-x} dx= \left[ax+ be^x- ce^{-x}\right_0^1= (a+ be- \frac{c}{e})- (b- c)$.

The condition that $\displaystyle h(1)= e^2+ 1$ gives the equation $\displaystyle a+ be+ \frac{c}{e}= e^2+ 1$.
The condition that $\displaystyle h'(1)= e^2- 1$ gives the equation $\displaystyle be- \frac{c}{e}= e^2- 1$.
The condition that $\displaystyle \int_0^1 h(x) dx= e^2$ gives the condition that $\displaystyle a+ be- \frac{c}{e}- b+ c= e^2$.
Again, we have three equations to solve for a, b, and c.

6. ## Re: Polynomial Interpolation Originally Posted by MrJank Would the general matrix look like this:

x^2 x c | y1
2x c 0 | y2
2x c 0 | y3?
You are trying to find a, b and c, so you need three equations involving a, b and/or c

$\displaystyle f(x) = ax^2 + bx +c$
So, $\displaystyle f'(x) = 2ax +b$

Now $\displaystyle f(1)= a+b+c=3$

and $\displaystyle f'(0)=2a*0+b=b=-1$

and $\displaystyle f'(1)=2a*1+b=2a+b=2$

So there are your 3 equations. Now you need to solve them simultaneously (using matrices if you want, or just algebraic elimination method)