# 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$$

$$\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 ?

• why don't you sub $u = 2 \tan \theta.$ it does not cost you anything. – abel Mar 15 '15 at 21:19
• this seems correct, note that $\int \frac{\mathrm{d}x}{x - a} = \log\left| x - a \right| + \mathcal{c}$ – N3buchadnezzar Mar 15 '15 at 21:20
• The "correction steps" is the partial fractions form of your $\int \frac{du}{u^2-4}$. – Thomas Andrews Mar 15 '15 at 21:21

Partial fraction decomposition: $$\frac{1}{u^2-4}=\frac14\,\Bigl(\frac{1}{u-2}-\frac{1}{u+2}\Bigr).$$

Substitute tan theta =x then sec^2 will get cancelled out and u have the integral in the form 1/x^2-a^2 where a=2 Use formula 1/2a log |X-a|-log|x+a| So answer should be 1/4 log |tan theta -2| -|tan theta. +2|

\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|$$