(In reply to
Start of a solution by Brian Smith)
Expanding (3a^2-2pa+q)*(3b^2-2pb+q)*(3c^2-2pc+q) yields
27a^2*b^2*c^2 + q^3 - 8a*b*c*p^3
- 18a^2*b^2*c*p - 18a^2*b*c^2*p - 18a*b^2*c^2*p
+ 9a^2*b^2*q + 9a^2*c^2*q + 9b^2*c^2*q
+ 12*a^2*b*c*p^2 + 12*a*b^2*c*p^2 + 12*a*b*c^2*p^2
+ 4a*b*p^2*q + 4a*c*p^2*q + 4b*c*p^2*q
+ 3a^2*q^2 + 3b^2*q^2 + 3c^2*q^2
- 2a*p*q^2 - 2b*p*q^2 - 2c*p*q^2
- 6a^2*b*p*q - 6a*b^2*p*q - 6a^2*c*p*q - 6a*c^2*p*q - 6b^2*c*p*q - 6b*c^2*p*q
Some of factoring of individual groups reduces this sum a bit
27(abc)^2 + q^3 - 8p^3*(abc)
- 18p*(abc)*(ab+ac+bc)
+ 9q*(a^2*b^2+a^2*c^2+b^2*c^2)
+ 12*p^2*(abc)*(a+b+c)
+ 4*p^2*q*(ab+ac+bc)
+ 3*q^2*(a^2+b^2+c^2)
- 2*p*q^2*(a+b+c)
- 6*p*q*(a^2*b+a*b^2+a^2*c+a*c^2+b^2*c+b*c^2)
Now we need to head back to the original f(x) to get some equalities. f(x) = x^3-px^2+qx-r = (x-a)*(x-b)*(x-c)
p = a+b+c, q = ab+ac+bc, and r=abc are immediatly obtainable. Then a few identities and substitution get us the rest of what we need:
a^2+b^2+c^2 = (a+b+c)^2 - 2*(ab+ac+bc) = p^2-2q
a^2*b^2+a^2*c^2+b^2*c^2 = (ab+ac+bc)^2 - 2*(abc)*(a+b+c) = q^2-2pr
a^2*b+a*b^2+a^2*c+a*c^2+b^2*c+b*c^2 = (ab+ac+bc)*(a+b+c) - 3(abc) = pq-3r
Now we can substitute all these into the big expression:
27r^2 + q^3 - 8p^3*r
- 18p*r*q
+ 9q*(q^2-2pr)
+ 12*p^2*r*p
+ 4*p^2*q*q
+ 3*q^2*(p^2-2q)
- 2*p*q^2*p
- 6*p*q*(pq-3r)
Now this can be simplified, and reunited with the other side of the equality to give us
27r^2 - 18p*q*r + 4p^3*r + 4q^3 - p^2*q^2 = -1*[(a-b)(b-c)(c-a)]^2
Then one last bit of simplification gives us the answer
abs[(a-b)(b-c)(c-a)] = sqrt[-27r^2 + 18p*q*r - 4p^3*r - 4q^3 + p^2*q^2]
Note that the absolute value is necessary since permutations of the roots a,b,c can change the sign of the left-hand product whereas the right side is the positive square root.