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.Mon, 22 Sep 2014 19:04:32 +0200Difficulties with resultants and Tschirnhaus transformationshttps://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/ I'm experimenting with some polynomial equations, and as a test I'm working through the example given here:
http://www.oocities.org/titus_piezas/Tschirnhausen.html
Basically, in order to eliminate the first two terms of the quintic $x^5-x^4-x^3-x^2-x-1$ we need to find a transformation $y=x^2+ax+b$ (such a polynomial transformation is called a *Tschirnhaus transformation*, after its first discoverer), for which $a$ and $b$ have the effect of producing a quintic equation in $y$ but without $y^4$ or $y^3$ terms. This is as far as I've got so far:
R.<a,b> = QQ[]
S.<y> = R[]
T.<x> = S[]
p = x^5-x^4-x^3-x^2-x-1
res = p.resultant(y-x^2-a*x-b)
rc = res.coefficients()
solve([rc[-2],rc[-3]],[a,b])
TypeError: a is not a valid variable.
Drat! So I have two questions: why is `a` not a valid variable, and why can I not isolate individual coefficients of `res`? I can obtain all the coefficients of `res`, but I can't isolate just one, with something like `res.coeff(y,3)`. Sun, 21 Sep 2014 11:31:10 +0200https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/Comment by SL for <p>I'm experimenting with some polynomial equations, and as a test I'm working through the example given here:</p>
<p><a href="http://www.oocities.org/titus_piezas/Tschirnhausen.html">http://www.oocities.org/titus_piezas/...</a></p>
<p>Basically, in order to eliminate the first two terms of the quintic $x^5-x^4-x^3-x^2-x-1$ we need to find a transformation $y=x^2+ax+b$ (such a polynomial transformation is called a <em>Tschirnhaus transformation</em>, after its first discoverer), for which $a$ and $b$ have the effect of producing a quintic equation in $y$ but without $y^4$ or $y^3$ terms. This is as far as I've got so far:</p>
<pre><code>R.<a,b> = QQ[]
S.<y> = R[]
T.<x> = S[]
p = x^5-x^4-x^3-x^2-x-1
res = p.resultant(y-x^2-a*x-b)
rc = res.coefficients()
solve([rc[-2],rc[-3]],[a,b])
TypeError: a is not a valid variable.
</code></pre>
<p>Drat! So I have two questions: why is <code>a</code> not a valid variable, and why can I not isolate individual coefficients of <code>res</code>? I can obtain all the coefficients of <code>res</code>, but I can't isolate just one, with something like <code>res.coeff(y,3)</code>. </p>
https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24250#post-id-24250If I declare variables, then solve also works
<pre>
sage: a, b = var('a b')
sage: solve([rc[-2],rc[-3]],[a,b])
[[a == (-11/7), b == (-2/7)], [a == -3, b == 0]]
</pre>Mon, 22 Sep 2014 19:04:32 +0200https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24250#post-id-24250Answer by FrédéricC for <p>I'm experimenting with some polynomial equations, and as a test I'm working through the example given here:</p>
<p><a href="http://www.oocities.org/titus_piezas/Tschirnhausen.html">http://www.oocities.org/titus_piezas/...</a></p>
<p>Basically, in order to eliminate the first two terms of the quintic $x^5-x^4-x^3-x^2-x-1$ we need to find a transformation $y=x^2+ax+b$ (such a polynomial transformation is called a <em>Tschirnhaus transformation</em>, after its first discoverer), for which $a$ and $b$ have the effect of producing a quintic equation in $y$ but without $y^4$ or $y^3$ terms. This is as far as I've got so far:</p>
<pre><code>R.<a,b> = QQ[]
S.<y> = R[]
T.<x> = S[]
p = x^5-x^4-x^3-x^2-x-1
res = p.resultant(y-x^2-a*x-b)
rc = res.coefficients()
solve([rc[-2],rc[-3]],[a,b])
TypeError: a is not a valid variable.
</code></pre>
<p>Drat! So I have two questions: why is <code>a</code> not a valid variable, and why can I not isolate individual coefficients of <code>res</code>? I can obtain all the coefficients of <code>res</code>, but I can't isolate just one, with something like <code>res.coeff(y,3)</code>. </p>
https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?answer=24227#post-id-24227As this is a purely algebraic problem, you can avoid the symbolic `solve` as follows:
sage: I = R.ideal([rc[-2],rc[-3]])
sage: I.variety()
[{a: -11/7, b: -2/7}, {a: -3, b: 0}]
Sun, 21 Sep 2014 11:44:25 +0200https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?answer=24227#post-id-24227Comment by Alasdair for <p>As this is a purely algebraic problem, you can avoid the symbolic <code>solve</code> as follows:</p>
<pre><code>sage: I = R.ideal([rc[-2],rc[-3]])
sage: I.variety()
[{a: -11/7, b: -2/7}, {a: -3, b: 0}]
</code></pre>
https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24229#post-id-24229Perfect - simple and elegant. Thanks very much!Sun, 21 Sep 2014 16:45:26 +0200https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24229#post-id-24229Comment by Alasdair for <p>As this is a purely algebraic problem, you can avoid the symbolic <code>solve</code> as follows:</p>
<pre><code>sage: I = R.ideal([rc[-2],rc[-3]])
sage: I.variety()
[{a: -11/7, b: -2/7}, {a: -3, b: 0}]
</code></pre>
https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24236#post-id-24236Thanks for the reminder: I've accepted the answer.Mon, 22 Sep 2014 02:21:30 +0200https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24236#post-id-24236Comment by FrédéricC for <p>As this is a purely algebraic problem, you can avoid the symbolic <code>solve</code> as follows:</p>
<pre><code>sage: I = R.ideal([rc[-2],rc[-3]])
sage: I.variety()
[{a: -11/7, b: -2/7}, {a: -3, b: 0}]
</code></pre>
https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24230#post-id-24230Could you please accept the answer if it suits you ? (on the left)Sun, 21 Sep 2014 16:50:52 +0200https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24230#post-id-24230Comment by slelievre for <p>As this is a purely algebraic problem, you can avoid the symbolic <code>solve</code> as follows:</p>
<pre><code>sage: I = R.ideal([rc[-2],rc[-3]])
sage: I.variety()
[{a: -11/7, b: -2/7}, {a: -3, b: 0}]
</code></pre>
https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24231#post-id-24231@Alasdair: when you are satisfied with an answer, you can formally accept it by clicking the tick sign on the top left of the answer, below the answer's score. Additionally, you can upvote any answer that helped you, using the upward arrow on top of the answer's score. Accepting the answer marks your question as satisfactorily answered in the list of questions on the main page (helping volunteers to focus on unsolved questions). Additionally, when you accept an answer, you get 2 karma points and the answerer gets 25 karma points. When you upvote, the answerer gets 10 karma points.Sun, 21 Sep 2014 18:37:35 +0200https://ask.sagemath.org/question/24226/difficulties-with-resultants-and-tschirnhaus-transformations/?comment=24231#post-id-24231