The Simplify function is not completely simplified

Hello,

In Mathematica,

FullSimplify[(Sqrt[1/a^2]  a  G  \[Pi]  u  Sqrt[a^2/(a^2 + 
        
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\))]  (Sqrt[a^2 + 
        
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\)] - Sqrt[a^2 + 
        
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)]))/Sqrt[a^2 + 
    
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)], Assumptions -> a > 0]

will produce

(a G \[Pi] u Sqrt[1/(a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\))] (Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\)] - Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)]))/Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)]

But

FullSimplify[(Sqrt[1/a^2] a G \[Pi] u Sqrt[a^2/(a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\))] (Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\)] - Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)]))/Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)], 
 Assumptions -> a > 0 && Subscript[R, 1] > 0]

will produce the right result

a G \[Pi] u (-(1/Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\)]) + 1/Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)])

What is the reason?

If you do not tell Mathematica that variables are positive or real then it will often assume that variables may be complex. For your problem that may mean that you have zeros in denominators and multiplying by zero may give solutions that you will not accept. Telling it r1>0 or Element[r1,Reals] is enough to know that you do not have zero denominators. Telling it that r1!=Sqrt[-1]a is not enough for it to understand that.

The two expressions are not equivalent if you allow R_1 to be complex:

expr1 = FullSimplify[(Sqrt[1/a^2]   a   G   \[Pi]   u   Sqrt[
      a^2/(a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\))]   (Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\)] - Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)]))/Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)], 
  Assumptions -> a > 0]
expr2 = FullSimplify[(Sqrt[1/a^2]   a   G   \[Pi]   u   Sqrt[
      a^2/(a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\))]   (Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\)] - Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)]))/Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)], 
  Assumptions -> a > 0 && Subscript[R, 1] > 0]
{expr1, expr2} /. {a -> 1, Subscript[R, 1] -> 2 I, 
   Subscript[R, 2] -> 1, G -> 1, u -> 1} // N

Here is a much simpler situation exhibiting the same behaviour:

expr1 = FullSimplify[Sqrt[1/r^2]  Sqrt[r^2]]
expr2 = FullSimplify[Sqrt[1/r^2]  Sqrt[r^2] , Assumptions -> r > 0]
{expr1, expr2} /. r -> I

May you tell me why

Telling it that r1!=Sqrt[-1]a is not enough for it to understand that.

Thanks a lot.

Do not know. The algorithm in FullSimplify may not include analysis of the code to handle NotEqual and specific single values for variables.

Okay. I think it is a bug.

The condition r1!=Sqrt[-1]a is not enough to allow the simplification; for example, r1 = 2 I a is also problematic:

expr0 = (Sqrt[1/a^2]    a    G    \[Pi]    u    Sqrt[
           a^2/(a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\))]   
    (Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(1\), \(2\)]\)] - Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)]))/Sqrt[a^2 + 
\!\(\*SubsuperscriptBox[\(R\), \(2\), \(2\)]\)]
expr2 = FullSimplify[expr0, 
    Assumptions -> a > 0 && Subscript[R, 1] > 0]
{expr0, expr2} /. Subscript[R, 1] -> 2 I  a /. a -> 1 // Simplify

Yes! I know now.