<s>[INST] Complex number + trigo : $-1 + \tan(3)i$ , find modulus and argument I have $-1 + \tan(3)i$ and must find its modulus and its argument. I tried to solve it by myself for hours, and then I looked at the answer, but I am still confused with a part of the solution.
Here is the provided solution:
$$\begin{align}
z &= -1 + \tan(3)i \\
&= -1 + \frac{\sin(3)}{\cos(3)}i \\
&= \frac1{\left|\cos(3)\right|}  ( \cos(3) + i(-1)\sin(3)) \\
&= \frac1{\left|\cos(3)\right|}  e^{-3i} \\
&= \frac1{\left|\cos(3)\right|}  e^{(2\pi-3)i}
\end{align}$$
I don't understand how we get to $$ \frac1{\left|\cos(3)\right|}(\cos(3) + i(-1)\sin(3)) $$
How did they get this modulus $1/|\cos(3)|$, and the $-1$ in the imaginary part? How did they reorder the previous expression to obtain this?
I also don't see why they developed the last equality. They put $2\pi-3$ instead of $-3$; OK, it is the same, but what was the aim of a such development?
Thanks!
 [/INST] Let $z = -1 + \tan(3) \ i$. In the complex plane, this would be the point $(-1, \tan(3))$, which has length 
$$|z| = \sqrt{(-1)^2 + \tan^2(3)} = \sqrt{1 + \frac{\sin^2(3)}{\cos^2(3)}} = \sqrt{\frac{1}{\cos^2(3)}} \sqrt{\cos^2(3) + \sin^2(3)} = \frac{1}{|\cos(3)|}$$
For the last equality, we used $\sin^2(x) + \cos^2(x) = 1$. Now we want to write 
$$z = |z| \ e^{\omega i} = |z| \ (\cos(\omega) + i \sin(\omega))$$
for some $\omega$. It turns out this can be done easily by writing
$$z = \frac{1}{\cos(3)}(-\cos(3) + i \sin(3)) = \frac{1}{|\cos(3)|}(\cos(-3) + i \sin(-3)) = \frac{1}{|\cos(3)|} e^{-3i}$$ 
Since $-3 \notin [0, 2\pi)$ they decided to add $2 \pi$ to the angle, so that it is inside this interval.  
</s>