# Simplifying a simple rational expression with indeterminate exponent

((sqrt(x)/(x+1))^n * (x+1)^n).simplify_full () returns the given expression as-is, but evidently it should be simplified to sqrt(x)^n. Sage indeed does this if the x+1 is replaced by x or n by a concrete number like 10 (illustrating that sage isn't worried about division by zero, but it's something else). Is there a way to have sage simplify this?

edit retag close merge delete

1

Try canonicalize_radical:

sage: a = (sqrt(x)/(x+1))^n * (x+1)^n
x^(1/2*n)

( 2022-09-14 03:36:44 +0200 )edit

@Juanjo : you should make an answer of your comment, for the benefit of future ask.sagemath.org perusers.

( 2022-09-14 08:21:16 +0200 )edit

@Emmanuel Charpentier: Done. I thought it could exist a better solution than mine.

( 2022-09-14 12:12:45 +0200 )edit

Sort by ยป oldest newest most voted

sage: a = (sqrt(x)/(x+1))^n * (x+1)^n
x^(1/2*n)

more

That solves it! Thanks. Makes me wonder why simplify_"full" wouldn't do it for me, though.

( 2022-09-15 01:42:26 +0200 )edit

Because simplify_full applies, in order, the methods simplify_factorial, simplify_rectform, simplify_trig, simplify_rational and expand_sum, neither of which produces the desired effect on the symbolic expression.

( 2022-09-15 03:45:46 +0200 )edit

What I'm saying is that I wish something like canonicalize_radical was among that list. I'm sure there are good reasons for its exclusion, but still, having to know specialized simplifiers for such an elementary rewrite is a bit frustrating.

( 2022-09-15 09:09:34 +0200 )edit