Help evaluating $\int \frac{dx}{(x^2 + a^2)^2}$ I have following integral and it should be simple, however whatever substitution I use and no matter how many times I integrate it by parts (or combine both) I never get the correct solution (or any alternative solution):
$$\int \frac{dx}{(x^2 + a^2)^2}$$
I'm looking for what is on the Wolfram|Alpha in the alternative solutions section:
$$\frac{\arctan(\frac{x}{a})}{2a^3} + \frac{x}{2a^2(a^2 + x^2)} $$
 A: $$\int\dfrac{1}{(x^2+a^2)^2}dx$$
Hint : Does there exist a function which when differentiated gives something similar to $1\over (x^2+1)$ ?
Put $\tan^{-1} \frac{x}{a} = t$. This gives $\dfrac{1}{1+(\dfrac{x}{a})^2}.\dfrac{1}{a}.dx = dt = \dfrac{a}{a^2+{x}^2}.dx$
$$\int\dfrac{1}{(x^2+a^2)^2}dx=\int \dfrac{1}{a.( (a\tan t)^2+a^2)}dt=\int \dfrac{1}{a.( a^2\tan^2 t+a^2)}dt=\int \dfrac{1}{a^3(\tan^2 t+1)}dt=\dfrac{1}{a^3}\int \cos^2 t$$
which will lead to the answer.
A: Substitute 
$$x=a \hspace{3pt} \tan \theta$$
$$ dx = a\hspace{3pt} \sec^2 \theta \hspace{3pt} d\theta$$
The integral
$$
\begin{align*}
\int \frac{1}{(x^2+a^2)^2} \hspace{3pt}dx &= \int  \frac{\hspace{3pt}a \hspace{3pt}\sec^2 \theta }{a^4 \hspace{3pt} \sec^4 \theta}\hspace{3pt} d\theta\\
&= \frac{1}{a^3} \int  \frac{1}{\sec^2 \theta}\hspace{3pt} d\theta\\
&= \frac{1}{a^3} \int \cos^2 \theta\hspace{3pt} d\theta\\
&= \frac{1}{2a^3} \int 2\hspace{3pt}\cos^2 \theta\hspace{3pt} d\theta\\
&= \frac{1}{2a^3} \int (1+\cos2 \theta)\hspace{3pt} d\theta\\
&= \frac{1}{2a^3} \theta + \frac{1}{2a^3} \frac{\sin 2\theta}{2} + \text{constant} \\
&= \frac{1}{2a^3} \tan^{-1}\frac{x}{a} + \frac{1}{2a^3} \frac{\sin 2\theta}{2} + \text{constant} \\
\tag{A}\\
\end{align*}
$$
But since we substituted $x=a \hspace{3pt} \tan \theta$, which is equivalent to 
$$\sin \theta = \frac{x}{\sqrt{x^2+a^2}}$$ and $$\cos \theta = \frac{a}{\sqrt{x^2+a^2}}$$
$$ \sin2\theta = 2 \sin\theta \cos\theta = \frac{2xa}{x^2+a^2}$$
The integral therefore simplifies to
$$\frac{1}{2a^3} \tan^{-1}\frac{x}{a} + \frac{1}{2a^3} \frac{ax}{x^2+a^2} + \text{constant}$$
A: After a linear substitution we may instead look at
$$\frac{1}{(1+x^2)^2}= \frac{(1+x^2)}{(1+x^2)^2}-\frac{x^2}{(1+x^2)^2}=\frac{1}{1+x^2}-\frac{x^2}{(1+x^2)^2}$$
where the first term is easy. For the second term we may try integration by parts 
$$\int x\cdot\frac{x}{(1+x^2)^2}dx=\left[x\cdot\frac{-1}{2(1+x^2)}\right]+\frac{1}{2}\int\frac{1}{1+x^2}dx=-\frac{x}{2(1+x^2)}+\frac12\arctan x$$
Ending up with 
$$\int\frac{dx}{(1+x^2)^2} = \frac12\arctan x +\frac{x}{2(1+x^2)}$$
A: We will use integration by parts. Assume that $a$ is positive. We first make the preliminary substitution $x=at$. Then $dx=a\,dt$, and when we go through the substitution process, we end up with $\int \frac{1}{a^3}\frac{dt}{(1+t^2)^2}$.
Let's not bother to carry the constant $\frac{1}{a^3}$ around, it can be inserted at the end. So we go after $\int \frac{dt}{(1+t^2)^2}$.
We use a little trick that has a number of uses.  Let $I=\int \frac{dt}{1+t^2}$. (This is not a typo!)  We recognize this integral instantly, since we know that the derivative of $\arctan t$ is $\frac{1}{1+t^2}$. But let's begin to evaluate the integral by using integration by parts. 
Let $u=\frac{1}{1+t^2}$ and $dv=dt$. Then $du= -\frac{2t}{(1+t^2)^2}$ and we can take $v=t$. Thus 
$$I=\int \frac{dt}{1+t^2}=\frac{t}{1+t^2}- \int-\frac{2t^2\,dt}{(1+t^2)^2}.$$
Get rid of the doubled minus signs, and rewrite $2t^2$ as $2+2t^2 -2$. We end up with 
$$I=\frac{t}{1+t^2} +\int \frac{2(1+t^2)}{(1+t^2)^2}-\int \frac{2\,dt}{(1+t^2)^2},$$ and therefore
$$I=\frac{t}{1+t^2}+2I-2\int\frac{dt}{(1+t^2)^2}.$$
Thus 
$$2\int\frac{dt}{(1+t^2)^2}=\frac{t}{1+t^2}+I=\frac{t}{1+t^2}+\arctan t.$$
So to find $\int \frac{dt}{(1+t^2)^2}$, divide the right-hand side by $2$. And don't forget to add the arbitrary constant $C$ of integration at the end.
A: When you see $a^2 + x^2$, think of $1+\tan^2\theta=\sec^2\theta$, and write $x=a\tan\theta$.
When you see $a^2 - x^2$, think of $1-\sin^2\theta=\cos^2\theta$, and write $x=a\sin\theta$.
When you see $x^2 - a^2$, think of $\sec^2\theta -1=\tan^2\theta$, and write $x=a\sec\theta$.
