# Symplifying expressions with exponentials inside square root

I have an expression $$\exp (i k x) \sqrt{y^2 \exp (-2 i k x)}$$ When I put this in Mathematica and do FullSimplift, it gives

FullSimplify[Exp[I k x] Sqrt[Exp[-2 I k x] y^2]]


The output is $$e^{i k x} \sqrt{y^2 e^{-2 i k x}}$$ Even if I give all proper assumptions $$\{x,y, k\} \in \mathbb R$$ and $$-\pi < k \leq \pi$$ like this

FullSimplify[Exp[I k x] Sqrt[Exp[-2 I k x] y^2], {x, y, k} \[Element] Reals && -\[Pi] < k <= \[Pi]]


The output comes as $$\left| y\right| e^{i k x} \sqrt{e^{-2 i k x}}$$ But the exponentials should not be there anymore, the result should be only $$\left| y\right|$$.

What simplification or assumptions to make, to get the desired result?

• Mathematica will not choose a branch of Sqrt for you. Sqrt[z] where z is complex is not unique. Commented Jun 19, 2020 at 8:54
• @user67431 can I myself choose the branch for sqrt? Commented Jun 19, 2020 at 9:00

Try PowerExpand
PowerExpand[Exp[I k x] Sqrt[Exp[-2 I  k x] y^2]]

• What if $y$ is a -ve number? Commented Jun 19, 2020 at 8:57
• @Galilean see help. It says are correct in general only if c is an integer or a and b are positive real numbers. and in general disregards all issues of branches of multivalued functions, You can use Assumptions on it. Commented Jun 19, 2020 at 8:59