0
$\begingroup$

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?

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

1 Answer 1

2
$\begingroup$

Try PowerExpand

PowerExpand[Exp[I k x] Sqrt[Exp[-2 I  k x] y^2]]
(*y*)
$\endgroup$
2
  • $\begingroup$ What if $y$ is a -ve number? $\endgroup$
    – Galilean
    Commented Jun 19, 2020 at 8:57
  • $\begingroup$ @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. $\endgroup$
    – Nasser
    Commented Jun 19, 2020 at 8:59

Your Answer

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

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