Solve $\operatorname{cotan}(z) = 2 + i$ As the title says, I have to solve: $\operatorname{cotan}(z) = 2 + i$ 
I have gotten this far:
$$\tan(z) = \frac{1}{2+i} = \frac{2}{5} - \frac{1}{5}i$$
I thought, maybe writing $z=x+iy$ would work. I found the following online (via complex exponential):
$$\tan(x+iy) = \frac{\sin(2x)+i\sinh(2y)}{\cosh(2y)+\cos(2x)}.$$
But equating the real and imaginary parts does not really give me something I can work with (or is it just rough work?).
Any hints or tips would be appreciated!
 A: The way I do these problems is writing $\tan$ as a quotient of complex exponentials. Let $w=\frac{2}{5}-\frac{1}{5}i$, then
\begin{align}
\frac{\sin z}{\cos z} &= w \\
\frac{e^{iz}-e^{-iz}}{e^{iz}+e^{-iz}} &= iw \\
\frac{1-e^{-2iz}}{1+e^{-2iz}} &=iw \\
1-e^{-2iz} &= iw(1+e^{-2iz}), \text{ so } e^{-2iz} = \frac{1-iw}{1+iw}.
\end{align}
Let's first calculate that last fraction:
$$\frac{1-iw}{1+iw} = \frac{1}{2}-\frac{1}{2}i = \frac{1}{2}\sqrt{2}e^{-i\pi/4+2k\pi i}$$
I'm sure you can verify this. Now taking the complex logarithm on both sides yields
\begin{align}
-2iz &= \text{Log}\left(\frac{1}{2}\sqrt{2}e^{-i\pi/4+2k\pi i}\right) = \ln\frac{1}{2}\sqrt{2} + i\left(-\frac{\pi}{4}+2\pi k\right)\\
z &= \left(\frac{\pi}{8} + k\pi\right)+\frac{1}{4}i\ln 2
\end{align}
A: No need to go through the tangent. Note that
$$
\cot z=\frac{\cos z}{\sin z}=
\frac{\dfrac{e^{iz}+e^{-iz}}{2}}{\dfrac{e^{iz}-e^{-iz}}{2i}}=
i\frac{e^{iz}+e^{-iz}}{e^{iz}-e^{-iz}}=i\frac{e^{2iz}+1}{e^{2iz}-1}
$$
so your equation can be rewritten as
$$
ie^{2iz}+i=we^{2iz}-w
$$
or else
$$
e^{2iz}(w-i)=w+i
$$
and finally
$$
e^{2iz}=\frac{w+i}{w-i}
$$
with $w=2+i$. The right-hand side so becomes
$$
\frac{2+i+i}{2+i-i}=1+i=\sqrt{2}e^{i\pi/4}
$$
Writing $z=x+iy$, the left-hand side becomes $e^{-2y}e^{2ix}$ and so we get
$$
e^{-2x}=\sqrt{2},\qquad e^{2ix}=e^{i\pi/4}
$$
so $2y=-\log\sqrt{2}$ and $2x=\frac{\pi}{4}+2k\pi$.
