To write a condition for a cubic to have 2 real roots, can I equate the fuction to its derivative? I.e let $y=ax^3+bx^2+cx+d$ $\frac{dy}{dx}=3ax^2+2bx+c$ setting y and the derivative equal to 0 gives: $ax^3+bx^2+cx+d=0$ $3ax^2+2bx+c=0 \Rightarrow 3ax^2+2bx+c=ax^3+bx^2+cx+d$ however, this equation doesn't necessarily mean the cubic and its derivative are equal when y=0. How could I change this to ensure that the repeated root occurs at y=0?
3 Answers
The discriminant is an expression designed to be 0 when the polynomial has a repeated root, and uses symmetry to be expressible in terms of only the coefficients. If the roots of $ax^3+bx^2+cx+d=0$ are given by $r_i$, then its discriminant is $\Delta=a^4(r_1-r_2)^2(r_1-r_3)^2(r_2-r_3)^2$. This is $0$ exactly when there's a repeated root, and happens to be $\boxed{18abcd-4b^3d+b^2c^2-4ac^3-27a^2d^2}$. It's similar to $\Delta=b^2-4ac$ for quadratics.
In the quadratic and cubic cases, the sign of $\Delta$ tells you a lot about the roots when the coefficients are real: If $\Delta<0$, there are two nonreal roots (in the cubic case the third root must be real). If $\Delta>0$ all roots are real and distinct. When $\Delta=0$, there's a repeated root and all roots are real.

- 23,925
-
Is the discriminant chosen this way for any degree polynomial? For instance is the discriminant 0 for an $n$-th degree polynomial with a double root? – Jeremy Upsal Dec 23 '17 at 02:25
-
@JeremyUpsal Yes, that works across degrees. From the wikipedia article: "This expression...makes immediate that if the polynomial has a multiple root, then its discriminant is zero, and that, over the reals, if all the roots are real, then the discriminant is positive." – Mark S. Dec 23 '17 at 16:16
Suppose you have the equation $$ax^3+bx^2+cx+d=0$$ and you know it has a repeated root. Then you have the derivative being zero for the same value of $x$ i.e. $$3ax^2+2bx+c=0$$
Multiply the first equation by $3$ and the second by $x$ to obtain $$3ax^3+3bx^2+3cx+3d-3ax^3-2bx^2-cx=bx^2+2cx+3d=0$$
Then also $b(3ax^2+2bx+c)-3a(bx^2+2cx+3d)=(2b^2-6ac)x+(bc-9ad)=0$, which gives you the value that $x$ must have if it is a common root.

- 100,194
You could set the sum of the squares to zero, i.e.,
$$
f(x)^2 + f'(x)^2 = 0.
$$
That'd be a sixth-degree equation, but it'd express the thing you want (at least for real coefficients).

- 93,729
-
You have to discard any non-real $x$ that satisfy that sextic, but otherwise this method will work, albeit not be too easy to handle. – Mark S. Mar 07 '15 at 13:13