Can you please show an example of a Polynomial Curve-Fitting with 4 points?
Any 4 points?
Any As easy as possible please
Given the points {a, b, c, d} the polynomial P(x) = (x-a)(x-b)(x-c)(x-d) works.
How about if you're given (-1,3) (0,5) (1,-1) (2,2)
Okie dokie, do you know linear algebra/are you comfortable working with matrices?
Yes, I am. This is our upcoming topic in our class.
Perfect (otherwise this problem would be a lot harder)! In this case, a degree 3 polynomial will work, \[P(x) = a_0 +a_1x+a_2x^2+a_3x^3\] and our job is to find \[{a_0,a_1,a_2,a_3}\]
Yes.Then substitue the ff points to the polynomial?
If you can show the one already at the row echelon form, itcould be great help
Yup,yup. Since P(x) must pass through each of our points so we obtain the system P( -1 ) = 3 P( 0 ) = 5 P( 1 ) = -1 P( 2 ) = 2
I see. Please continue, sir.
K so our equations look like \[a_0 + a_1(-1)+a_2(-1)^2+a_3(-1)^3 = 3\] \[a_0+a_1(0)+a_2(0)^2 + a_3(0)^3 = 5\] \[a_0+a_1(1)+a_2(1)^2+a_3(1)^3 = -1\] \[a_0+a_1(2)+a_2(2)^2+a_3(2)^3 = 2\]
The matrix will be. 1 -1 1 -1 3 1 0 0 0 5 1 1 1 1 -1 1 2 4 8 2
In Av=b form, matrix for that would be A v = b |1 -1 -1 -1| |a_0| | 5 | |1 0 0 0| |a_1| = | 3 | |1 1 1 1| |a_2| |-1 | |1 2 2 2| |a_3| | 2 | So we just need to the inverse of A
Your way was much easier to write it lol.
i guess so. lol
I don't know how to work with inverse yet. I'm sorry
Ahh, well it's the same thing as putting the matrix A into row reduced echelon form
shouldn't the first row be 1 -1 1 -1 5?
Oh, I see.
Whoops, you are correct, I forgot to expand any of the powers, was too focused on making it look like a matrix haha
Now, we just row reduce this and we're particularly done : D |1 -1 1 -1| 5 | |1 0 0 0 | 3 | |1 1 1 1 | -1 | |1 2 4 8 | 2 |
a0 = 3.000 a1 = -4.500 a 2 = -1.000 a3 = 1.500
Is it? :D Thank you for your time sir :D
Yup yup, just sub those values back in and write your answer as \[P(x) = a_0 +a_1x+a_2x^2+a_3x^3\] and we're done :) Good job!
Thank you for your help sir :D
Join our real-time social learning platform and learn together with your friends!