<s>[INST] Integral of $\frac{1}{\sin^2(x)\cos^2(x)}$ $$ I = \int\frac{1}{\sin^2(x)\cos^2(x)}$$ 
I have tried the following:
$$\sin^2x = \sin x \cdot \sin x = \frac{1}{2}(1 - \cos2x)$$
$$\cos^2x = \cos x \cdot \cos x = \frac{1}{2}(1 + \cos2x)$$
The integral becomes:
$$I = 4\int\frac{1}{1 - \cos^2(2x)} = 4\int\frac{1}{\sin^2(2x)}$$
Substitute $u = 2x \implies du = 2dx$
$$I = 2\int\frac{1}{\sin^2u} =  -2\cot(u)$$
Plugging back x I get:
$$I = -2\cot(2x)$$
I tried plugging in the integral into an integral-calculator and the answer was: $\tan(x) - \cot(x)$. Can you help me identify what I did wrong?
 [/INST] \begin{align*}
I & = \int\frac{1}{\sin^2(x)\cos^2(x)} \, dx\\
&= \int\frac{\sin^2x+\cos^2x}{\sin^2(x)\cos^2(x)} \, dx\\
&= \int\frac{1}{\cos^2(x)} \, dx + \int\frac{1}{\sin^2(x)} \, dx\\
&= \int\sec^2(x) \, dx + \int\csc^2(x) \, dx\\
&=\tan x -\cot x+c
\end{align*}
But this is same as your answer, so nothing wrong with what you arrived at.
</s>