Help solving $\int_0^\infty\!\!\frac{\log\left(x\right)}{\left(x+a\right)^3}{\scriptsize dx}$ for $a>0$ $$
\mbox{Consider}\quad
\int_{0}^{\infty}{\log\left(x\right) \over \left(\, x + a\,\right)^3}
\,\mathrm{d}x\quad
\mbox{where}\ a\ \mbox{is}\ positive.
$$


*

*First, we make a branch cut along the negative imaginary axis, and then consider the standard contour with a small semicircle around 0 and a small semicircle centered at $-a$.

*Letting $\,\mathrm{f}\left(z\right)$ be the integrand above with $z$ in place of $x$, the residue at $-a$ is $-1/\left(2a^{2}\right)$.

*I'm able to show that the integral around the big semicircle goes to 0 as the radius goes to infinity and similarly with the arc around 0 as the radius goes to 0, but there's a little trouble with the one around $-a$.

*If $-a$ were a simple pole, then it would just evaluate to $-\pi\mathrm{i}$ times the residue, but I have an order $3$ pole.


Any suggestions ?. I was also thinking of rotating the standard contour by $\pi/2$ so that the pole is inside the contour rather than outside.
 A: Suppose we seek to evaluate
$$K = \int_0^\infty \frac{\log x}{(x+a)^3} \; dx$$
with $a$ positive.
We use $$f(z) = \frac{(\log z)^2}{(z+a)^3}$$
and  integrate around a  keyhole contour  with the  branch cut  of the
logarithm on the positive real  axis and the argument between zero and
$2\pi.$

We obtain
$$2\pi i \mathrm{Res}_{z=-a} f(z)
\\ = \int_0^\infty \frac{(\log z)^2}{(z+a)^3} dz
- \int_0^\infty \frac{(\log z +2\pi i)^2}{(z+a)^3} dz
\\ = -4\pi i \int_0^\infty \frac{\log z}{(z+a)^3} dz
+ 4\pi^2 \int_0^\infty \frac{1}{(z+a)^3} dz.$$
The simple one yields
$$\left[-\frac{1}{2} \frac{1}{(x+a)^2}\right]_0^\infty
= \frac{1}{2a^2}.$$ 
Now for the residue we get
$$\frac{1}{2}\left.\left((\log z)^2\right)''\right|_{z=-a}
= \left.\left(\frac{1}{z} \log z\right)'\right|_{z=-a} 
= \left.\left(\frac{1}{z^2} - \frac{1}{z^2} \log z\right)\right|_{z=-a} 
\\ = \frac{1}{a^2} (1-\log a - i\pi).$$
We thus have
$$ \frac{2\pi i}{a^2} (1-\log a - i\pi)
= -4\pi i K + \frac{2\pi^2}{a^2}$$
or
$$ \frac{2\pi i}{a^2} (1-\log a)
= -4\pi i K $$ 
and finally
$$K = \frac{1}{2a^2} (\log a - 1).$$
This can also be obtained comparing real and imaginary parts of the 
initial integral of $f(z).$

Remark. To be rigorous we need to apply ML to the circular components.
We get for the large circle that with $z=R\exp(i\theta)$
$$|\log^2 z| = |\log z|^2 = \sqrt{\log^2 R + \theta^2}^2$$
and hence
$$\lim_{R\rightarrow\infty} 2\pi R
\times \frac{\log^2 R + 4\pi^2}{(R-a)^3} = 0$$ 
and
$$\lim_{\epsilon\rightarrow 0} 2\pi \epsilon
\times \frac{\log^2 \epsilon + 4\pi^2}{(a-\epsilon)^3} = 0.$$ 
