What is the mathematic coding sequence for this problem AKA
What is the mathematic coding sequence for this problem? (AKA MATLAB PROGRAM)
Determine the quartic f (x) = ax^(4) + bx^(3) + cx^(2) + dx + e that passes through the five points (-2:5;-62), (-1:5;-7:2), (-0:5;8:3), (1;3:7) , (3;45:7) by solving a linear system. Corroborate your result by graphing the quartic and the points on the same plot.
Solution
Given a general fourth degree equation x4 + bx3 + cx2 + dx + e = 0, you can rearrange terms to form the equation
x4 + bx3 = -cx2 - dx - e.
Now add the expression (b2/4 + 2p)x2 + bpx + p2 to both sides:
x4 + bx3 + (b2/4 + 2p)x2 + bpx + p2 = (b2/4 + 2p - c)x2 + (bp - d)x + p2 - e.
The left hand side is now a perfect square: (x2 + (b/2)x + p)2. You want to find a real number p such that the right hand side is also a square. In order for the right hand side to be a square quadratic, the discriminant must be zero. That is,
(bp - d)2 - 4(b2/4 + 2p - c)(p2 - e) = 0.
This simplifies to a cubic equation in p:
-8p3 + 4cp2 + (8e - 2bd)p + d2 - 4ce + b2e = 0.
Since every cubic equation has at least one real root, you can find a suitable value of p to resolve the quartic. After you plug in the value of p, you take the square root of both sides to create two quadratic equations. This gives you a total of four solutions
Example: Solve the quartic equation x4 - 4x3 + 5x2 - 4x + 4 = 0.
x4 - 4x3 = -5x2 + 4x - 4
x4 - 4x3 + (4 + 2p)x2 - 4px + p2 = (4 + 2p)x2 - 4px + p2 -5x2 + 4x - 4
Now solve the cubic -8p3 + 20p2 = 0. The solutions are p = 0, 0, 5/2. You can use any real value of p to plug into the quartic. For this example, we will use 0 since it is easier to work with.
x4 - 4x3 + 4x2 = -x2 + 4x - 4
sqrt(x4 - 4x3 + 4x2) = sqrt(-x2 + 4x - 4)
x2 - 2x = ±i(x - 2)
This yields two quadratic equations with complex coefficients:
x2 + (-2 + i)x - 2i = 0
x2 + (-2 - i)x + 2i = 0
Using the quadratic equation, the roots of the first equation are 2 and -i, and the roots of the second are 2 and i. These four roots are the roots of the original quartic.
