Evaluating $\int_{0}^\infty \frac{\log x \, dx}{\sqrt x(x^2+a^2)^2}$ using contour integration I need your help with this integral:
$$\int_{0}^\infty \frac{\log x \, dx}{\sqrt x(x^2+a^2)^2}$$
where $a>0$. I have tried some complex integration methods, but none seems adequate for this particular one.
Is there a specific method for this kind of integrals? What contour should I use?

We  integrate $$f(z)  = \frac{\log  z}{\sqrt{z}(z^2+a^2)^2}$$  along a
keyhole contour with  the branch cut of the  logarithm on the positive
real axis  and its argument between  $0$ and $2\pi.$ There  is a small
circle of radius $\epsilon$ enclosing  the origin and the large circle
has radius $R.$
Along the straight segment on the  positive real axis we get in the
limit
$$I = \int_0^\infty \frac{\log x}{\sqrt{x}(x^2+a^2)^2}  \; dx.$$
Just below the real axis we get with $\sqrt{z} = \exp(1/2\log z)$
$$- \int_0^\infty 
\frac{\log x + 2\pi i}{\exp(\pi i)\sqrt{x}(x^2+a^2)^2}  \; dx
= I + 2\pi i \int_0^\infty \frac{1}{\sqrt{x}(x^2+a^2)^2} \; dx
= I + 2\pi i J.$$
Now we need to invoke a  recursive step and compute $J$ using the same
keyhole contour. We  get $J$ on the positive real  axis and just below
we get with $$g(z) = \frac{1}{\sqrt{z}(z^2+a^2)^2}$$
the integral
$$- \int_0^\infty 
\frac{1}{\exp(\pi i)\sqrt{x}(x^2+a^2)^2}  \; dx = J.$$
It follows that
$$2J = 2\pi i (\mathrm{Res}_{z=ai} g(z)+\mathrm{Res}_{z=-ai} g(z)).$$
We get for the two residues
$$\lim_{z=\pm ai} 
\left(\frac{\exp(-1/2\log(z))}{(z\pm ai)^2}\right)'
\\ = \lim_{z=\pm ai} 
\left(\frac{-1/2\exp(-1/2\log z)/z}{(z\pm ai)^2}
- 2\frac{\exp(-1/2\log z)}{(z\pm ai)^3}\right)$$
We obtain for the first residue
$$-\frac{3}{16} (1+i)\sqrt{2} a^{-7/2}$$
and for the second one
$$\frac{3}{16} (1-i)\sqrt{2} a^{-7/2}.$$
It follows that
$$J = \pi i \times -\frac{3}{8} i \sqrt{2} a^{-7/2}
= \frac{3}{8} \pi \sqrt{2} a^{-7/2}.$$
Returning to the main computation we thus have
$$2I+2\pi i J =
2\pi i(\mathrm{Res}_{z=ai} f(z)+\mathrm{Res}_{z=-ai} f(z)).$$
This time we obtain for the two residues
$$\lim_{z=\pm ai} 
\left(\frac{\exp(-1/2\log(z))\log z}{(z\pm ai)^2}\right)'
\\ = \lim_{z=\pm ai} 
\left(\frac{-1/2\log z \times \exp(-1/2\log z)/z
+ \exp(-1/2\log(z))/z}{(z\pm ai)^2}
\\ - 2\frac{\exp(-1/2\log z)\log z}{(z\pm ai)^3}\right)$$
We get for the first residue
$$-\frac{1}{32} (1+i)\sqrt{2} (3i\pi + 6\log a - 4) a^{-7/2}$$
and for the second one
$$\frac{1}{32} (1-i)\sqrt{2} (9i\pi + 6\log a - 4) a^{-7/2}$$
Adding these two yields
$$-\frac{1}{16} i\sqrt{2} (6i\pi + 6\log a - 3\pi - 4) a^{-7/2}.$$
Multiply by $\pi i$ and subtract $\pi i J$ to get
$$\frac{1}{16}\pi \sqrt{2} (6i\pi + 6\log a - 3\pi - 4) a^{-7/2}
- \frac{3}{8} \pi \sqrt{2} \times \pi i\times a^{-7/2}$$
for a final answer of
$$\bbox[5px,border:2px solid #00A000]
{\frac{1}{16}\pi \sqrt{2} (6\log a - 3\pi - 4) a^{-7/2}.}$$
The bounds here are mostly trivial,  e.g. when computing $I$ we get by
ML for the large circle of radius $R$
$$\lim_{R\rightarrow\infty} 2\pi R 
\times \frac{|\log R+2\pi i|}{\sqrt{R}(R^2-a^2)^2} 
= \lim_{R\rightarrow\infty} 2\pi R 
\times \frac{\sqrt{\log^2 R+4\pi^2}}{\sqrt{R}(R^2-a^2)^2} 
= 0$$
and for the small circle
$$\lim_{\epsilon\rightarrow 0} 2\pi \epsilon 
\times \frac{|\log \epsilon+2\pi i|}{\sqrt{\epsilon}(a^2-\epsilon^2)^2} 
= \lim_{\epsilon\rightarrow 0} 2\pi
\times \frac{\sqrt\epsilon
\sqrt{\log^2 \epsilon + 4\pi^2}}{(a^2-\epsilon^2)^2} 
= 0.$$
Remark. We have to use the same branch of the logarithm throughout
e.g. $\log(-i) = 3i\pi/2$ as opposed to $\log(-i) = -i\pi/2.$
Addendum 05 Jun 2016. It appears the computation of $J$ is not necessary. We can just take the real part of the contributions from the poles of $f(z)$ because we know $I$ and $J$ are real numbers.
