Trouble solving $\int\frac{\sec^2\theta}{\tan^2\theta-4}d\theta$ I need to solve
$$\int\frac{\sec^2\theta}{\tan^2\theta-4}d\theta$$
I can easily spot that I need to substitute
$$u=\tan\theta$$
$$du=\sec^2\theta d\theta$$
Which lead me to
$$\int\frac{du}{u^2-4}$$
However, if I look at the correction steps, I should be trying to solve instead
$$\int\bigg[\frac{\frac{1}{4}}{u-2}+\frac{\frac{-1}{4}}{u+2}\bigg]du$$
Now I tought maybe I've chosen a wrong substitution variable, but they actually use the same $u=\tan\theta$.
What is wrong with my substitution ?

\begin{align}
\frac{\sec^2x}{\tan^2x-4}&=\frac{1}{\sin^2x-4\cos^2x}\\
&=\frac{1}{(\sin x-2\cos x)(\sin x-2\cos x)}\\
&=\frac14\frac{4\sin^2x+4\cos^2x}{(\sin x+2\cos x)(\sin x-2\cos x)}\\
&=\frac14\frac{(2\sin^2x+2\cos^2x-5\sin x \cos x )-(-2\sin^2x-2\cos^2x-5\sin x \cos x )}{(\sin x+2\cos x)(\sin x-2\cos x)}\\
&=\frac14\frac{(\cos x-2\sin x)(2\cos x -\sin x)+(\cos x + 2\sin x)(2\cos x + \sin x)}{(\sin x+2\cos x)(\sin x-2\cos x)}\\
&=\frac14\frac{(\cos x-2\sin x)(2\cos x -\sin x)}{(\sin x+2\cos x)(\sin x-2\cos x)}+\frac14\frac{(\cos x + 2\sin x)(2\cos x + \sin x)}{(\sin x+2\cos x)(\sin x-2\cos x)}\\
&=-\frac14\frac{\cos x-2\sin x}{\sin x+2\cos x}+\frac14\frac{\cos x + 2\sin x}{\sin x-2\cos x}\\
\end{align}
thus $$\int\frac{\sec^2x}{\tan^2x-4}dx=-\frac14\log|\sin x+2\cos x|+\frac14\log|\sin x-2\cos x|$$
