text: # Using Vieta's theorem for cubic equations to derive the cubic discriminant
  
  Background:
  
  Vieta's Theorem for cubic equations says that if a cubic equation $x^3 + px^2 + qx + r = 0$ has three different roots $x_1, x_2, x_3$, then
  
  $$\begin{eqnarray*} -p &=& x_1 + x_2 + x_3 \\ q &=& x_1x_2 + x_1x_3 + x_2x_3 \\ -r &=& x_1x_2x_3 \end{eqnarray*}$$
  
  The exercise is:
  
  A cubic equation $x^3 + px^2 + qx + r = 0$ has three different roots $x_1, x_2, x_3$. Find $(x_1 - x_2)^2 (x_2 - x_3)^2 (x_1 - x_3)^2$ as an expression containing $p, q, r$.
  
  Spoiler alert: the answer is $-4p^3r - 4q^3 + p^2q - 27r^2 - 18pqr$.
  
  My question is: how am I supposed to find that without using a computer?
  
  -
  This is called "Vieta's theorem"? I thought this was just "expanding the product of three linear factors". Where'd you get that theorem name? – Patrick Da Silva Jan 29 '12 at 5:09
  This is from a book called "Algebra" by Gelfand/Shen. – Matt Gregory Jan 29 '12 at 5:14
  @PatrickDaSilva: mathworld.wolfram.com/VietasFormulas.html (I'd heard the name before, but I generally think of it as "theory of equations" or "relationship between polynomial coefficients and sums of products of polynomial roots $k$ at a time" or some such) – Isaac Jan 29 '12 at 5:59
  Also see Newton's identities and Vieta's formulas. – Sasha Jan 29 '12 at 6:55
  
  The tedious way is to expand $(x_1 - x_2)^2 (x_2 - x_3)^2 (x_1 - x_3)^2$ out completely and then write it in terms of $x_1 + x_2 + x_3$ and so forth. You are guaranteed that this is possible by the fundamental theorem of symmetric polynomials, the proof of which even gives an algorithm for doing this, but it's a pain to do by hand (although it's not a bad exercise in algebraic manipulation).
  
  A less tedious way is to argue as follows. We will first work under the assumption that $p = 0$. Now, $q, r$ are polynomials of degrees $2, 3$, and the discriminant is a polynomial of degree $6$, so the discriminant must be a linear combination of the two monomials $q^3, r^2$. Thus we can write $$\Delta = a q^3 + b r^2$$
  
  for two constants $a, b$, where $\Delta$ is the discriminant. Setting $q = -1, r = 0$ we get the polynomial $x^3 - x = 0$ with roots $0, 1, -1$. We compute that the discriminant is equal to $4$, from which it follows that $a = -4$.
  
  Setting $q = 0, r = -1$ we get the polynomial $x^3 - 1 = 0$ with roots $1, \omega, \omega^2$ where $\omega$ is a primitive third root of unity. Using the identity $$(\omega - 1)^2 = \omega^2 - 2 \omega + 1 = - 3 \omega$$
  
  we compute that the discriminant is equal to $-27$, from which it follows that $b = -27$. Thus $$\Delta = -4 q^3 - 27 r^2.$$
  
  To get from here to an arbitrary choice of $x_1, x_2, x_3$, apply the above formula to the polynomial with roots $x_1 - \frac{p}{3}, x_2 - \frac{p}{3}, x_3 - \frac{p}{3}$ and note that subtracting the same constant from each of the three roots doesn't change the discriminant.
  
  -
  My memory is failing me, but I believe I learned this argument from David Speyer somewhere (possibly here). – Qiaochu Yuan Jan 29 '12 at 6:21
  This is really cool. Thank you Qiaochu! – Matt Gregory Jan 29 '12 at 13:07
  Can you please tell me, how did you conclude that q and r are polynomials of degrees 2 and 3? And how did you get x^3-x=0 in the 3rd paragraph? I really don't understand. – Pavel Jul 7 at 19:04
explanation: The document provides a detailed explanation of how to derive the cubic discriminant using Vieta's theorem. It includes a background on Vieta's theorem for cubic equations, an exercise to find the expression for \((x_1 - x_2)^2 (x_2 - x_3)^2 (x_1 - x_3)^2\) in terms of \(p\), \(q\), and \(r\), and a solution to this exercise. The solution involves expanding the expression and using symmetric polynomials, as well as a less tedious method involving specific values of \(q\) and \(r\).
  
  The document contains a question and an answer to the question.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: # Using Vieta's theorem for cubic equations to derive the cubic discriminant
  
  Background:
  
  Vieta's Theorem for cubic equations says that if a cubic equation $x^3 + px^2 + qx + r = 0$ has three different roots $x_1, x_2, x_3$, then
  
  $$\begin{eqnarray*} -p &=& x_1 + x_2 + x_3 \\ q &=& x_1x_2 + x_1x_3 + x_2x_3 \\ -r &=& x_1x_2x_3 \end{eqnarray*}$$
  
  The exercise is:
  
  A cubic equation $x^3 + px^2 + qx + r = 0$ has three different roots $x_1, x_2, x_3$. Find $(x_1 - x_2)^2 (x_2 - x_3)^2 (x_1 - x_3)^2$ as an expression containing $p, q, r$.
  
  Spoiler alert: the answer is $-4p^3r - 4q^3 + p^2q - 27r^2 - 18pqr$.
  
  My question is: how am I supposed to find that without using a computer?
  
  -
  This is called "Vieta's theorem"? I thought this was just "expanding the product of three linear factors". Where'd you get that theorem name? – Patrick Da Silva Jan 29 '12 at 5:09
  This is from a book called "Algebra" by Gelfand/Shen. – Matt Gregory Jan 29 '12 at 5:14
  @PatrickDaSilva: mathworld.wolfram.com/VietasFormulas.html (I'd heard the name before, but I generally think of it as "theory of equations" or "relationship between polynomial coefficients and sums of products of polynomial roots $k$ at a time" or some such) – Isaac Jan 29 '12 at 5:59
  Also see Newton's identities and Vieta's formulas. – Sasha Jan 29 '12 at 6:55
  
  The tedious way is to expand $(x_1 - x_2)^2 (x_2 - x_3)^2 (x_1 - x_3)^2$ out completely and then write it in terms of $x_1 + x_2 + x_3$ and so forth. You are guaranteed that this is possible by the fundamental theorem of symmetric polynomials, the proof of which even gives an algorithm for doing this, but it's a pain to do by hand (although it's not a bad exercise in algebraic manipulation).
  
  A less tedious way is to argue as follows. We will first work under the assumption that $p = 0$. Now, $q, r$ are polynomials of degrees $2, 3$, and the discriminant is a polynomial of degree $6$, so the discriminant must be a linear combination of the two monomials $q^3, r^2$. Thus we can write $$\Delta = a q^3 + b r^2$$
  
  for two constants $a, b$, where $\Delta$ is the discriminant. Setting $q = -1, r = 0$ we get the polynomial $x^3 - x = 0$ with roots $0, 1, -1$. We compute that the discriminant is equal to $4$, from which it follows that $a = -4$.
  
  Setting $q = 0, r = -1$ we get the polynomial $x^3 - 1 = 0$ with roots $1, \omega, \omega^2$ where $\omega$ is a primitive third root of unity. Using the identity $$(\omega - 1)^2 = \omega^2 - 2 \omega + 1 = - 3 \omega$$
  
  we compute that the discriminant is equal to $-27$, from which it follows that $b = -27$. Thus $$\Delta = -4 q^3 - 27 r^2.$$
  
  To get from here to an arbitrary choice of $x_1, x_2, x_3$, apply the above formula to the polynomial with roots $x_1 - \frac{p}{3}, x_2 - \frac{p}{3}, x_3 - \frac{p}{3}$ and note that subtracting the same constant from each of the three roots doesn't change the discriminant.
  
  -
  My memory is failing me, but I believe I learned this argument from David Speyer somewhere (possibly here). – Qiaochu Yuan Jan 29 '12 at 6:21
  This is really cool. Thank you Qiaochu! – Matt Gregory Jan 29 '12 at 13:07
  Can you please tell me, how did you conclude that q and r are polynomials of degrees 2 and 3? And how did you get x^3-x=0 in the 3rd paragraph? I really don't understand. – Pavel Jul 7 at 19:04
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The document provides a detailed explanation of how to derive the cubic discriminant using Vieta's theorem. It includes a background on Vieta's theorem for cubic equations, an exercise to find the expression for \((x_1 - x_2)^2 (x_2 - x_3)^2 (x_1 - x_3)^2\) in terms of \(p\), \(q\), and \(r\), and a solution to this exercise. The solution involves expanding the expression and using symmetric polynomials, as well as a less tedious method involving specific values of \(q\) and \(r\).
  
  The document contains a question and an answer to the question.
  
  Label: question-and-answer