# Evaluating a definite integral using residue theorem

I am trying to show $$\int_0^{\infty} \frac{\log (x)}{(x^2+1)^2}$$. We can use the integrand $$g(z) = \frac{\log(z)}{(x^2+1)^2}$$ defining log as $$\log(\rho e^{i\theta}) = \log(\rho) + i\theta$$ and letting $$\theta \in [0,2\pi]$$

Now, I know that the singularities of the integrand occur at $$i,-i$$ one being in the upper half plane, the other in the lower half plane.

Typically the counter used for integrands which require choosing a branch cut of log is a half donut shape on the upper plane. Since there is a singularity no on the lower half plane, do I ignore it or include the residue of it in the calculation?

Also, I believe the singularities to be poles of order 3 and I do not know how to calculate residues for them. Is there an explicit formula like there is for simple poles?

The poles in this case will be of order $$2$$. A residue for a pole of order at most $$m$$ can be found from $$Res(f,z_0)=\frac1{(m-1)!}\lim_{z\to z_0}\frac{d^{m-1}}{dz^{m-1}}(z-z_0)^mf(z)$$ which for large $$m$$ can be frustrating but should be OK in this case.
• so would I have $$Res(g,z_0) = \lim_{z \rightarrow i} 2(z-z_0) [\frac{(z^2+1)^2}{z}-log(z)4z(z^2+1)]\frac{1}{(z^2+1)^3}$$ and if so wouldnt this limit be zero? – dc3726 Dec 4 '18 at 2:05
• I can't follow your differentiation. Remember that in this case $z_0=i$, and that $$(z-z_0)^2f(z)=\frac{(z-i)^2}{(z^2+1)^2}\log z\ ,$$ simplify first then differentiate. The answer might be zero, I haven't worked it out. – David Dec 4 '18 at 3:00
You are trying to show... what? $$\begin{eqnarray*}\int_{0}^{+\infty}\frac{\log(x)}{(1+x^2)^2}\,dx &=& \int_{0}^{1}\frac{\log x}{(1+x^2)^2}\,dx+\underbrace{\int_{0}^{1}\frac{-x^2\log(x)}{(1+x^2)^2}\,dx}_{x\mapsto 1/x}\\&=&\int_{0}^{1}\frac{1-x^2}{(1+x^2)^2}\log(x)\,dx\end{eqnarray*}$$ and since $$\forall x\in(0,1),\qquad \frac{1-x^2}{(1+x^2)^2}=\sum_{n\geq 0}(-1)^n (2n+1) x^{2n},$$ $$\int_{0}^{1}x^{2n}\log(x)\,dx = -\frac{1}{(2n+1)^2}$$ we have: $$\int_{0}^{+\infty}\frac{\log x}{(1+x^2)^2}\,dx = -\sum_{n\geq 0}\frac{(-1)^n}{2n+1}=-\arctan(1)=\color{red}{-\frac{\pi}{4}}.$$ We do not strictly need Complex Analysis.