# Apparently simple simplification fails?

Consider the expression

expr = E^x Sqrt[1 - E^(-4 x)] - Sqrt[-E^(-2 x) + E^(2 x)]


At least for x>0 I would expect this to be equal to zero (because E^x is manifestly positive, so that it should only influence the scale when both square roots are expressed in polar coordinates as a complex number). But if I try

Assuming[x > 0, expr // FullSimplify]


E^x Sqrt[1 - E^(-4 x)] - E^-x Sqrt[-1 + E^(4 x)]

The result is a bit disappointing. It should still be zero (one can even verify it by plotting some range of x>0), but Mathematica does not seem to see it. How should I modify the command such that Mathematica properly returns zero after simplification?

• FullSimplify[expr^2, x > 0] works though. – Sjoerd C. de Vries Apr 30 '17 at 20:08
• @SjoerdC.deVries Yes, I noticed that changing the function a little leads to better simplification. But expr itself should be zero too. Basically, I am trying to understand what Mathematica gets hung up on here. To have a larger toolbox for more complicated/less obvious examples. – Kagaratsch Apr 30 '17 at 21:05
• FullSimplify[ComplexExpand[expr], x>0] – W.Mason May 1 '17 at 7:03
• @W.Mason With what version of Mathematica did FullSimplify[ComplexExpand[expr], x>0] simplify to zero? – bbgodfrey Apr 18 '18 at 17:54
• @bbgodfrey Maybe a 11.2 then, it seems that this method fails in 11.3 somehow. – W.Mason May 26 '18 at 3:09

Substitute E^x

expr[x_] = E^x Sqrt[1 - E^(-4 x)] - Sqrt[-E^(-2 x) + E^(2 x)];

sol = Solve[E^x == y, x, Reals]

(*   {{x -> ConditionalExpression[Log[y], y > 0]}}   *)

FullSimplify[expr[x /. First@sol], y > 0]

(*   0   *)


Just another way:

\$Version
(* "11.3.0 for Microsoft Windows (64-bit) (March 7, 2018)" *)

expr = E^x*Sqrt[1 - E^(-4 x)] - Sqrt[-E^(-2 x) + E^(2 x)];

FullSimplify[FullSimplify[expr // ComplexExpand, x > 0] // ComplexExpand, x > 0]
(* 0 *)