# Revision history [back]

Your code doesn't work because you didn't specify what to solve for. If you try solve(x^a==c,x), Sage becomes nosy (verging on indiscrete...;-). You have a couple of solutions :

• add assumptions about a and c (see assume?).

• add temporary assumptions (useful for testing different branches) :

For example:

sage: with assuming(a,"noninteger", c>0): solve(x^a==c,x)
[x == c^(1/a)]
sage: with assuming(a,"noninteger", c<0): solve(x^a==c,x)
[x^a == c]
sage: with assuming(a,"noninteger", c==0): solve(x^a==c,x)
[x == c^(1/a)]


sage: (x^a==c).log().log_expand().solve(x)
[x == c^(1/a)]


(but beware of transformations introducing spurious roots...).

HTH,

Your code doesn't work because you didn't specify what to solve for. If you try solve(x^a==c,x), Sage becomes nosy (verging on indiscrete...;-). You have a couple of solutions :

• add assumptions about a and c (see assume?).

• add temporary assumptions (useful for testing different branches) :

For example:

sage: with assuming(a,"noninteger", c>0): solve(x^a==c,x)
[x == c^(1/a)]
sage: with assuming(a,"noninteger", c<0): solve(x^a==c,x)
[x^a == c]
sage: with assuming(a,"noninteger", c==0): solve(x^a==c,x)
[x == c^(1/a)]


(one notes that the latter is nonsens, while formally correct...).

sage: (x^a==c).log().log_expand().solve(x)