4
$\begingroup$

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?

$\endgroup$
5
  • 3
    $\begingroup$ FullSimplify[expr^2, x > 0] works though. $\endgroup$ Apr 30, 2017 at 20:08
  • $\begingroup$ @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. $\endgroup$
    – Kagaratsch
    Apr 30, 2017 at 21:05
  • 1
    $\begingroup$ FullSimplify[ComplexExpand[expr], x>0] $\endgroup$
    – W.Mason
    May 1, 2017 at 7:03
  • $\begingroup$ @W.Mason With what version of Mathematica did FullSimplify[ComplexExpand[expr], x>0] simplify to zero? $\endgroup$
    – bbgodfrey
    Apr 18, 2018 at 17:54
  • $\begingroup$ @bbgodfrey Maybe a 11.2 then, it seems that this method fails in 11.3 somehow. $\endgroup$
    – W.Mason
    May 26, 2018 at 3:09

2 Answers 2

2
$\begingroup$

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   *)
$\endgroup$
1
$\begingroup$

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 *)
$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.