0
$\begingroup$

I have complicated function g[s1,s2,Ss,t1,t2,m] with the numerator containing only the summands with the square root factor. Its main part coincides with the full square root of the denominator of g. However, they doesn't cancel each other, within Mathematica. Precise form of these factors are

Sqrt[(-s2 + Ss + t1) (m^2 - s2 + t1 - t2) (m^2 t1 - s2 t2)]

in the numerator,

Sqrt[(m^4 t1 - m^2 (s2 (t1 + t2) + t1 (t2 - t1)) + s2 t2 (s2 - t1 + t2))]

in the denominator. They must cancel each other up to the multiplier in the numerator. But this doesn't happen. The command Simplify[g[...]] doesn't work. The command FullSimplify doesnt work also.

How to make Mathematica cancel these square roots?

$\endgroup$

3 Answers 3

4
$\begingroup$

You can try FullSimplify[expr, TransformationFunctions->{Automatic, PowerExpand}]. First your expression:

expr = Sqrt[(-s2+Ss+t1) (m^2-s2+t1-t2) (m^2 t1-s2 t2)] /
       Sqrt[(m^4 t1-m^2 (s2 (t1+t2)+t1 (t2-t1))+s2 t2 (s2-t1+t2))];

Then, FullSimplify:

FullSimplify[
    expr,
    TransformationFunctions->{Automatic,PowerExpand}
]

I Sqrt[s2 - Ss - t1]

However, note the following comment from the documentation:

The transformations made by PowerExpand are correct in general only if c is an integer or a and b are positive real numbers.

$\endgroup$
3
  • $\begingroup$ Unfortunately, it doesn't work for me... It only separates the multipliers inside the root. $\endgroup$ Jul 26, 2017 at 19:16
  • $\begingroup$ @JohnTaylor Then you should provide an example where it doesn't work. $\endgroup$
    – Carl Woll
    Jul 26, 2017 at 19:54
  • $\begingroup$ @Carl Woll Could you please kindly comment, why in this case FullSimplify works, while Simplify does not? $\endgroup$ Jul 27, 2017 at 7:18
2
$\begingroup$

Try also the following. Here is your expression:

 expr = Sqrt[(-s2 + Ss + t1) (m^2 - s2 + t1 - t2) (m^2 t1 - s2 t2)]/
 Sqrt[(m^4 t1 - m^2 (s2 (t1 + t2) + t1 (t2 - t1)) + 
    s2 t2 (s2 - t1 + t2))];

Let us put the both expressions under the same radical:

    expr /. Sqrt[a_]/Sqrt[b_] -> Sqrt[a/b] // Simplify
(*  Sqrt[-s2 + Ss + t1]   *)

Have fun!

$\endgroup$
2
$\begingroup$

Mathematica treats all values by default as complex. If this is the case, you cannot cancel numerator and denominator. If square roots are real, you have to tell this to Mathematica, for example like this

$Assumptions=(-s2+Ss+t1)(m^2-s2+t1-t2)(m^2 t1-s2 t2)>0&&
(m^4 t1-m^2 (s2 (t1+t2)+t1 (t2-t1))+s2 t2 (s2-t1+t2))>0;
expr = Sqrt[(-s2+Ss+t1) (m^2-s2+t1-t2) (m^2 t1-s2 t2)] /
Sqrt[(m^4 t1-m^2 (s2 (t1+t2)+t1 (t2-t1))+s2 t2 (s2-t1+t2))];
FullSimplify[expr]
$\endgroup$

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .