ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 28 Feb 2013 02:35:11 -0600Solve an expression with fractional exponentshttp://ask.sagemath.org/question/9863/solve-an-expression-with-fractional-exponents/I have an expression which, effectively, looks like this:
expr = x == x^(1/3)*y
except y is a really large number of constants. If I wanted to solve this for x, I should get x=y^(3/2). But instead:
solve(expr,x)
yields
[x == x^(1/3)*y]
In the example I gave, it's obviously not a big deal. But for my actual code, y is a *very* large number of constant factors, and this means copying those factors out by hand, and then re-inputting them in the correct form ( x = (factors)^(3/2) ) which is error prone and time consuming.
I've tried using 0.333 instead of (1/3) in the exponent, that doesn't make a difference.
Any help here would be appreciated. Thank you ahead of time!Wed, 27 Feb 2013 13:16:53 -0600http://ask.sagemath.org/question/9863/solve-an-expression-with-fractional-exponents/Comment by kcrisman for <p>I have an expression which, effectively, looks like this:</p>
<pre><code>expr = x == x^(1/3)*y
</code></pre>
<p>except y is a really large number of constants. If I wanted to solve this for x, I should get x=y^(3/2). But instead:</p>
<pre><code>solve(expr,x)
</code></pre>
<p>yields</p>
<pre><code>[x == x^(1/3)*y]
</code></pre>
<p>In the example I gave, it's obviously not a big deal. But for my actual code, y is a <em>very</em> large number of constant factors, and this means copying those factors out by hand, and then re-inputting them in the correct form ( x = (factors)^(3/2) ) which is error prone and time consuming.</p>
<p>I've tried using 0.333 instead of (1/3) in the exponent, that doesn't make a difference.</p>
<p>Any help here would be appreciated. Thank you ahead of time!</p>
http://ask.sagemath.org/question/9863/solve-an-expression-with-fractional-exponents/?comment=18136#post-id-18136Just for info - it's not only the `y` that's the problem. `solve(x==x^(1/3),x)` does the same thing. `solve(x==x^(1/3),x,to_poly_solve=True)` solves that problem, but not your question...Wed, 27 Feb 2013 14:21:00 -0600http://ask.sagemath.org/question/9863/solve-an-expression-with-fractional-exponents/?comment=18136#post-id-18136Answer by calc314 for <p>I have an expression which, effectively, looks like this:</p>
<pre><code>expr = x == x^(1/3)*y
</code></pre>
<p>except y is a really large number of constants. If I wanted to solve this for x, I should get x=y^(3/2). But instead:</p>
<pre><code>solve(expr,x)
</code></pre>
<p>yields</p>
<pre><code>[x == x^(1/3)*y]
</code></pre>
<p>In the example I gave, it's obviously not a big deal. But for my actual code, y is a <em>very</em> large number of constant factors, and this means copying those factors out by hand, and then re-inputting them in the correct form ( x = (factors)^(3/2) ) which is error prone and time consuming.</p>
<p>I've tried using 0.333 instead of (1/3) in the exponent, that doesn't make a difference.</p>
<p>Any help here would be appreciated. Thank you ahead of time!</p>
http://ask.sagemath.org/question/9863/solve-an-expression-with-fractional-exponents/?answer=14611#post-id-14611I tried `solve(expr^3,x)` and this worked for your simple case.
sage: solve(expr^3,x)
[x == -y^(3/2), x == y^(3/2), x == 0]
I don't know how it will perform with a more complicated expression.
Thu, 28 Feb 2013 02:35:11 -0600http://ask.sagemath.org/question/9863/solve-an-expression-with-fractional-exponents/?answer=14611#post-id-14611