2
$\begingroup$

I'm using Mathematica 9. I encountered an expression that Mathematica couldn't simplify to a simpler form:

Simplify[(Sqrt[a b] + Sqrt[a c])^4/a^2, {a > 0, b > 0, c > 0}]
(Sqrt[a b] + Sqrt[a c])^4/a^2

FullSimplify gives the same answer. However:

Simplify[(Sqrt[a b] + Sqrt[a c])^4/a^2-(Sqrt[b] + Sqrt[c])^4, {a > 0, b > 0, c > 0}]
0

, as expected. So the simplification algorithm is imperfect? Imagine that a, b and c represent more complex expressions, is there a way to work around this problem?

Edit I'll provide the original problem with more details. I have calculated a coefficient b1 to the following:

b1=(k-l)/(k+l)

where

k==Sqrt[2 m e]/h, l==Sqrt[2 m (e - V)]/h

m, e, h, k and l are real and positive (e > V)

I need to simplify the square of b1, which can be done easily by hand.

I try

Simplify[b1^2/.{k->Sqrt[2 m e]/h, l->Sqrt[2 m (e - V)]/h},{e > V > 0, m > 0, h > 0}]

The result is quite unpleasant:

$\frac{(\sqrt{m e} - \sqrt{m (e - V)})^2}{(\sqrt{m e} + \sqrt{m (e - V)})^2}$

So I decide to "help" Mathematica a bit:

Simplify[(k-l)^4/(k^2-l^2)^2/.{k->Sqrt[2 m e]/h, l->Sqrt[2 m (e - V)]/h},{e > V > 0, m > 0, h > 0}]

It returns

$\frac{(\sqrt{m e} - \sqrt{m (e - V)})^4}{m^2 V^2}$

This is the desired form. However, Mathematica refuses to take out and simplify the m factor. Even though Expand does get rid of m correctly, it won't help much because it creates a long messy expression that can't be simplified again to the compact unexpanded form.

$\endgroup$
2
  • 1
    $\begingroup$ Version 10 simplifies to (Sqrt[b] + Sqrt[c])^4 $\endgroup$ Dec 4, 2014 at 0:06
  • $\begingroup$ FullSimplify[(Sqrt[a b]+Sqrt[a c])^4/a^2,a>0] gives (Sqrt[b]+Sqrt[c])^4. $\endgroup$
    – chyanog
    Jan 7, 2022 at 3:37

2 Answers 2

3
$\begingroup$

I suppose you could try Expand first and then Simplify.

Simplify[Expand[(Sqrt[a b] + Sqrt[a c])^4/a^2], a > 0]

(* (Sqrt[b] + Sqrt[c])^4 *)

Though admittedly this isn't my forte.

Worth noting is that with all of your assumptions it results in an expression with higher LeafCount than the original.

Simplify[Expand[(Sqrt[a b] + Sqrt[a c])^4/a^2], a > 0 && b > 0 && c > 0]

(* b^2 + 6 b c + c^2 + 4 b Sqrt[b c] + 4 c Sqrt[b c] *)

Also of interest is that FullSimplify gives the same result as expanding with Simplify if a > 0 is the only assumption provided.

$\endgroup$
2
$\begingroup$

Nothing can be more simple. Let us do it. This is your starting expression:

 expr = (Sqrt[m*e] - Sqrt[m*(e - V)])^2/(Sqrt[m*e] + Sqrt[
    m*(e - V)])^2;

Here is a simplification function:

mySimp[expr_] := Simplify[expr, {m > 0, e > 0, V > 0}];

Now let us take the numerator and denominator of the expression:

 num1 = Numerator[expr];
den1 = Denominator[expr];

and multiply the both by the numerator:

 den2 = den1*num1 // mySimp

(*   m^2 V^2   *)

num2 = num1^2 // mySimp

(*   (Sqrt[e m] - Sqrt[m (e - V)])^4   *)

and finally construct the ratio again:

 expr2 = num2/den2

(*    (Sqrt[e m] - Sqrt[m (e - V)])^4/(m^2 V^2)   *)

Done. Have fun!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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