$$\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.
Do you know about complex analysis? Integrals like this became trivial: We consider the contour integral
$$\oint_C \frac{1}{(z^2+D^2)^2}dz=\int_{\Gamma_R}\frac{1}{(z^2+D^2)^2}dz +\int_{[-R,R]}\frac{1}{(z^2+D^2)^2}dz $$
where $C$ is a semicircle in the upper half plane. By the residue theorem, we need only consider the pole at $z=Di$. As the radius of the semicircle goes to infinity, we find that $$\lim_{R\to\infty}\int_{\Gamma_R}\frac{1}{(z^2+D^2)^2}dz=0$$ so $$\lim_{R\to\infty}\int_{[-R,R]}\frac{1}{(z^2+D^2)^2}dz=\int_{-\infty}^{\infty}\frac{1}{(z^2+D^2)^2}dz=\oint_C \frac{1}{(z^2+D^2)^2}dz=2\pi i Res(f,Di)=2\pi i\lim_{z\to Di}\frac{d}{dz}((z-Di)^2f(z))=\frac{\pi}{2D^3}$$