Here's a typical quadratic:
$$ p(x) = ax^2+bx+c. $$
We all know this quadratic can be factorised into the form
$$ p(x) = a(x-r_1)(x-r_2), $$
where $r_1$ and $r_2$ are two (not necessarily real) numbers that are called the roots: in particular, $p(r_i)=0$. Multiplying this form out gives
$$ p(x) = ax^2 -a(r_1+r_2)x + ar_1r_2. $$
This is supposed to be the same polynomial as our original $p$, so the coefficients must be the same. Hence we find
$$ r_1+r_2 = -\frac{b}{a} \qquad r_1r_2 = \frac{c}{a}; $$
these are called Vieta's formulae.
Bearing this in mind, what is this function $\Delta_p = b^2-4ac$ in terms of the roots?
$$ \Delta_p = b^2-4ac = a^2(r_1+r_2)^2 - 4a^2r_1r_2 = a^2(r_1^2+2r_1r_2+r_2^2 - 4 r_1r_2) = a^2(r_1-r_2)^2. $$
So the discriminant of the quadratic $p(x)$ is the square of the difference of its roots: it is positive if $p(x)$ two distinct real roots, zero if the roots are equal (we say that $p$ has a double root), and negative if the difference is a multiple of $i$, which occurs when $r_1$ and $r_2$ are complex.
But quadratics are easy. Can we find a similar thing that tells us when the cubic
$$ q(x) = ax^3+bx^2+cx+d = a(x-r_1)(x-r_2)(x-r_3) $$
has less than three distinct roots (so, for example, $r_1=r_3$ and it factorises to $a(x-r_1)^2(x-r_2)$)?
The answer is yes: we can define
$$\Delta_q = a^6 (r_1-r_2)^2(r_1-r_3)^2(r_2-r_3)^2,$$
which is obviously zero if (and indeed, only if) two of the $r_i$s are the same: each bracket is the square of the difference of two of the roots, and the expression contains each possible pair. But, you say, this is useless: if we knew the roots, we'd know if they were different! And you'd be correct. So the real question is whether this quantity $\Delta_q$ can be expressed in terms information we do have about $q$, namely the coefficients? The answer turns out to be yes, because
- $\Delta_q$ is a symmetric polynomial function of the roots (swapping the subscripts on the $r$s does not change its value),
- we have corresponding Vieta formulae for the coefficients of a cubic in terms of its roots,
- and there is a theorem that says that any symmetric polynomial can be written in terms of the polynomials that appear in Vieta's formulae.
The fairly gruesome expression we find is
$$ \Delta_q = b^2 c^2 - 4 a c^3 - 4 b^3 d + 18 a b c d - 27 a^2 d^2. $$
It is rather nicer if we look at $q(y-b/(3a))/a$, which has no $y^2$ term: it is of the form
$$ y^3+Py+Q, $$
which is known as a depressed cubic. This has discriminant $-4P^2-27Q^3$.
Exactly the same may be done for the quartic and higher: since there is no general formula for the root of a degree-5 or higher polynomial, the discriminant is therefore more useful. Although you can probably imagine how unpleasant the expression in terms of the coefficients becomes for a polynomial of high degree if the cubic case looks like this!
In the case of the cubic, one can determine a bit more about the roots from the value of the discriminant. A cubic with real coefficients always has a real root (it has different sign when $x$ is large and positive from when $x$ is very negative, so it must cross the $x$-axis somewhere).
- If $\Delta_q = 0$, there are at least two equal $r$s.
- If $\Delta_q < 0$, the other two roots must be complex—there is only one real root.
- If $\Delta_q > 0$, there are three distinct real roots.
One can prove these simply by considering all the possible combinations in the factorisation $q(x) =a(x-\alpha)(x^2+2bx+c)$, where $\alpha$ is the real root and the quadratic has $0$, $1$ or $2$ real roots.
Above a cubic, there are too many factors in the discriminant for it to classify the roots particularly: $x^4+1$ has positive discriminant and no real roots, for example.