How would I solve this question?
Determine the equation of the polynomial function that matches the following data set.
x y
1 1
2 -3
3 5
4 37
5 105
Thanks in advance.
How would I solve this question?
Determine the equation of the polynomial function that matches the following data set.
x y
1 1
2 -3
3 5
4 37
5 105
Thanks in advance.
@zxcvbnm1216 You can determine the unique degree-4 polynomial P(x) = a4x^4 + a3x^3 + … + a_0 by constructing a system of linear equations (plug in each value of x). Your system should look something like this:
1a4 + 1a3 + 1a2 + 1a1 + a0 = 1
16a4 + 8a3 + 4a2 + 2a1 + a0 = -3
…
625a4 + 125a3 + 25a2 + 5a1 + a_0 = 105
Then solve the system (preferably with a calculator or computer) for (a4, …, a0).
thank you again @MITer94
No prob.
Did you solve the system?
Also note that the answer is not unique, but there is a unique polynomial of degree 4.
@MITer94 I actually used finite differences to solve it and I think I got it
actaully @MITer94 I do not think finite differences will work. What does _ mean? I was not too sure how you got 1a4 + 1a3 + 1a2 + 1a1 + a_0 = 1. I understand the after equal sign is the y value but I am not sure how you got the left side of the equation
@zxcvbnm1216 I am using _ for subscripts (similar to LaTeX).
The polynomial we want is of the form P(x) = a4x^4 + a3x^3 + a2x^2 + a1x + a0 where ai are constants. Because P(1) = 1, we can plug in x = 1 to get the first equation:
a4 + a3 + a2 + a1 + a_0 = 1
Same with the other given points, e.g. plug in x = 2 to get
16a4 + 8a3 + 4a2 + 2a1 + a_0 = -3
Now you have a system of five equations in five variables. While this system does have a solution in integers, I usually just use my calculator or a computer for bigger systems.
If you’re familiar with matrices, the system can be written in the form AX = B where
A =
(1 1 1 1 1)
(16 8 4 2 1)
(81 27 9 3 1)
(256 64 16 4 1)
(625 125 25 5 1)
(I am using () to denote the 5x5 matrix above)
X =
(a0)
(a1)
(a2)
(a3)
(a4)
(or more concisely written, (a0, …, a_4)^T
B = (1, -3, 5, 37, 105)^T
Then the solution to the system is X = A^(-1)*B.