<s>[INST] Argument of a complex fraction, why different answers? I want to take the argument of the following complex fraction. Using the second method I get a different answer, why is that?
$$
G(\omega)=
\frac{1}{(1+2\omega i)^2}
 \tag 1
$$
Method 1:
\begin{align}
\arg\frac{1}{(1+2\omega i)^2}
&=\arg1-\arg\Big((1+2\omega i)^2\Big) \tag 2\\
&=\arg1-\arg\Big((1+2\omega i)(1+2\omega i)\Big) \tag 3\\
&=\arg1-\arg(1+2\omega i)-\arg(1+2\omega i) \tag 4\\
&=\arctan\frac{0}{1}-\arctan\Big(\frac{2\omega}{1}\Big)-\arctan\Big(\frac{2\omega}{1}\Big) \tag 5\\
&=-2\arctan(2\omega) \tag 6
\\
\end{align}
Method 2:
Expand the denominator:
$$
(1+2\omega i)^2=1-4\omega^2+4\omega i
$$
So I have
\begin{align}
\arg \frac{1}{(1+2\omega i)^2}
&=\arg\frac{1}{1-4\omega^2+4\omega i} \tag 7\\
&=\arg1-\arg(1-4\omega^2+4\omega i)\tag 8\\
&=-\arctan\bigg (\frac{4\omega}{1-4\omega^2}\bigg) \tag 9
\end{align}
So $(6)$ is not equal to $(9)$, What is wrong with method 2?
 [/INST] The problem is that given $x = x + i y$ you are using $\arctan(y/x)$ with one argument. You should use instead $\arctan(x,y)$. You can find those options in matlab or MATHEMATICA. Note that $\arctan(y/x)=\arctan((-y)/(-x))$ and $\arctan((-y)/x)=\arctan(y/(-x))$
</s>