ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 30 Apr 2017 10:18:43 +0200how to check algebraic equations?https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/So, i got a different cubic formula for the depressed equation than that was there in the standard formula from a book.
$y^3+fy+g=0 $ has the solution
$ ({-g+\sqrt {g^2/4+f^3/27} })^{1/3} + ({-g-\sqrt {g^2/4+f^3/27} })^{1/3} $
$
\\left\\{y : -\frac{f}{3 \, {\left(-\frac{1}{2} \, g + \frac{1}{6} \,
\sqrt{\frac{4}{3} \, f^{3} + 9 \, g^{2}}\right)}^{\frac{1}{3}}} +
{\left(-\frac{1}{2} \, g + \frac{1}{6} \, \sqrt{\frac{4}{3} \, f^{3} + 9
\, g^{2}}\right)}^{\frac{1}{3}}\\right\\}
$
So I want to check the algebraic equivalence of these two equations step by step, and how I can convert the first equation into the second, as they are both the same.
This is like checking algebra formulas like $(a+b)^2=a^2+b^2+2ab$
If nothing else, i want to just check True or False, just like with numbers, but equations instead.Tue, 25 Apr 2017 12:36:30 +0200https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/Comment by screened00 for <p>So, i got a different cubic formula for the depressed equation than that was there in the standard formula from a book.
$y^3+fy+g=0 $ has the solution</p>
<p>$ ({-g+\sqrt {g^2/4+f^3/27} })^{1/3} + ({-g-\sqrt {g^2/4+f^3/27} })^{1/3} $ </p>
<p>$
\left\{y : -\frac{f}{3 \, {\left(-\frac{1}{2} \, g + \frac{1}{6} \,
\sqrt{\frac{4}{3} \, f^{3} + 9 \, g^{2}}\right)}^{\frac{1}{3}}} +
{\left(-\frac{1}{2} \, g + \frac{1}{6} \, \sqrt{\frac{4}{3} \, f^{3} + 9
\, g^{2}}\right)}^{\frac{1}{3}}\right\}
$</p>
<p>So I want to check the algebraic equivalence of these two equations step by step, and how I can convert the first equation into the second, as they are both the same.</p>
<p>This is like checking algebra formulas like $(a+b)^2=a^2+b^2+2ab$
If nothing else, i want to just check True or False, just like with numbers, but equations instead.</p>
https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37416#post-id-37416latex rendering is not working properly here, but on sagemath software in the text-rich cell the same code works fine, so please understand.Tue, 25 Apr 2017 12:37:36 +0200https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37416#post-id-37416Comment by mforets for <p>So, i got a different cubic formula for the depressed equation than that was there in the standard formula from a book.
$y^3+fy+g=0 $ has the solution</p>
<p>$ ({-g+\sqrt {g^2/4+f^3/27} })^{1/3} + ({-g-\sqrt {g^2/4+f^3/27} })^{1/3} $ </p>
<p>$
\left\{y : -\frac{f}{3 \, {\left(-\frac{1}{2} \, g + \frac{1}{6} \,
\sqrt{\frac{4}{3} \, f^{3} + 9 \, g^{2}}\right)}^{\frac{1}{3}}} +
{\left(-\frac{1}{2} \, g + \frac{1}{6} \, \sqrt{\frac{4}{3} \, f^{3} + 9
\, g^{2}}\right)}^{\frac{1}{3}}\right\}
$</p>
<p>So I want to check the algebraic equivalence of these two equations step by step, and how I can convert the first equation into the second, as they are both the same.</p>
<p>This is like checking algebra formulas like $(a+b)^2=a^2+b^2+2ab$
If nothing else, i want to just check True or False, just like with numbers, but equations instead.</p>
https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37417#post-id-37417sometimes this is because the backslash is used as escape character: try adding some double backslashes, as in `\\left\{` or similarTue, 25 Apr 2017 12:42:37 +0200https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37417#post-id-37417Comment by screened00 for <p>So, i got a different cubic formula for the depressed equation than that was there in the standard formula from a book.
$y^3+fy+g=0 $ has the solution</p>
<p>$ ({-g+\sqrt {g^2/4+f^3/27} })^{1/3} + ({-g-\sqrt {g^2/4+f^3/27} })^{1/3} $ </p>
<p>$
\left\{y : -\frac{f}{3 \, {\left(-\frac{1}{2} \, g + \frac{1}{6} \,
\sqrt{\frac{4}{3} \, f^{3} + 9 \, g^{2}}\right)}^{\frac{1}{3}}} +
{\left(-\frac{1}{2} \, g + \frac{1}{6} \, \sqrt{\frac{4}{3} \, f^{3} + 9
\, g^{2}}\right)}^{\frac{1}{3}}\right\}
$</p>
<p>So I want to check the algebraic equivalence of these two equations step by step, and how I can convert the first equation into the second, as they are both the same.</p>
<p>This is like checking algebra formulas like $(a+b)^2=a^2+b^2+2ab$
If nothing else, i want to just check True or False, just like with numbers, but equations instead.</p>
https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37418#post-id-37418@mforets I did render it right this time.Tue, 25 Apr 2017 13:28:41 +0200https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37418#post-id-37418Answer by dan_fulea for <p>So, i got a different cubic formula for the depressed equation than that was there in the standard formula from a book.
$y^3+fy+g=0 $ has the solution</p>
<p>$ ({-g+\sqrt {g^2/4+f^3/27} })^{1/3} + ({-g-\sqrt {g^2/4+f^3/27} })^{1/3} $ </p>
<p>$
\left\{y : -\frac{f}{3 \, {\left(-\frac{1}{2} \, g + \frac{1}{6} \,
\sqrt{\frac{4}{3} \, f^{3} + 9 \, g^{2}}\right)}^{\frac{1}{3}}} +
{\left(-\frac{1}{2} \, g + \frac{1}{6} \, \sqrt{\frac{4}{3} \, f^{3} + 9
\, g^{2}}\right)}^{\frac{1}{3}}\right\}
$</p>
<p>So I want to check the algebraic equivalence of these two equations step by step, and how I can convert the first equation into the second, as they are both the same.</p>
<p>This is like checking algebra formulas like $(a+b)^2=a^2+b^2+2ab$
If nothing else, i want to just check True or False, just like with numbers, but equations instead.</p>
https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?answer=37426#post-id-37426First of all, let us move the fraction $1/6$ from the second formula inside the square root.
As $1/36$. Then we get inside $\sqrt[3]{\ \dots\ }$ the following expression.
$$ -\frac g2 +\sqrt{\left(\frac g2\right)^2 +\left(\frac f3\right)^3}\ . $$
This is the way i would write the formula.
The second formula is correct.
The first one cannot work.
If the question is how to write `sage` code that checks that two symbolic algebraic expressions
involving radicals inside radicals are, or are not equal - a purely programatic question, then this post is not an answer.
If the way the formulas arise is the target, and if the check is / should be combined with the mathematic knowledge, then
the following is what i would prefer.
(There is also a detail in the choice of the third root in the two terms appearing in the formulas. They have to be correlated. This correlation cannot be explained in a trivial manner to the sage compiler by simply using a code fragment of the shape
`( ... )^(1/3) + ( ... )^(1/3)` , except we tacitly understand that the product of the cubic roots chosen ( ... )^(1/3)( ... )^(1/3)
is fixed.
And this is the reason why some textbooks prefer to put the second cubic root in a cumbersome expression.)
First of all, let $\epsilon$ be a primitive third root of unity. We can then factor the expression
$$
X^3 + A^3 + B^3 - 3XAB
$$
as follows (over $\mathbb Q[A,B;X]$)
var( 'X,A,B' );
factor( X^3 + A^3 + B^3 - 3*A*B*X )
getting
(A^2 - A*B + B^2 - A*X - B*X + X^2)*(A + B + X)
-- and this is enough for our strict purposes, the factor $(X+A+B)$ is enough for the following --
but we can even ``force'' three linear factors after extending the coefficients
from $\mathbb Q$ to $\mathbb Q[\epsilon]=\mathbb Q[\sqrt{-3}]$ . The corresponding code is:
F.<e> = CyclotomicField( 3 )
R.<A,B,X> = PolynomialRing( F )
factor( X^3 + A^3 + B^3 - 3*A*B*X )
And the factors are coming with the expected Galois symmetry:
(A + B + X) * (A + (e)*B + (-e - 1)*X) * (A + (-e - 1)*B + (e)*X)
Humanly written:
$$ X^3 + A^3 + B^3 - 3XAB = (X+A+B)(X^2+A^2 +B^2-XA-XB-AB) \ .$$
Even better:
$$ X^3 + A^3 + B^3 - 3XAB= (X+A+B)(X+\epsilon A+\epsilon^2 B)(X+\epsilon^2 A+\epsilon B)\ .
$$
Now we plug in the following symbolic values for $A$ and $B$.
Since i hate an excessive use of denominators (in $\LaTeX$), let $G=g/2$ and $F=f/3$. Let $A,B$ be the two values
$$ A ,B = -\left(\ - G\pm \sqrt{F^3+G^2}\ \right)^{1/3}\ .$$
*Tacit* convention:
The two cubic roots are taken such that $AB$, constrained to be
$$ AB = \left(- G+\sqrt{F^3+G^2}\right)^{1/3}\left(- G-\sqrt{F^3+G^2}\right)^{1/3}$$
$$\qquad = \left(G^2 -(F^3+G^2)\right)^{1/3} = -(F^3)^{1/3}\in\{F,\epsilon F,\epsilon^2 F\}\ , $$
is *de facto* exactly $AB=-F$.
Then
$$ X^3 + A^3 + B^3 - 3XAB = X^3 -\left(- G+\sqrt{F^3+G^2}\right)-\left(- G-\sqrt{F^3+G^2}\right) -3X(-F)=\dots
$$
This is $X^3 +3XF+2G = X^3+fX+g$.
The factor $(X+A+B)$ of $X^3+A^3+B^3-3ABX$ exposes the root $-(A+B)$ as in the second posted formula, the correct one. Let us give in `sage` a particular example:
sage: ( x^3 + 6*x + 2 ).roots( multiplicities=0 )
[1/2*2^(2/3)*(-I*sqrt(3) + 1) - 1/2*2^(1/3)*(I*sqrt(3) + 1),
1/2*2^(2/3)*(I*sqrt(3) + 1) - 1/2*2^(1/3)*(-I*sqrt(3) + 1),
-2^(2/3) + 2^(1/3)]
Here, $f=6$, $F=f/3=2$, $g=2$, $G=g/2=1$, then $\sqrt{F^3+G^2}=\sqrt{2^3+1^2}=3$, and we build $-1\pm 3$ and so on.
Tue, 25 Apr 2017 20:14:30 +0200https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?answer=37426#post-id-37426Comment by screened00 for <p>First of all, let us move the fraction $1/6$ from the second formula inside the square root.
As $1/36$. Then we get inside $\sqrt[3]{\ \dots\ }$ the following expression.
$$ -\frac g2 +\sqrt{\left(\frac g2\right)^2 +\left(\frac f3\right)^3}\ . $$
This is the way i would write the formula.</p>
<p>The second formula is correct.</p>
<p>The first one cannot work. </p>
<p>If the question is how to write <code>sage</code> code that checks that two symbolic algebraic expressions
involving radicals inside radicals are, or are not equal - a purely programatic question, then this post is not an answer.
If the way the formulas arise is the target, and if the check is / should be combined with the mathematic knowledge, then
the following is what i would prefer.
(There is also a detail in the choice of the third root in the two terms appearing in the formulas. They have to be correlated. This correlation cannot be explained in a trivial manner to the sage compiler by simply using a code fragment of the shape
<code>( ... )^(1/3) + ( ... )^(1/3)</code> , except we tacitly understand that the product of the cubic roots chosen ( ... )^(1/3)( ... )^(1/3)
is fixed.
And this is the reason why some textbooks prefer to put the second cubic root in a cumbersome expression.)</p>
<p>First of all, let $\epsilon$ be a primitive third root of unity. We can then factor the expression
$$
X^3 + A^3 + B^3 - 3XAB
$$
as follows (over $\mathbb Q[A,B;X]$)</p>
<pre><code>var( 'X,A,B' );
factor( X^3 + A^3 + B^3 - 3*A*B*X )
</code></pre>
<p>getting</p>
<pre><code>(A^2 - A*B + B^2 - A*X - B*X + X^2)*(A + B + X)
</code></pre>
<p>-- and this is enough for our strict purposes, the factor $(X+A+B)$ is enough for the following --
but we can even ``force'' three linear factors after extending the coefficients
from $\mathbb Q$ to $\mathbb Q[\epsilon]=\mathbb Q[\sqrt{-3}]$ . The corresponding code is:</p>
<pre><code>F.<e> = CyclotomicField( 3 )
R.<A,B,X> = PolynomialRing( F )
factor( X^3 + A^3 + B^3 - 3*A*B*X )
</code></pre>
<p>And the factors are coming with the expected Galois symmetry:</p>
<pre><code>(A + B + X) * (A + (e)*B + (-e - 1)*X) * (A + (-e - 1)*B + (e)*X)
</code></pre>
<p>Humanly written:
$$ X^3 + A^3 + B^3 - 3XAB = (X+A+B)(X^2+A^2 +B^2-XA-XB-AB) \ .$$
Even better:
$$ X^3 + A^3 + B^3 - 3XAB= (X+A+B)(X+\epsilon A+\epsilon^2 B)(X+\epsilon^2 A+\epsilon B)\ .
$$
Now we plug in the following symbolic values for $A$ and $B$.
Since i hate an excessive use of denominators (in $\LaTeX$), let $G=g/2$ and $F=f/3$. Let $A,B$ be the two values
$$ A ,B = -\left(\ - G\pm \sqrt{F^3+G^2}\ \right)^{1/3}\ .$$
<em>Tacit</em> convention:
The two cubic roots are taken such that $AB$, constrained to be
$$ AB = \left(- G+\sqrt{F^3+G^2}\right)^{1/3}\left(- G-\sqrt{F^3+G^2}\right)^{1/3}$$
$$\qquad = \left(G^2 -(F^3+G^2)\right)^{1/3} = -(F^3)^{1/3}\in{F,\epsilon F,\epsilon^2 F}\ , $$
is <em>de facto</em> exactly $AB=-F$.
Then
$$ X^3 + A^3 + B^3 - 3XAB = X^3 -\left(- G+\sqrt{F^3+G^2}\right)-\left(- G-\sqrt{F^3+G^2}\right) -3X(-F)=\dots
$$
This is $X^3 +3XF+2G = X^3+fX+g$. </p>
<p>The factor $(X+A+B)$ of $X^3+A^3+B^3-3ABX$ exposes the root $-(A+B)$ as in the second posted formula, the correct one. Let us give in <code>sage</code> a particular example:</p>
<pre><code>sage: ( x^3 + 6*x + 2 ).roots( multiplicities=0 )
[1/2*2^(2/3)*(-I*sqrt(3) + 1) - 1/2*2^(1/3)*(I*sqrt(3) + 1),
1/2*2^(2/3)*(I*sqrt(3) + 1) - 1/2*2^(1/3)*(-I*sqrt(3) + 1),
-2^(2/3) + 2^(1/3)]
</code></pre>
<p>Here, $f=6$, $F=f/3=2$, $g=2$, $G=g/2=1$, then $\sqrt{F^3+G^2}=\sqrt{2^3+1^2}=3$, and we build $-1\pm 3$ and so on. </p>
https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37449#post-id-37449@dan_fulea Hi, thx, but I corrected the equation of cubic now. Are they not equal. Also I'd want to check the algebraic equivalence of identities, and other equations using sage, how can I do that?Fri, 28 Apr 2017 11:03:11 +0200https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37449#post-id-37449Comment by dan_fulea for <p>First of all, let us move the fraction $1/6$ from the second formula inside the square root.
As $1/36$. Then we get inside $\sqrt[3]{\ \dots\ }$ the following expression.
$$ -\frac g2 +\sqrt{\left(\frac g2\right)^2 +\left(\frac f3\right)^3}\ . $$
This is the way i would write the formula.</p>
<p>The second formula is correct.</p>
<p>The first one cannot work. </p>
<p>If the question is how to write <code>sage</code> code that checks that two symbolic algebraic expressions
involving radicals inside radicals are, or are not equal - a purely programatic question, then this post is not an answer.
If the way the formulas arise is the target, and if the check is / should be combined with the mathematic knowledge, then
the following is what i would prefer.
(There is also a detail in the choice of the third root in the two terms appearing in the formulas. They have to be correlated. This correlation cannot be explained in a trivial manner to the sage compiler by simply using a code fragment of the shape
<code>( ... )^(1/3) + ( ... )^(1/3)</code> , except we tacitly understand that the product of the cubic roots chosen ( ... )^(1/3)( ... )^(1/3)
is fixed.
And this is the reason why some textbooks prefer to put the second cubic root in a cumbersome expression.)</p>
<p>First of all, let $\epsilon$ be a primitive third root of unity. We can then factor the expression
$$
X^3 + A^3 + B^3 - 3XAB
$$
as follows (over $\mathbb Q[A,B;X]$)</p>
<pre><code>var( 'X,A,B' );
factor( X^3 + A^3 + B^3 - 3*A*B*X )
</code></pre>
<p>getting</p>
<pre><code>(A^2 - A*B + B^2 - A*X - B*X + X^2)*(A + B + X)
</code></pre>
<p>-- and this is enough for our strict purposes, the factor $(X+A+B)$ is enough for the following --
but we can even ``force'' three linear factors after extending the coefficients
from $\mathbb Q$ to $\mathbb Q[\epsilon]=\mathbb Q[\sqrt{-3}]$ . The corresponding code is:</p>
<pre><code>F.<e> = CyclotomicField( 3 )
R.<A,B,X> = PolynomialRing( F )
factor( X^3 + A^3 + B^3 - 3*A*B*X )
</code></pre>
<p>And the factors are coming with the expected Galois symmetry:</p>
<pre><code>(A + B + X) * (A + (e)*B + (-e - 1)*X) * (A + (-e - 1)*B + (e)*X)
</code></pre>
<p>Humanly written:
$$ X^3 + A^3 + B^3 - 3XAB = (X+A+B)(X^2+A^2 +B^2-XA-XB-AB) \ .$$
Even better:
$$ X^3 + A^3 + B^3 - 3XAB= (X+A+B)(X+\epsilon A+\epsilon^2 B)(X+\epsilon^2 A+\epsilon B)\ .
$$
Now we plug in the following symbolic values for $A$ and $B$.
Since i hate an excessive use of denominators (in $\LaTeX$), let $G=g/2$ and $F=f/3$. Let $A,B$ be the two values
$$ A ,B = -\left(\ - G\pm \sqrt{F^3+G^2}\ \right)^{1/3}\ .$$
<em>Tacit</em> convention:
The two cubic roots are taken such that $AB$, constrained to be
$$ AB = \left(- G+\sqrt{F^3+G^2}\right)^{1/3}\left(- G-\sqrt{F^3+G^2}\right)^{1/3}$$
$$\qquad = \left(G^2 -(F^3+G^2)\right)^{1/3} = -(F^3)^{1/3}\in{F,\epsilon F,\epsilon^2 F}\ , $$
is <em>de facto</em> exactly $AB=-F$.
Then
$$ X^3 + A^3 + B^3 - 3XAB = X^3 -\left(- G+\sqrt{F^3+G^2}\right)-\left(- G-\sqrt{F^3+G^2}\right) -3X(-F)=\dots
$$
This is $X^3 +3XF+2G = X^3+fX+g$. </p>
<p>The factor $(X+A+B)$ of $X^3+A^3+B^3-3ABX$ exposes the root $-(A+B)$ as in the second posted formula, the correct one. Let us give in <code>sage</code> a particular example:</p>
<pre><code>sage: ( x^3 + 6*x + 2 ).roots( multiplicities=0 )
[1/2*2^(2/3)*(-I*sqrt(3) + 1) - 1/2*2^(1/3)*(I*sqrt(3) + 1),
1/2*2^(2/3)*(I*sqrt(3) + 1) - 1/2*2^(1/3)*(-I*sqrt(3) + 1),
-2^(2/3) + 2^(1/3)]
</code></pre>
<p>Here, $f=6$, $F=f/3=2$, $g=2$, $G=g/2=1$, then $\sqrt{F^3+G^2}=\sqrt{2^3+1^2}=3$, and we build $-1\pm 3$ and so on. </p>
https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37456#post-id-37456This is not always simple to check. In the following sense. It sage gets a `True` for a to-be-equality-relation, than it can prove it and it is true. If not, than it can not. And very often there is a detail that makes the equality false, or interpretable (which is the definition of sqrt for instance?), or not provable with the today knowledge of `sage`. For instance:
sage: var( 'f,g' );
sage: bool( sqrt( g^2/4 + f^3/27 ) == 1/6 * sqrt( 4/3*f^3 + 9*g^2 ) )
False
sage: bool( sqrt( g^2/4 + f^3/27 )^2 == ( 1/6 * sqrt( 4/3*f^3 + 9*g^2 ) )^2 )
True
The two square roots are in the first boolean eval not equal for `sage`. Using a pocket calculator, sqrt delivers always Error or a number $\ge 0$. For `sage`, and for our purposes not. Just plug in complex numbers. Squaring...Fri, 28 Apr 2017 20:47:38 +0200https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37456#post-id-37456Comment by screened00 for <p>First of all, let us move the fraction $1/6$ from the second formula inside the square root.
As $1/36$. Then we get inside $\sqrt[3]{\ \dots\ }$ the following expression.
$$ -\frac g2 +\sqrt{\left(\frac g2\right)^2 +\left(\frac f3\right)^3}\ . $$
This is the way i would write the formula.</p>
<p>The second formula is correct.</p>
<p>The first one cannot work. </p>
<p>If the question is how to write <code>sage</code> code that checks that two symbolic algebraic expressions
involving radicals inside radicals are, or are not equal - a purely programatic question, then this post is not an answer.
If the way the formulas arise is the target, and if the check is / should be combined with the mathematic knowledge, then
the following is what i would prefer.
(There is also a detail in the choice of the third root in the two terms appearing in the formulas. They have to be correlated. This correlation cannot be explained in a trivial manner to the sage compiler by simply using a code fragment of the shape
<code>( ... )^(1/3) + ( ... )^(1/3)</code> , except we tacitly understand that the product of the cubic roots chosen ( ... )^(1/3)( ... )^(1/3)
is fixed.
And this is the reason why some textbooks prefer to put the second cubic root in a cumbersome expression.)</p>
<p>First of all, let $\epsilon$ be a primitive third root of unity. We can then factor the expression
$$
X^3 + A^3 + B^3 - 3XAB
$$
as follows (over $\mathbb Q[A,B;X]$)</p>
<pre><code>var( 'X,A,B' );
factor( X^3 + A^3 + B^3 - 3*A*B*X )
</code></pre>
<p>getting</p>
<pre><code>(A^2 - A*B + B^2 - A*X - B*X + X^2)*(A + B + X)
</code></pre>
<p>-- and this is enough for our strict purposes, the factor $(X+A+B)$ is enough for the following --
but we can even ``force'' three linear factors after extending the coefficients
from $\mathbb Q$ to $\mathbb Q[\epsilon]=\mathbb Q[\sqrt{-3}]$ . The corresponding code is:</p>
<pre><code>F.<e> = CyclotomicField( 3 )
R.<A,B,X> = PolynomialRing( F )
factor( X^3 + A^3 + B^3 - 3*A*B*X )
</code></pre>
<p>And the factors are coming with the expected Galois symmetry:</p>
<pre><code>(A + B + X) * (A + (e)*B + (-e - 1)*X) * (A + (-e - 1)*B + (e)*X)
</code></pre>
<p>Humanly written:
$$ X^3 + A^3 + B^3 - 3XAB = (X+A+B)(X^2+A^2 +B^2-XA-XB-AB) \ .$$
Even better:
$$ X^3 + A^3 + B^3 - 3XAB= (X+A+B)(X+\epsilon A+\epsilon^2 B)(X+\epsilon^2 A+\epsilon B)\ .
$$
Now we plug in the following symbolic values for $A$ and $B$.
Since i hate an excessive use of denominators (in $\LaTeX$), let $G=g/2$ and $F=f/3$. Let $A,B$ be the two values
$$ A ,B = -\left(\ - G\pm \sqrt{F^3+G^2}\ \right)^{1/3}\ .$$
<em>Tacit</em> convention:
The two cubic roots are taken such that $AB$, constrained to be
$$ AB = \left(- G+\sqrt{F^3+G^2}\right)^{1/3}\left(- G-\sqrt{F^3+G^2}\right)^{1/3}$$
$$\qquad = \left(G^2 -(F^3+G^2)\right)^{1/3} = -(F^3)^{1/3}\in{F,\epsilon F,\epsilon^2 F}\ , $$
is <em>de facto</em> exactly $AB=-F$.
Then
$$ X^3 + A^3 + B^3 - 3XAB = X^3 -\left(- G+\sqrt{F^3+G^2}\right)-\left(- G-\sqrt{F^3+G^2}\right) -3X(-F)=\dots
$$
This is $X^3 +3XF+2G = X^3+fX+g$. </p>
<p>The factor $(X+A+B)$ of $X^3+A^3+B^3-3ABX$ exposes the root $-(A+B)$ as in the second posted formula, the correct one. Let us give in <code>sage</code> a particular example:</p>
<pre><code>sage: ( x^3 + 6*x + 2 ).roots( multiplicities=0 )
[1/2*2^(2/3)*(-I*sqrt(3) + 1) - 1/2*2^(1/3)*(I*sqrt(3) + 1),
1/2*2^(2/3)*(I*sqrt(3) + 1) - 1/2*2^(1/3)*(-I*sqrt(3) + 1),
-2^(2/3) + 2^(1/3)]
</code></pre>
<p>Here, $f=6$, $F=f/3=2$, $g=2$, $G=g/2=1$, then $\sqrt{F^3+G^2}=\sqrt{2^3+1^2}=3$, and we build $-1\pm 3$ and so on. </p>
https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37470#post-id-37470@dan_fulea eq1=-1/3*f/(-1/2*g + 1/6*sqrt(4/3*f^3 + 9*g^2))^(1/3)
eq2=-g-sqrt(g**2/4+f**3/27)**(1/3)
bool( eq1**2==eq2**2)
I tried with ^6 too and ^3 too, it all returns False, so how do I check it? Any other tricksSun, 30 Apr 2017 10:18:43 +0200https://ask.sagemath.org/question/37415/how-to-check-algebraic-equations/?comment=37470#post-id-37470