Evaluate $\int_{-\infty}^\infty \frac{1}{(x^2 + D^2)^2}dx$. $$\int_{-\infty}^\infty \frac{1}{(x^2 + D^2)^2}dx$$
Edit : $D> 0$.
My work:
Let $x = D\tan \theta$
$$\int_{-\infty}^\infty \frac{1}{(x^2 + D^2)^2}dx=\int_{-\infty}^\infty \frac{1}{(D^2\sec^2 \theta)^2}dx$$
$$=\int_{-\infty}^\infty \frac{1}{(D^2\sec^2 \theta)^2}D\sec^2\theta d\theta
= \frac{1}{D^3}\int_{-\infty}^\infty \cos^2 \theta d\theta$$
$$=\frac{1}{D^3}[\frac{\theta}{2} + \frac{\sin {2\theta}}{4} + C]_{-\infty}^\infty$$
Put $\theta = \arctan{\frac{x}{D}}$;
$$=\frac{1}{D^3}[\frac{\arctan{\frac{x}{D}}}{2} + \frac{\sin {(2\arctan{\frac{x}{D})}}}{4} + C]_{-\infty}^\infty$$
We get the integral as $\frac{\pi}{2D^3}$. Since $\lim_{x \to +\infty} \arctan(x) = \frac{\pi}{2}$ and $\lim_{x \to -\infty} \arctan(x) = \frac{-\pi}{2}$
I feel something isn't right here. Can anyone point the mistake please. Thank you very much.

Keep it easy: for any $A>0$
$$ f(A) = \int_{0}^{+\infty}\frac{dx}{x^2+A}\stackrel{x\mapsto z\sqrt{A}}{=} \frac{1}{\sqrt{A}}\int_{0}^{+\infty}\frac{dz}{z^2+1}=\frac{\pi}{2\sqrt{A}}.\tag{1}$$
By differentiating with respect to $A$ we get:
$$ -\frac{\pi}{4 A\sqrt{A}} = -\int_{0}^{+\infty}\frac{dx}{(x^2+A)^2} \tag{2}$$
and by replacing $A$ with $D^2$ we have:
$$ \int_{0}^{+\infty}\frac{dx}{(x^2+D^2)^2} = \color{red}{\frac{\pi}{4 D^3}}.\tag{3}$$
