# 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!

edit retag close merge delete

Just 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...

Sort by » oldest newest most voted

I 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.

more