the final output of my code gives this expression which i call ttt:

ttt = Sqrt[f[1] f[2]]/(Sqrt[f[1]/f[2]] (gamma^2 + f[1] f[2]));

Now i want to simplify this expression for obvious reason. If i do :



Collect[ttt, f[1], f[2]]   

I obtain:

Sqrt[f[1] f[2]]/(Sqrt[f[1]/f[2]] (gamma^2 + f[1] f[2]))

Sqrt[f[1] f[2]]/(Sqrt[f[1]/f[2]] (gamma^2 + f[1] f[2]))

Sqrt[f[1] f[2]]/(Sqrt[f[1]/f[2]] (gamma^2 + f[1] f[2]))

Is there a way to have a simplification for this expression ?

  • 2
    $\begingroup$ If you know everything is positive, ttt//PowerExpand works. Otherwise, specify some Assumptions with simplify. $\endgroup$
    – Bill Watts
    Oct 20, 2018 at 21:07
  • $\begingroup$ @BillWatts yes it works with ttt // PowerExpand, in this case i can't use Assumptions because the problem is a trivial division. $\endgroup$
    – siderius
    Oct 20, 2018 at 21:15
  • 1
    $\begingroup$ @siderius, if it were trivial then Mathematica would have simpified it without assumptions. That is the point. You can use Assumptions like this: Simplify[ttt, f[1] > 0 && f[2] > 0]. $\endgroup$ Oct 20, 2018 at 21:26
  • $\begingroup$ @MariusLadegårdMeyer yes it works this way too. I wonder why it is necessary this assumption if the simpl is mathematically indipendent from this. $\endgroup$
    – siderius
    Oct 20, 2018 at 21:31
  • 1
    $\begingroup$ Try this: FindInstance[ttt != PowerExpand[ttt], {f[1], f[2], gamma}]. It gives you a specific case where ttt and the "simplified" answer are not the same. Your simplification is simply not always correct. It is correct when f[1] > 0, f[2] > 0 though. That's why you need to specify it, or imply it by using PowerExpand. $\endgroup$ Oct 20, 2018 at 21:36


Your Answer

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