Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
FullSimplify[Sqrt[1/(a^2 b^2)], Element[{a, b}, Reals]]

gives

Abs[1/(a b)]

How do I simplify the following expression

FullSimplify[Sqrt[(1 + a + b)/(a^2 b^2)], Element[{a, b}, Reals]]

into $\frac{\sqrt{a+b+1}}{\left| a b\right| }$ ?

share|improve this question
up vote 6 down vote accepted

While LeafCount is not the complete ComplexityFunction used by Simplify it is a good first order approximation, and you can see that your expressions are equivalent under this metric:

expr1 = Sqrt[(1 + a + b)/(a^2 b^2)];
expr2 = Sqrt[a + b + 1]/Abs[a b];

LeafCount /@ {expr1, expr2}
{15, 15}

In your particular case merely using StringLength works:

FullSimplify[expr1, {a, b} \[Element] Reals, 
 ComplexityFunction -> (StringLength @ ToString @ # &)]
Sqrt[1 + a + b]/Abs[a b]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.