Does Wolfram Alpha solve this equation incorrectly?

382 Views Asked by At

I would like to solve $\left\lvert 1+e^{ix}+e^{iy} \right\rvert=z$ as a function of $y$

For $z \in [0,3]$ this equation has real solutions $x,y$. The level sets are closed curves (if $z \neq 0,1,3$), see for example $z=2$:

the contour plot for $z=2$

However, if I let wolframalpha solve this equation

it calculates the solutions

$$y(x,z)= -i \log(-e^{ix} \pm 1-1).$$ If I enter this function in Mathematica and plot it, the Imaginary part is even for admissible values of $x,z$ non-zero. So something is wrong here.

By the implicit function theorem I should be able to solve this equation for example $z=2$ locally w.r.t. $y$ as a function of $x$. Why does this fail here?

Edit: Apparently, the question boils down to the question. How do I have to interpret the solution $y(x,z)$ so that this makes sense in my context?

1

There are 1 best solutions below

3
On BEST ANSWER

My answer does not address the issue with WA, but shows how to obtain $y$ as a function of $x$ and parameter $z$.

  • Firstly, your question in $\mathbb{C}$ can be transformed into a question in $\mathbb{R^2}$.

Here is how: using $|z|^2=z \bar z$, your constraint can be made equivalent to:

$$(1+e^{ix}+e^{iy})(1+e^{-ix}+e^{-iy})=z^2$$

By expanding it and using Euler formula for $cosine$, we obtain:

$$3+2\cos(x)+2\cos(y)+2\cos(x-y)=z^2$$

i.e., an implicit equation:

$$\tag{1}\cos(x)+\cos(y)+\cos(x-y)=k \ \ \text{with} \ \ k:=\dfrac{z^2-3}{2}$$

thus with $0 \leq k \leq 3.$

I have plotted with Matlab the curves corresponding to different values of $k$ (see below).

  • In a second step, from implicit equation (1), one can obtain the explicit (cartesian) form:

$$\tag{2}y=2 \tan^{-1}\left[A\left(\sin(x)\pm \sqrt{\sin(x)^2-(1+k)(k-1-2\cos(x))}\right)\right] \ \ \text{where} \ A:=\dfrac{1}{1+k}.$$

Proof of (2): Using addition formula $\cos(x-y)=\cos(x)\cos(y)+\sin(x)\sin(y)$, (1) can be written under the form

$$\tag{3}\cos(y)(1+\cos(x))+\sin(y)\sin(x)=k-\cos(x)$$

Thanks to classical formulas :

$$\tag{4} \cos(y)=\dfrac{1-t^2}{1+t^2}, \sin(y)=\dfrac{2t}{1+t^2}$$

with

$$\tag{5} t=\tan \dfrac{y}{2},$$

(3) can be transformed into a quadratic equation with variable $t$:

$$t^2(1+k)-2t \sin(x)+(k-1-2\cos(x))=0$$

whose solutions are $t=A\left(\sin(x)\pm \sqrt{\sin(x)^2-(1+k)(k-1-2\cos(x))}\right)$

($A$ has been defined by (2)). Taking (5) into account, we obtain formulas (1).

enter image description here

(One should consider this picture as drawn on a torus).