How to calculate $\int \frac{dx}{(a^2 + x^2)^2}$? I'm trying to use a trig substitution but I'm stuck. Here's what I did so far: 
$$\int \frac{dx}{(a^2 + x^2)^2}$$
Let $x = a\sin \theta, dx = a\cos \theta d\theta$
$$\int \frac{a cos\theta d\theta}{(a^2 + a^2 sin^2 \theta)^2} = \int \frac{a\cos \theta d\theta}{(a^2(1+sin^2\theta))^2} $$
$$\int \frac{a\cos \theta d\theta}{(a^2 \cos^2\theta)^2} =\int \frac{d\theta}{a^3cos^3\theta}  $$
I don't know what to do anymore
 A: Substituting $x=a\tan(u)$ gives
$$
\begin{align}
\int\frac{\mathrm{d}x}{\left(a^2+x^2\right)^2}
&=\frac1{a^3}\int\frac{\sec^2(u)\,\mathrm{d}u}{\sec^4(u)}\\
&=\frac1{a^3}\int\cos^2(u)\,\mathrm{d}u\\
&=\frac1{2a^3}\int(1+\cos(2u))\,\mathrm{d}u\\
&=\frac1{2a^3}(u+\sin(u)\cos(u))+C\\
&=\frac1{2a^3}\left(\tan^{-1}\left(\frac xa\right)+\frac{ax}{a^2+x^2}\right)+C\\
\end{align}
$$
A: For any $A>0$ we have 
$$ \int\frac{dx}{A+x^2}=C+\frac{1}{\sqrt{A}}\arctan\frac{x}{\sqrt{A}}$$
hence by differentiating both sides with respect to $A$ we get
$$ \int \frac{dx}{(x^2+A)^2} = D+\frac{x}{2A(x^2+A)}+\frac{1}{2A\sqrt{A}}\arctan\frac{x}{\sqrt{A}} $$
and now we just have to evaluate both sides at $A=a^2$.
A: You can use that
$$
\int\frac{\text{d}x}{a^2+x^2}=\frac{1}{a}\text{arctan}\left(\frac{x}{a}\right)+K
$$
And then integrating by parts gives you
$$
\int\frac{\text{d}x}{a^2+x^2}=\left[\frac{x}{a^2+x^2}\right]+\int \frac{2x^2}{\left(a^2+x^2\right)^2}\text{d}x$$
$$=\left[\frac{x}{a^2+x^2}\right]+2\int \frac{\text{d}x}{a^2+x^2}-2a^2\int \frac{\text{d}x}{\left(a^2+x^2\right)^2}
$$
Then
$$
2a^3\int \frac{\text{d}x}{\left(a^2+x^2\right)^2}=\left[\frac{ax}{a^2+x^2}\right]+\text{arctan}\left(\frac{x}{a}\right)
$$
You finally obtain

$$
\int \frac{\text{d}x}{\left(a^2+x^2\right)^2}=\frac{1}{2a^3}\left(\frac{ax}{a^2+x^2}+\text{arctan}\left(\frac{x}{a}\right)\right)+C
$$

A: observe that $$a^2+a^2\tan^2(t)=a^2(1+\tan^2(t))=\frac{a^2}{\cot^2(t)}$$
A: $$\int\dfrac{dx}{a^2+x^2}=\dfrac{1}{a}\arctan\left(\dfrac{x}{a}\right)+C$$
then
$$\dfrac{d}{da}\int\dfrac{dx}{a^2+x^2}=\dfrac{d}{da}\left(\dfrac{1}{a}\arctan\left(\dfrac{x}{a}\right)+C\right)$$
and
$$\int\dfrac{-2adx}{(a^2+x^2)^2}=\dfrac{1}{2a^3}\arctan\left(\dfrac{x}{a}\right)-\dfrac{x}{2a^2(a^2+x^2)}$$
A: This could be done in a "general" way. 
Denoting
$$
I_k=\int \frac{dx}{(x^2+a^2)^k},
$$
one has (for $k>1$)
$$
\begin{align}
I_k&=\frac{1}{a^2}\int\frac{(x^2+a^2)-x^2}{(x^2+a^2)^k}\ dx\\
&=\frac{1}{a^2} I_{k-1}-\frac{1}{a^2}\int\frac{x^2}{(x^2+a^2)^k}\ dx\\
&=\frac{1}{a^2} I_{k-1}+\frac{1}{2a^2(k-1)}\int x\ d\left(\frac{1}{(x^2+a^2)^{k-1}}\right)\\
&=\frac{1}{a^2} I_{k-1}+\frac{1}{2a^2(k-1)}\left[\frac{x}{(x^2+a^2)^{k-1}}-I_{k-1}\right],
\end{align}
$$
which gives 
$$
I_k=\frac{x}{2a^2(k-1)(x^2+a^2)^{k-1}}+\frac{2k-3}{2a^2(k-1)}I_{k-1}.
$$
Now you can get $I_2$ by observing that
$$
I_1=\frac{1}{a}\arctan\frac{x}{a}+C.
$$

 Notes: The recursive relation above allows one to calculate $I_k$ for any positive integer $k$ in principle, which can be used to calculate any indefinite integral of rational functions. 
