calculate cubic equation discriminant Let $p(x)=x^3+px+q$ a real polynomial.
Let $a,b,c$ the complex root of $p(x)$.
What is the easiest way to calculate $\Delta=(a-b)^2(b-c)^2(a-c)^2$ in function of $p,q$?
The result is $\Delta=-4p^3-27q^2$
Ps. $f=(x-a)(x-b)(x-c)$ and so   $a+b+c=0$; $ab+bc+ac=p$ and $abc=-q$; how to proceed?
 A: Note that
$$f(x)=(x-a)(x-b)(x-c)$$
$$f'(x)=(x-a)(x-b)+(x-a)(x-c)+(x-b)(x-c)$$
$$\boxed{f'(a)=(a-b)(a-c)}$$
and its cyclic variants.
We have that
$$\prod_\text{cyc}f'(a)=\prod_\text{cyc} (a-b)(a-c)$$
$$\prod_\text{cyc} f'(a)=-(a-b)^2(b-c)^2(a-c)^2$$
Hence, our expression is equivalent to $-f'(a)f'(b)f'(x)$
Since $f'(x)=3x^2+p$, this is equivalent to
$$-(3a^2+p)(3b^2+p)(3c^2+p)$$
$$\boxed{-(27a^2b^2c^2+9p(a^2b^2+b^2c^2+a^2c^2)+3p^2(a^2+b^2+c^2)+p^3)}$$
Using viete's, we get the following identites
1.
$$a^2b^2c^2$$
$$=(abc)^2$$
$$=(-q)^2$$
$$=q^2$$
2.
$$a^2b^2+b^2c^2+a^2c^2$$
$$=(ab+bc+ac)^2-abc(a+b+c)$$
$$=p^2-0q$$
$$=p^2$$
3.
$$a^2+b^2+c^2$$
$$=(a+b+c)^2-2(ab+bc+ac)$$
$$=0^2-2p$$
$$=-2p$$
Substituting these 3 identities into our expression gives
$$-(27q^2+9p^3-6p^3+p^3)$$
$$\boxed{-4p^3-27q^2}$$
A: If you write $V$ for the Vandermonde matrix in $a,b,c$ then your $\Delta$ is the determinant of $VV^T$, and we have
$$
VV^T
=
\begin{pmatrix}
s_0 & s_1 & s_2\\
s_1 & s_2 & s_3\\
s_2 & s_3 & s_4
\end{pmatrix}
$$
where
$$s_0=3, 
s_1=a+b+c=0, 
s_2=a^2+b^2+c^2=(a+b+c)^2-2(ab+bc+ca)=-2p,
$$
and thereafter
$$
s_{k+3}=-ps_{k+1}-qs_k.
$$
The result is immediate.
You can deal with the discrimant of all trinomials $X^n+pX+q$ in this way.
A: Let me offer you a different method which can be useful when calculating other symmetric functions of the roots.
$\Delta$ is symmetric in the roots, of total degree $6$.
In general then, where the cubic is $X^3-e_1X^2+e_2 X-e_3$, $\Delta$ must be a sum of monomials $e_1^{k_1}e_2^{k_2}e_3^{k_3}$ with $k_1+2k_2+3k_3=6$. When $e_1=0$ we must have $\Delta= A e_2^3 +B e_3^2$.
We can find $A,B$ by evaluating $\Delta$ for the two easy cubics $X^3-X$ and $X^3-1$ whose discriminants are $4$ and $-27$.
