|
Hi,
Every polynomial equation has a discriminant D, which is the product squared of the diferences of all pairs of roots. ( If the roots are labeled x1, x2, ... up to xn, then D = P2 where P = the product of xi - xj for i < j.) The easiest way to compute D for a cubic is to reduce the cubic to the form y3 + py = q. (To do this, divide through by the coefficient of x3 to get x3 + ax2 + bx + c = 0, then make the substitution x = y - (a/3).) The discriminant is D = -4p3 - 27 q2. The original polynomial has three real roots if D is greater or equal zero, and two imaginary roots if D is negative. (A cubic always has at lest one real root.) When D = 0 there are repeated roots.
Chris
|
|