$$\int\frac{dx}{(1+x^2)^2}$$

Here, $$x=\tan\theta, dx=\sec^2\theta\,d\theta$$

$$1+x^2 = 1+\tan^2\theta = \sec^2 \theta$$

So we have now that,

$$\int\frac{dx}{(1+x^2)^2} = \int \frac{\sec^2 \theta}{\sec^4 \theta} d\theta$$

I have no idea what just happened. I know how to do $U$-sub, but how can you just set $X$ to be something? Normally, you set $u=f(x)$ and go from there. You never set $X$ equal to something. Is this something different?

**PS:** I tried integrating by partial fractions, and got right back to the initial integral.