Are this passages wrong in order to solve a complex equation? Let's consider the equation in the complex variable $w$ $$\alpha+\frac{w}{4\pi}+\frac{e^{-2\beta w}}{8\pi\beta}=0$$ with $\alpha$ and $\beta$ real parameters, $\beta>0$. By writing $w=a+ib$, it can be put in the form $$\frac{e^{-2\beta (a+ib)}}{2\beta}=-4\pi\alpha-a-ib.$$ Equating, modulus ad phase of the two sides, I get
$$\begin{cases}
   \frac{e^{-4\beta a}}{4\beta^2}=(4\pi\alpha+a)^2+b^2\\
-2\beta b=\arctan{\frac{b}{4\pi\alpha+a}}+\pi
  \end{cases}$$
In the second equation, if I move $\pi$ to the first side and take the tangent of both sides I get
$$-\tan{2\beta b}=\frac{b}{4\pi\alpha+a},$$ since the tangent is $\pi$-periodic. I am not sure about this last passage. If this is right, proceding in the same manner I get that the equation $$\alpha+\frac{w}{4\pi}-\frac{e^{-2\beta w}}{8\pi\beta}=0,$$ has the same set of solution of the previous one (I just don't jave the $\pi$ added in the phase equation). Is this statement correct or the passage I was dubious about is wrong (and maybe introduces spurious solutions)?
 A: In my humble opinion, it is easier to work without the modulus (but I may be wrong).
Considering the equation
$$\alpha+\frac{w}{4\pi}+\frac{e^{-2\beta w}}{8\pi\beta}=0$$
Making $w=a+ib$ and expanding, you have
$$\Big[e^{-2 a \beta } \cos (2
   b \beta )+2 a \beta +8 \pi  \alpha  \beta\Big]+i \Big[2 b \beta -e^{-2 a \beta } \sin (2 b \beta )\Big]=0$$ Using the imaginary part
$$2 b \beta -e^{-2 a \beta } \sin (2 b \beta )=0 \implies a=-\frac{\log (2 b \beta  \csc (2 b \beta ))}{2 \beta }$$
Plug this in the real part to obtain
$$8 \pi  \alpha  \beta +2 b \beta  \cot (2 b \beta )-\log (2 b \beta  \csc (2 b \beta))=0$$
To simplify notations, let $x=2 b \beta$ and you are left with the equation
$$8 \pi  \alpha  \beta +x \cot (x)-\log (x \csc (x))=0$$ which can only be solved using numerical methods in the range $0\leq x \leq \pi$ in order to find the zero of function
$$f(x)=x \cot (x)-\log (x \csc (x))+k\qquad \text{with} \qquad k=8 \pi  \alpha  \beta $$
This equation is rather easy to solve since, using Padé approximants, we have
$$x \cot (x)-\log (x \csc (x))\sim \frac{947 x^4-20718 x^2+34020}{38 x^4-3708 x^2+34020}$$ and the estimate is given solving a quadratic equation in $x^2$; to plish the root, Newton method should work like a charm.
Trying with $k=5.678$
$$\left(
\begin{array}{cc}
n & x_n \\
 0 & 2.584818520 \\
 1 & 2.579994586 \\
 2 & 2.579957834 \\
 3 & 2.579957832
\end{array}
\right)$$
