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, 30 Jun 2014 10:22:12 +0200why can't sage solve the equation x^n == 2*x ?https://ask.sagemath.org/question/10374/why-cant-sage-solve-the-equation-xn-2x/ sage: var('x n')
(x, n)
sage: solve(x^n==2*x,x)
[x == 1/2*x^n]
This is not what I expect.
Who can help?
Thanks.
Mon, 22 Jul 2013 13:50:43 +0200https://ask.sagemath.org/question/10374/why-cant-sage-solve-the-equation-xn-2x/Comment by calc314 for <pre><code>sage: var('x n')
(x, n)
sage: solve(x^n==2*x,x)
[x == 1/2*x^n]
</code></pre>
<p>This is not what I expect.</p>
<p>Who can help? </p>
<p>Thanks.</p>
https://ask.sagemath.org/question/10374/why-cant-sage-solve-the-equation-xn-2x/?comment=17253#post-id-17253One issue here is that after declaring that x and n are symbolic variables, Sage still does not know anything more than that about x and n. So, Sage does not know whether x and n are reals, integers, etc. Thus, we need to `assume(n,'integer')` and `assume(x,'real')`. Unfortunately, at this point, you still don't get a solution. Sage is calling Maxima to solve this equation, and I cannot get Maxima to solve it either. Ideas?Mon, 22 Jul 2013 22:22:34 +0200https://ask.sagemath.org/question/10374/why-cant-sage-solve-the-equation-xn-2x/?comment=17253#post-id-17253Answer by rws for <pre><code>sage: var('x n')
(x, n)
sage: solve(x^n==2*x,x)
[x == 1/2*x^n]
</code></pre>
<p>This is not what I expect.</p>
<p>Who can help? </p>
<p>Thanks.</p>
https://ask.sagemath.org/question/10374/why-cant-sage-solve-the-equation-xn-2x/?answer=23142#post-id-23142Since you named one variable n I assume you meant integer. But even this has infinitely many solutions! Sage can give them for specific n:
sage: [solve(x^n==2*x,x) for n in range(1,5)]
[[x == 0],
[x == 0, x == 2],
[x == -sqrt(2), x == sqrt(2), x == 0],
[x == 1/2*I*sqrt(3)*2^(1/3) - 1/2*2^(1/3), x == -1/2*I*sqrt(3)*2^(1/3) - 1/2*2^(1/3), x == 2^(1/3), x == 0]]Mon, 30 Jun 2014 10:22:12 +0200https://ask.sagemath.org/question/10374/why-cant-sage-solve-the-equation-xn-2x/?answer=23142#post-id-23142