<s>[INST] 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.
 [/INST] I’ll suggest another method, involving Integration By Parts. Let the integral to be found be denoted by J.   We start by performing an integration by parts of the function $\frac{1}{x^2+D^2}$:
$$I= \int \frac{1}{x^2+D^2} dx=  \frac{x}{x^2+D^2}-\int \left(-\frac{x(2x)}{(x^2+D^2)^2}\right)dx$$ $$=  \frac{x}{x^2+D^2}+2 \int\frac{x^2+D^2-D^2}{(x^2+D^2)^2}dx$$$$=  \frac{x}{x^2+D^2}+2(I-D^2J)$$ so that we have finally, $$J=\frac{1}{2D^2}\left( \frac{x}{x^2+D^2}+I\right)$$ $$J=\frac{1}{2D^2}\left( \frac{x}{x^2+D^2}+\frac 1D \arctan\left(\frac xD\right)\right)$$ which, on putting the limits, gives $\displaystyle \frac{\pi}{2D^3}$.
</s>