# Polynomial (evaluation - multiplication - interpolation)

• Feb 7th 2009, 06:49 PM
drthea
Polynomial (evaluation - multiplication - interpolation)
Hello, I have no idea on how to solve this problem:
Given the polynomials \$\displaystyle A=x^3 +2x -1 , B=x^2-x+3\$ evaluate them for \$\displaystyle x=-2:1:3\$
and calculate their product and its coefficients.
I need another way on doing this, instead of calculating A and B one by one
(I shouldn't use the simple method ie. \$\displaystyle x=-1: A_{-1}=(-1)^3 +2(-1) -1= -4\$ ....).
How can this be done? Thank you.
• Feb 8th 2009, 07:25 AM
HallsofIvy
Why should you not use the "simple" method?

If you really want to do it "the hard way", you can use "synthetic division":

-2) 1 0 -2 -1 ("1 0 -2 -1" are the coefficients of [tex]x^3- 2x- 1)
-2 4 -4
1 -2 2 -5 so A(x)= -5

where I brought down the first "1" to the third row then multiplied it by -2 to get the -2 in the second row and added it to 0 to get -2 in the third row, multiplied that by -2 to get the 4 in the second row, add that to -2, etc.

To multiply A and B, use the "distributive law":
\$\displaystyle (x^3- 2x- 1)(x^2- x+ 3)= x^3(x^2- x+ 3)- 2x(x^2- x+ 3)- 1(x^2- x+ 3)\$ and distribute again: \$\displaystyle (x^3)(x^2)- (x^3)(x)+ (x^3)(3)- (2x)(x^2)+ (2x)(x)- (2x)(3)- (1)(x^2)- (1)(x)+ (1)(3)\$
• Feb 8th 2009, 08:19 AM
drthea
I shouldn't use the simple method because we need a faster way on doing this
(for example, when the calculations are made by a computer
it is too slow to calculate them for a wide range of values).
I think that a way to evaluate the polynomials makes use of matrices,
the results are correct but I don't know if this is an efficient way.

This is how I have done it (see attachment)

I have done the same hor B(x) and again the results are correct.
I now have to do the multiplication and interpolation...