Integral of $\int_{-\infty}^{\infty} \left(\frac{1}{\alpha + ix} + \frac{1}{\alpha - ix}\right)^2 \, dx$ I'm having trouble integrating
$$\int_{-\infty}^{\infty} \left(\frac{1}{\alpha + ix} + \frac{1}{\alpha - ix}\right)^2 \, dx$$
where $\alpha$ is a real number and $i = \sqrt{-1}$. I'm guessing that I would have to integrate it using methods on complex analysis wherein I would use a semicircle contour enclosing a pole ($x = i\alpha$ for example) so that I could apply the residue theorem. But is there any other way to evaluate this integral (like an ingenious substitution or differentiating under the integral sign)?
 A: The integral is even in $\alpha$, so assume that $\alpha\gt0$.
Real Analysis Approach
Substitute $x\mapsto\alpha x$,
$$
\begin{align}
\int_{-\infty}^\infty\left(\frac1{\alpha+ix}+\frac1{\alpha-ix}\right)^2\mathrm{d}x
&=\int_{-\infty}^\infty\left(\frac{2\alpha}{\alpha^2+x^2}\right)^2\mathrm{d}x\\
&=\frac4\alpha\int_{-\infty}^\infty\frac1{(1+x^2)^2}\mathrm{d}x\tag{1}
\end{align}
$$
Furthermore
$$
\begin{align}
\pi
&=\int_{-\infty}^\infty\frac1{1+x^2}\,\mathrm{d}x\tag{2}\\
&=\int_{-\infty}^\infty\frac{2x^2}{(1+x^2)^2}\,\mathrm{d}x\tag{3}\\
&=\int_{-\infty}^\infty\frac{1+x^2}{(1+x^2)^2}\,\mathrm{d}x\tag{4}\\
&=\int_{-\infty}^\infty\frac2{(1+x^2)^2}\,\mathrm{d}x\tag{5}\\
\end{align}
$$
Explanation:
$(2)$: arctan integral
$(3)$: integration by parts on $(2)$
$(4)$: multiply the integrand in $(2)$ by $\frac{1+x^2}{1+x^2}$
$(5)$: $2$ times $(4)$ minus $(3)$
Plug $(5)$ into $(1)$ to get
$$
\begin{align}
\int_{-\infty}^\infty\left(\frac1{\alpha+ix}+\frac1{\alpha-ix}\right)^2\mathrm{d}x
&=\frac4\alpha\frac\pi2\\[3pt]
&=\frac{2\pi}{\alpha}\tag{6}
\end{align}
$$

Complex Analysis Approach
Let $z=ix$ and $\gamma=[-iR,iR]\cup iRe^{i[0,\pi]}$ as $R\to\infty$.

Then
$$
\begin{align}
\int_{-\infty}^\infty\left(\frac1{\alpha+ix}+\frac1{\alpha-ix}\right)^2\mathrm{d}x
&=-i\int_\gamma\left(\frac1{\alpha+z}+\frac1{\alpha-z}\right)^2\mathrm{d}z\tag{7}\\
&=-i\int_\gamma\left(\frac1{(\alpha+z)^2}+\frac1{(\alpha-z)^2}\right)\mathrm{d}z\\
&-\frac i\alpha\int_\gamma\left(\color{#C00000}{\frac1{\alpha+z}}+\frac1{\alpha-z}\right)\mathrm{d}z\tag{8}\\
&=\frac{2\pi}{\alpha}\tag{9}
\end{align}
$$
Explanation:
$(7)$: the integral along the arc where $|z|=R$ is $\lesssim\frac{4\pi}R$, which vanishes as $R\to\infty$.
$(8)$: $\left(\frac1{\alpha+z}+\frac1{\alpha-z}\right)^2 =\frac1{(\alpha+z)^2}+\frac1{(\alpha-z)^2}+\frac2{(\alpha+z)(\alpha-z)} =\frac1{(\alpha+z)^2}+\frac1{(\alpha-z)^2}+\frac1\alpha\left(\frac1{\alpha+z}+\frac1{\alpha-z}\right)$
$(9)$: only the $\color{#C00000}{\frac1{\alpha+z}}$ term has a pole with non-zero residue inside $\gamma$
A: Observe that the second summand is conjugate of the first:
$$
\frac1{\alpha-ix}=\overline{\frac1{\alpha+ix}}
$$
thus their sum will be real. In particular
$$
\frac1{\alpha+ix}+\frac1{\alpha-ix}=\frac{2\alpha}{\alpha^2+x^2}{}
$$
thus the integrand will be
$$
\frac{4\alpha^2}{(\alpha^2+x^2)^2}=\frac{4}{\alpha^2}\frac{1}{(1+(x/\alpha)^2)^2}
$$
The substitution $x=\alpha\tan y$ leads to (suppose wlog $\alpha>0$)
\begin{align*}
\int_{-\infty}^{+\infty}\left(\frac1{\alpha+ix}+\frac1{\alpha-ix}\right)^2\,dx
&=\frac{4}{\alpha^2}\int_{-\infty}^{+\infty}\frac{dx}{(1+(x/\alpha)^2)^2}\\
&=\frac{4}{\alpha^2}\int_{-\pi/2}^{+\pi/2}\frac{1}{(1+\tan^2y)^2}\frac{\alpha}{\cos^2y}\,dy\\
&=\frac{4}{\alpha}\int_{-\pi/2}^{+\pi/2}\frac{1}{\frac{1}{\cos^4y}}\frac{1}{\cos^2y}\,dy\\
&=\frac{4}{\alpha}\int_{-\pi/2}^{+\pi/2}{\cos^2y}\,dy\\
&=\frac{4}{\alpha}\frac12\left[\cos y\sin y +y\right]_{-\pi/2}^{+\pi/2}\\
&=\frac{2\pi}{\alpha}
\end{align*}
