# Why does this simple algebraic expression not simplify to zero?

Define a simple symbolic expression a, then let b be the square root of its square:

a = A + Sqrt[A + B];

a^2 // Expand

A + A^2 + B + 2 A Sqrt[A + B]

b = Sqrt[%]

Sqrt[A + A^2 + B + 2 A Sqrt[A + B]]


The difference, when simplified under the assumption that both A and B are positive reals should give zero:

a - b

A + Sqrt[A + B] - Sqrt[A + A^2 + B + 2 A Sqrt[A + B]]

FullSimplify[%, A > 0 && B > 0 && A ∈ Reals && B ∈ Reals]

A + Sqrt[A + B] - Sqrt[A + A^2 + B + 2 A Sqrt[A + B]]


Yet in the symbolic form it doesn't. What am I missing?

• FullSimplify[a == b, A > 0 && B > 0 && A \[Element] Reals && B \[Element] Reals] returns True, so it is probably just a little too hard for Mathematica – mikado Sep 18 '17 at 20:22

Maybe you can "cheat" as follows:

FullSimplify[
A+Sqrt[A+B]-Sqrt[A+A^2+B+2 A Sqrt[A+B]] /. B->c-A,
0<A<c
]


0

Here is another variation of this idea:

FullSimplify[
A+Sqrt[A+B]-Sqrt[A+A^2+B+2 A Sqrt[A+B]],
A+B==c && A>0 && B>0 && c>0
]


0