# Simplification of Sqrt[Exp[u]] Sqrt[Exp[-u]]

After some computations I end up with the following expression:

Sqrt[Exp[-z/(4*Sqrt[2])]] Sqrt[Exp[z/(4*Sqrt[2])]]


where $z$ is actually complex.

For reasons I don't understand, Mathematica won't simplify this to $1$.

According to the documentation, Mathematica chooses the branch cut for $\sqrt{z}$ to lie along the negative real axis.

Am I missing something or getting something wrong?

Any help is much appreciated.

• You can try FullSimplify[Sqrt[Exp[-z/(4*Sqrt[2])]] Sqrt[Exp[z/(4*Sqrt[2])]], Assumptions -> {-Pi <= Im[z] <= Pi}]. – b.gates.you.know.what Apr 13 '18 at 14:43
• @b.gatessucks Thanks, that certainly gives $1$ as output but I shouldn't need to do assumptions, right? As far as I can see, the only condition you have for this simplification to be true is that the sum of the argument of both numbers is between -pi and pi, which is always true in this case... – Edu Apr 13 '18 at 14:55
• I'm voting to close this question as off-topic because the issue it raises is not really a Mathematica issue but a matter of the OP not having grasped the mathematics involved. – m_goldberg Apr 13 '18 at 15:22
• @m_goldberg Could you at least point out the mistake(s), please? – Edu Apr 13 '18 at 15:31
• I think that b.gatessucks comment already does that. – m_goldberg Apr 13 '18 at 16:01

(Michael already gave a good answer, but I'll leave mine here as it includes a few extra observations)

This is a tricky question. First, here's a counterexample:

expr = Sqrt[Exp[-z/(4*Sqrt[2])]] Sqrt[Exp[z/(4*Sqrt[2])]];

FullSimplify[expr /. z->4 Sqrt[2] Pi I]


-1

Next, using PowerExpand as @Ulrich did:

PowerExpand[expr, Assumptions->True]
% //TeXForm


E^(I π (Floor[1/2 - Im[z]/(8 Sqrt[2] π)] + Floor[1/2 + Im[z]/(8 Sqrt[2] π)]))

$\exp \left(i \pi \left(\left\lfloor \frac{1}{2}-\frac{\Im(z)}{8 \sqrt{2} \pi }\right\rfloor +\left\lfloor \frac{\Im(z)}{8 \sqrt{2} \pi }+\frac{1}{2}\right\rfloor \right)\right)$

The arguments of the Floor expressions are always real. Here is a plot of them:

Plot[{Floor[1/2 - x], Floor[1/2 + x]}, {x, -3, 3}]


It would seem that the sum of the two Floor expressions should be 0. However, it turns out that the endpoints are not consistent. For example:

Reduce[Floor[1/2 - x] == 1, x, Reals]
Reduce[Floor[1/2 + x] == -1, x, Reals]


-(3/2) < x <= -(1/2)

-(3/2) <= x < -(1/2)

So, at the points n+1/2 the sum is not 0. Another way to see this is to use NumberLinePlot:

NumberLinePlot[Floor[1/2-x] + Floor[1/2+x] == 0, {x, -3, 3}]


Summarizing, your expression is almost always equal to 1, except when the imaginary part of z is $8 \sqrt{2} \pi \left(n+\frac{1}{2}\right)$ for integer $n$.

For $z = 4 \sqrt{2} \pi i$, we have $$\sqrt{e^{-z/4 \sqrt{2}}} = \sqrt{e^{-i\pi}} = \sqrt{-1} = i,$$ and $$\sqrt{e^{z/4 \sqrt{2}}} = \sqrt{e^{i\pi}} = \sqrt{-1} = i.$$ So the product of the two square roots is $-1$ in this one case. Note that in this case, $$\arg e^{-z/4 \sqrt{2}} \neq -\frac{\Im(z)}{4 \sqrt{2}},$$ since $\arg (e^{-i \pi}) = \arg (-1) = \pi$, not $-\pi$.

In general, your desired simplification is true so long as $$\frac{\Im(z)}{4 \sqrt{2} \pi} \neq 1 \mod 2.$$ Unfortunately, I haven't been able to find a way to use Assumptions to tell Mathematica to assume this. As b.gatessucks notes in the comments, we can write

Simplify[Sqrt[Exp[-z/(4*Sqrt[2])]] Sqrt[Exp[z/(4*Sqrt[2])]],
Assumptions -> {-4 Sqrt[2] Pi < Im[z] < 4 Sqrt[2] Pi}]


which does simplify to 1. But this should also simplify to one if {4 Sqrt[2] Pi < Im[z] < 12 Sqrt[2] Pi}, and using this for our Assumptions doesn't lead to a simplification. It may be that Mathematica isn't programmed to accept such a condition.

PowerExpand only shows one solution

PowerExpand[Sqrt[Exp[-z/(4*Sqrt[2])]] Sqrt[Exp[z/(4*Sqrt[2])]],Assumptions -> Element[z, Reals]]
(* 1*)
PowerExpand[Sqrt[Exp[-z/(4*Sqrt[2])]] Sqrt[Exp[z/(4*Sqrt[2])]],Assumptions -> Element[z, Complexes]]
(*E^(I \[Pi] (Floor[1/2 - Im[z]/(8 Sqrt[2] \[Pi])] +Floor[1/2 + Im[z]/(8 Sqrt[2] \[Pi])])) *)


Complex simplification Substituting the complex number z=(a+I b)/(4*Sqrt[2])]] the question is how to simplify the expression

expr=Sqrt[Exp[-a-I b]]Sqrt[Exp[a+I b]]


The roots can be written as

Sqrt[Exp[a+I b]]==\[PlusMinus] Exp[a/2]Exp[I b/2]
Sqrt[Exp[-a-I b]]==\[PlusMinus] Exp[-a/2]Exp[-I b/2]


and the product evaluates to

expr=Sqrt[Exp[a+I b]]Sqrt[Exp[-a-I b]]==\[PlusMinus]1


two possible values +1and -1.

• $\sqrt{zw} = \sqrt{z} \sqrt{w}$ is true only when $-\pi<Arg(z)+Arg(w)\le\pi$. Considering $z$ and $w$ the two exponentials of my example, their arguments are respectively ${Im(z)\over 4\sqrt{2}}$ and ${-Im(z)\over 4\sqrt{2}}$, so the condition holds, doesn't it? – Edu Apr 13 '18 at 15:27
• The square root of a complex number has two solutions! – Ulrich Neumann Apr 13 '18 at 15:42
• The square root of any number has two solutions. My earlier comment addresses how to solve the ambiguity. – Edu Apr 13 '18 at 15:46