# Discriminant of cubic equation in terms of coefficients

1. Background/theory

We know that if the equation x3+px2+qx+r=0 has solutions x1, x2, x3 then

x1 + x2 + x3 = -p
x1x2 + x2x3 + x3x1 = q
x1x2x3 = -r

2. Problem statement

Find (x1 - x2)2(x2 - x3)2(x3 - x1)2 as an expression containing p,q,r.

That is, I'm supposed to find the discriminant of the above cubic equation in terms of its coefficients.

## The Attempt at a Solution

Now, I have approached the problem in two ways. First, I expanded the whole expression out and tried to manipulate the expression to get it in the desired terms. It is a very lenthy and laborious process though and I had trouble getting the right expression. So there must be some more elegant solution to this problem than just multiplying the expression out and manipulate it.

My best attempt at a "more elegant" solution was to reason as follows:

When we expand the expression (x1 - x2)2(x2 - x3)2(x3 - x1)2 we get a polynomial with terms of degree 6 in x1, x2, x3. Now, p has degree 1, q has degree 2 and r has degree 6 so the possible terms in the expression is:

p6, q3, r2, pqr, p3r, p4q, p2q2.

So we can write:

(x1 - x2)2(x2 - x3)2(x3 - x1)2 = Ap6 + Bq3 + Cr2 + Dpqr + Ep3r + Fp4q + Gp2q2 where A,...,G are constants.

Then I tried to determine A,...,G by finding cubic polynomials with given roots and thus given values of the discriminant and p, q, r. I easily determined the terms -27r2 and -4q3 by just letting p=0 but when I tried to determine the other constants I got wierd numbers like A=770,4 and G=87,7 etc, whereas I expected those constants to be zero (since the discriminant does not contain p2q2, for instance). I can't explain why...

I am grateful for any guidance here! Also, I apologize for possible language errors, English is not my native.

Related Precalculus Mathematics Homework Help News on Phys.org
mfb
Mentor
Then I tried to determine A,...,G by finding cubic polynomials with given roots and thus given values of the discriminant and p, q, r. I easily determined the terms -27r2 and -4q3 by just letting p=0 but when I tried to determine the other constants I got wierd numbers like A=770,4 and G=87,7 etc, whereas I expected those constants to be zero (since the discriminant does not contain p2q2, for instance). I can't explain why...
I guess you made a calculation error somewhere, the approach looks possible (but not very elegant - you have to hope that the expression can be expressed like that, you do not show it).

I guess you made a calculation error somewhere, the approach looks possible (but not very elegant - you have to hope that the expression can be expressed like that, you do not show it).
Well, I gave the argument that in terms of p, q, r, the listed terms are the only possible terms in the expression. So if there is an expression in p, q, r, it must consist of some collection of one or more of those terms. Isn't that enough?

mfb
Mentor
So if there is an expression in p, q, r
That's the point - you just assume this (it is right here).

That's the point - you just assume this (it is right here).
Yes, but it's more or less assumed in the problem statement. The author of the textbook has written: "Find (x1 - x2)2(x2 - x3)2(x3 - x1)2 as an expression containing p, q, r." I think it implies that I may assume that there is such an expression.

Perhaps it's not very elegant then but I still think it's O.K. given the level of the problem. Thanks for pointing it out though, I see that it's definitely not something obvious to assume...

Last edited:
epenguin
Homework Helper
Gold Member
First, I expanded the whole expression out and tried to manipulate the expression to get it in the desired terms. It is a very lenthy and laborious process though and I had trouble getting the right expression. So there must be some more elegant solution to this problem than just multiplying the expression out and manipulate it.
It doesn't have to be as difficult as all that. Essential feature of it is its symmetry. Look at both your discriminant expression and your equations for coefficients and notice they are unchanged by any exchange of the roots in the expressions, such as exchanging x1 and x3.

Ʃx1 = x1 + x2 + x3 = -p
Ʃx1x2 = x1x2 + x2x3 + x3x1 = q
Ʃx1x2x3 = x1x2x3 = -r

Here I'm using the convenient 'Ʃ notation' I hope is obvious.

When you expand your expression every term is going to be of form aijkx1ix2jx3j where aijk is a coefficient (integer) and i+j+k = 6 .

Now once you have got the coefficient of a term, say for example of x13x22x3 the symmetry tells you the coefficient of x12x23x3 is exactly the same, and that of x13x2x32 is the same too. You don't have to work them out separately. And there are 6 of them but you can write them down all together as just Ʃx13x22x3. Or rather if I am right that the coefficient is 2 in your expression as 2Ʃx13x22x3.

So the first stage is writing all your terms and overall expression down like that.

The second stage is putting that in terms of your p, q, r (which actually a theorem says you can always do for any degree polynomial). You may recognise one like a222x12x22x32 term that you'll know how to relate. Others, most, need a bit more work but are not all that difficult. If you get stuck at that stage come back and show how far you got.

Beware of superficial misunderstanding of the Ʃ notation and do not be misled into thinking say x1 or Ʃx1 is a factor Ʃx1x2, you may have to rewrite terms out explicitly till you get used to it.

More explanations are certainly in the next section or chapter of your textbook under some title like 'symmetric polynomials'.

Last edited:
epenguin
Homework Helper
Gold Member
For the first step you have only five coefficients to work out!

Last edited:
This is really interersting epenguin. My textbook doesn't seem to cover the idea of symmetry - or it doesn't mention anything about it explicitly I should say because when I think about it, I have definitely encountered some symmetrical expressions earlier in the book. (Perhaps it wants the reader to figure it out by oneself or later as one learn more mathematics.) Where can I learn more about this?

And regarding the solution of the problem, I mentioned in the first post that I tried to expand the expression and write it in the desired terms, however unsuccessfully. What I didn't mention was that I was very close! I got the terms right in p, q, r but the coefficients was wrong. However, the coefficients of the expanded expression was not a problem I think because I noticed immediately when there where any "irregularities" (somehow I expected the expression to be "regular", in the way you describe it in your post), went backed and checked and coreccted my error. I must have screwed up when I tried to apply some algebraic identities in the manipulation process. I'll go back and see where I screwed up but it's two full pages of algebraic manipulations and I'm getting sick and tired by just looking at it right now. :tongue2: Perhaps I'll give the problem a new try later by applying what you just taught me and see if it goes smoother!

Dick
Homework Helper
This is really interersting epenguin. My textbook doesn't seem to cover the idea of symmetry - or it doesn't mention anything about it explicitly I should say because when I think about it, I have definitely encountered some symmetrical expressions earlier in the book. (Perhaps it wants the reader to figure it out by oneself or later as one learn more mathematics.) Where can I learn more about this?

And regarding the solution of the problem, I mentioned in the first post that I tried to expand the expression and write it in the desired terms, however unsuccessfully. What I didn't mention was that I was very close! I got the terms right in p, q, r but the coefficients was wrong. However, the coefficients of the expanded expression was not a problem I think because I noticed immediately when there where any "irregularities" (somehow I expected the expression to be "regular", in the way you describe it in your post), went backed and checked and coreccted my error. I must have screwed up when I tried to apply some algebraic identities in the manipulation process. I'll go back and see where I screwed up but it's two full pages of algebraic manipulations and I'm getting sick and tired by just looking at it right now. :tongue2: Perhaps I'll give the problem a new try later by applying what you just taught me and see if it goes smoother!

This is a very interesting sort of problem. There is a theorem that any symmetric polynomial like yours is a polynomial expression in the elementary symmetric polynomials (x1+x2+x3), (x1*x2+x2*x3+x1*x3) and x1*x2*x3 that define your p, q and r. So you don't have to assume that there is one. There is a proof that there is. And one of the ways of proving that is an algorithm to construct a solution. http://en.wikipedia.org/wiki/Elementary_symmetric_polynomial

Using the algorithm, I managed to get the answer. It took a while (both to understand the algorithm and to lay out the solution). I might not have attempted it if I didn't have a CAS (computer algebra system) to do the actual work. I used maxima. It is tedious and error prone. But it is fun to see it finally work. And maybe there is a clever way to bypass the tedium but I'm not seeing it yet. Maybe have a look back... And maybe epenguin has something simpler in mind.

Last edited:
Dick
Homework Helper
For the first step you have only five coefficients to work out!
Ah, right. I'm looking back now. So p^6 and p^4*q can't be in the solution. So picking five different (x1,x2,x3) combinations in the right way should give you five linearly independent equations to solve for the coefficients. Still pretty complex. But probably easier than hacking through the polynomial expansions.

And ok, now that I'm done amusing myself I note the OP already correctly has the terms -27r^2 and -4q^3. This is starting to seem easier and easier. Now there's only three variables to determine. I think Dowland was already on the right track and just made a mistake. The coefficents aren't weird, they are all integers. And p^2*q^2 is in the answer. Why does Dowland think it isn't? Maybe that's the mistake.

Last edited:
Ah, right. I'm looking back now. So p^6 and p^4*q can't be in the solution. So picking five different (x1,x2,x3) combinations in the right way should give you five linearly independent equations to solve for the coefficients. Still pretty complex. But probably easier than hacking through the polynomial expansions.

And ok, now that I'm done amusing myself I note the OP already correctly has the terms -27r^2 and -4q^3. This is starting to seem easier and easier. Now there's only three variables to determine. I think Dowland was already on the right track and just made a mistake. The coefficents aren't weird, they are all integers. And p^2*q^2 is in the answer. Why does Dowland think it isn't? Maybe that's the mistake.
I have tried it twice and have deduced the five equations further down by the following method:
1. Construct a polynomial of degree 3 and compute its discriminant Δ. (I have constructed polynomials where P=-1 in every polynomial.)
2. Set Δ=Ap6 - 4q3 - 27r2 + Dpqr + Ep3r + Fp4q + Gp2q2.
3. Compue the terms -4q3, -27r2 and move them over to the left hand side of the equation.

320=A+16D-4E-4F+16G
1575=A+81D-9E-9F+81G
4208=A+256D-16E-16F+256G
11975=A+625D-25E-25F+625G
24768=A+1296D-36E-36F+1296G

This gives wierd non-integer values for some of the unknowns.

This is a very interesting sort of problem. There is a theorem that any symmetric polynomial like yours is a polynomial expression in the elementary symmetric polynomials (x1+x2+x3), (x1*x2+x2*x3+x1*x3) and x1*x2*x3 that define your p, q and r. So you don't have to assume that there is one. There is a proof that there is. And one of the ways of proving that is an algorithm to construct a solution. http://en.wikipedia.org/wiki/Elementary_symmetric_polynomial

Using the algorithm, I managed to get the answer. It took a while (both to understand the algorithm and to lay out the solution). I might not have attempted it if I didn't have a CAS (computer algebra system) to do the actual work. I used maxima. It is tedious and error prone. But it is fun to see it finally work. And maybe there is a clever way to bypass the tedium but I'm not seeing it yet. Maybe have a look back... And maybe epenguin has something simpler in mind.
Very interesting, thank you for the link! This looks like quite profound mathematical theory above my level and my brain is going berserk trying to read it haha... But it's nice to know that there is a theorem that supports my assumption although I don't understand it yet.

Dick
Homework Helper
I have tried it twice and have deduced the five equations further down by the following method:
1. Construct a polynomial of degree 3 and compute its discriminant Δ. (I have constructed polynomials where P=-1 in every polynomial.)
2. Set Δ=Ap6 - 4q3 - 27r2 + Dpqr + Ep3r + Fp4q + Gp2q2.
3. Compue the terms -4q3, -27r2 and move them over to the left hand side of the equation.

320=A+16D-4E-4F+16G
1575=A+81D-9E-9F+81G
4208=A+256D-16E-16F+256G
11975=A+625D-25E-25F+625G
24768=A+1296D-36E-36F+1296G

This gives wierd non-integer values for some of the unknowns.
If you think about it, you'll never get a power of any single variable that's greater than four out of your polynomial. That means you don't need Ap^6 and Fp^4q in there, and there's really only three variables.What values of x1,x2 and x3 are you using?

epenguin
Homework Helper
Gold Member
I don't say there is only one way to do it.

(x1 - x2)2(x2 - x3)2(x3 - x1)2

I mentioned that the terms when expanding this are all of

aijkx1ix2jx3j where aijk is a coefficient (integer) and i+j+k = 6

and there are just 5 such terms.

It is easy to wrtie down the five ijk combinations. Not too hard to find the coefficients. No one has tried this yet, so if you get stuck you can.

Last edited:
Dick
Homework Helper
I don't say there is only one way to do it.

(x1 - x2)2(x2 - x3)2(x3 - x1)2

I mentioned that the terms when expanding this are all of

aijkx1ix2jx3j where aijk is a coefficient (integer) and i+j+k = 6

and there are just 5 such terms.

It is easy to wrtie down the five ijk combinations. Not too hard to find the coefficients. No one has tried this yet, so if you get stuck you can.
Why do you think there are 5 terms in the expansion? I count 19.

epenguin
Homework Helper
Gold Member
Why do you think there are 5 terms in the expansion? I count 19.
I'm sorry, I missed out the Ʃ in a formula, the post had been tricky typographically to write and I think I deleted the symbol by mistake.

In the sense of the Ʃ notation of #6.

A phrase in #6 should read:

aijkƩx1ix2jx3j where aijk is a coefficient (integer) and i+j+k = 6

I say there are just five such terms.

Dick
Homework Helper
I'm sorry, I missed out the Ʃ in a formula, the post had been tricky typographically to write and I think I deleted the symbol by mistake.

In the sense of the Ʃ notation of #6.

A phrase in #6 should read:

aijkƩx1ix2jx3j where aijk is a coefficient (integer) and i+j+k = 6

I say there are just five such terms.
Ok, I see what you are saying. The 'sum' here means sum over all permutations of i,j,k. So then, yes, there are 5. ijk=420,411,330,321,222. So you get those coefficients, then go and figure out what the contributions are to each from 5 possible terms r^2, pqr, p^3r, q^3, p^2q^2 (this is where it might get complicated) and match them up in a system of 5 linear equations in 5 unknowns. Sounds complicated, but certainly doable.

But practically I think Dowland should just stick to what I assume is the original program and pick enough numerical values of x1,x2,x3 and plugging them into both sides of the equation to get a system of linear equations. Dowland already has two coefficients and counting correctly there are only 3 left. It worked out pretty easily for me. I just think there may be numerical mistakes in the the equations derived.

Last edited:
epenguin
Homework Helper
Gold Member
Ok, I see what you are saying. The 'sum' here means sum over all permutations of i,j,k. So then, yes, there are 5. ijk=420,411,330,321,222. So you get those coefficients, then go and figure out what the contributions are to each from 5 possible terms r^2, pqr, p^3r, q^3, p^2q^2 (this is where it might get complicated) and match them up in a system of 5 linear equations in 5 unknowns. Sounds complicated, but certainly doable.

But practically I think Dowland should just stick to what I assume is the original program and pick enough numerical values of x1,x2,x3 and plugging them into both sides of the equation to get a system of linear equations. Dowland already has two coefficients and counting correctly there are only 3 left. It worked out pretty easily for me. I just think there may be numerical mistakes in the the equations derived.
Yes he would do well to do that, since you have found it can be done, as it is an original approach.

I only said if you expand the discriminant (x1 - x2)2(x2 - x3)2(x3 - x1)2 you get an expression made up of the five Ʃs and integers. The expressions for p, q, r are also Ʃs. They are different Ʃs than the 6-degree ones of the discriminant, but the latter can be expressed in terms of the former without too much difficulty.

Last edited:
Dick
Homework Helper
Yes he would do well to do that, since you have found it can be done, as it is an original approach.

I only said if you expand the discriminant (x1 - x2)2(x2 - x3)2(x3 - x1)2 you get an expression made up of the five Ʃs and integers. The equations for p, q, r are also Ʃs. They are different Ʃs than the 6-degree ones of the discriminant, but the latter can be expressed in terms of the former without too much difficulty.
I agree. I didn't actually do it your way, so I'm really not sure how complicated it would get. But Dowland is already pretty close. Putting x1=1, x2=1, x3=0, gives you one of the 3 unknown coefficients directly. It looks downhill from there.

epenguin
Homework Helper
Gold Member
So we can write:

(x1 - x2)2(x2 - x3)2(x3 - x1)2 = Ap6 + Bq3 + Cr2 + Dpqr + Ep3r + Fp4q + Gp2q2 where A,...,G are constants.
Then later on you write "there cannot be any p6 term".

I hope you are not concluding from the fact that there is no x16 term that A = 0 ?

It does give you some relation between the constants though, so I think you could reduce the number of them.

I trust you are using special cases so as to reduce the number of unknowns to be solved for at a time?

Ah, I see that is what Dick is saying.

Dick
Homework Helper
Then later on you write "there cannot be any p6 term".

I hope you are not concluding from the fact that there is no x16 term that A = 0 ?

It does give you some relation between the constants though, so I think you could reduce the number of them.

I trust you are using special cases so as to reduce the number of unknowns to be solved for at a time?

Ah, I see that is what Dick is saying.
But I think you can conclude that. p^6 is the only term that can give you an x1^6 contribution and there isn't one. So its coefficient must be 0. Likewise p^4q isn't going to work.

epenguin
Homework Helper
Gold Member
But I think you can conclude that. p^6 is the only term that can give you an x1^6 contribution and there isn't one. So its coefficient must be 0. Likewise p^4q isn't going to work.
Oops yes, I was thinking without examining that there would be another term that could give x6 that might for instance have coefficient equal to -A, but examining the terms you are right that there isn't one. So A = 0

And there is another term that is 0 for similar reasons if I am not mistaken.

Office_Shredder
Staff Emeritus
Gold Member
I noticed something that saves a bit of algebra in the problem by doing some of the factorization for you if you have calculus at your disposal. If
$$f(x) = (x-x_1)(x-x_2)(x-x_3)$$
then
$$f'(x) = (x-x_1)(x-x_2) + (x-x_1)(x-x_3) + (x-x_2)(x-x_3)$$
and
$$f'(x_1) = (x_1-x_2)(x_1-x_3),\ f'(x_2) = (x_2-x_3)(x_2-x_1),\ f'(x_3) = (x_3-x_2)(x_3-x_1)$$
which means
$$(x_1-x_2)^2 (x_1-x_3)^2 (x_2-x_3)^2 = -f'(x_1)f'(x_2)f'(x_3)$$
You still can't evaluate the derivatives without having some xis involved, but if you group up things in the multiplication in the obvious way then this has basically taken care of the hard half of the work for you (since many p's and q's have been factored out for you already). From this I was able to do the remaining algebra in about a minute by just examining the remaining expressions and guessing what they were in terms of p,q and r.

If you think about it, you'll never get a power of any single variable that's greater than four out of your polynomial. That means you don't need Ap^6 and Fp^4q in there, and there's really only three variables. What values of x1,x2 and x3 are you using?
Ah, this makes sense! I honestly think that I reasoned like this for a minute buth dismissed the argument because I argued something like this: sometimes when you factor an expression you rewrite it by adding and subtracting terms - what says you won't add any terms where the variables have powers of 6? But when factoring an expression it doesn't make sense adding and subtracting variables with higher powers than the already given variables, right?

However, I solved the problem now by assuming that p6 and p4q can't be terms in the expression. It went fairly simple and smooth by using special cases, like letting p=0, r=0, q=0 etc. Thanks so much for your help epenguin and Dick!

One thing I still don't understand is why my first method (as shown in post #1) didn't work, when I had all seven terms in the expression? I really don't think I messed up the numbers anywhere.

Then later on you write "there cannot be any p6 term".

I hope you are not concluding from the fact that there is no x16 term that A = 0 ?
I don't think I understand. On what basis do you exclude the possibility of a p6 term? You say that when expanding the expression we get aijkƩx1ix2jx3k where aijk is a coefficient (integer) and i+j+k = 6. But that doesn't exclude the possibility of the case where i=6, j=0, k=0?