Going from integral of $dx$ to integral of $d\theta$? If I'm substituting $$x = \tan(\theta) \qquad \text{into} \qquad \int \frac{1}{(1+x^2)^2} \, dx $$
I get $$\int \cos^4(\theta) \, dx \quad \text{but the correct answer is} \quad \int \cos^2(\theta) \, d\theta $$
I don't understand why because $$ (1 + \tan^{2}(\theta)) = \sec^2(\theta) \qquad\text{so}\qquad \frac{1}{(\sec^2(\theta))^2} \quad \text{should be} \quad \cos^4(\theta)  $$
right?
I don't understand what I'm doing wrong.

You forgot about the $dx$, it would be $\sec^2 \theta \, d \theta $, So doing the required cancellations, you would get $$\int \cos^2 \theta \, d\theta$$ This can be tackled by writing $\cos^2 \theta$ as $\dfrac{1+\cos 2\theta }{2}$ and then integrating.
