# Integrating $\int_0^{\infty} \frac{\log x}{(x + a)^2 + b^2} \operatorname d\!x$

I'm trying to show that $$\int_0^{\infty} \frac{\log x}{(x + a)^2 + b^2} \operatorname d\!x = \frac{1}{b}\arctan \sqrt{a^2 + b^2}.$$ However, I am a bit confused applying the key hole "method." I consider $$f(z) = \frac{\log^2(z)}{(z+a)^2+b^2}$$ and can see that there are poles at $$z_{1,2} = -a + bi, -a-bi.$$ Then, I'm not sure what to do from there. I know that the integral on the outer circle vanishes as $$R\to \infty$$ and the integral of the inner circle also goes to zero as $$\epsilon \to 0.$$ I'm not sure what my integrands are for the contours $$C_1$$ going from $$R$$ to $$\epsilon$$ and $$C_2$$ going from $$\epsilon$$ to $$R.$$ I also don't know how to compute their residues.

• 1) Your integral is incorrect, should be $\frac1b\arctan\left(\frac{b}{a}\right) \log\sqrt{a^2+b^2}$. 2) The residue for $$\frac{(\log x)^2}{(x+a)^2 + b^2} = \frac{(\log x)^2}{(x + a - ib)(x + a + ib)}$$ at $x = -a + ib$ is $$\frac{\log(-a + ib)^2}{(-a + ib) + a + ib} = \frac{1}{2ib}\log(-a+ib)^2$$ If a memomorphic function $f(x)$ has a simple pole at $\alpha$ and $f(x) = \frac{g(x)}{x-\alpha}$ for $x$ near $\alpha$, the residue of $f(x)$ at $x = \alpha$ equals to $g(\alpha)$ – achille hui May 3 at 17:19

without complex analysis$$I = \int^{\infty}_{0}\frac{\ln x}{(x+a)^2+b^2}dx$$

set $$\displaystyle x = \frac{a^2+b^2}{y}$$ and $$\displaystyle dx=-\frac{a^2+b^2}{y^2}dy$$

$$I = \int^{\infty}_{0}\frac{\ln(a^2+b^2)-\ln(y)}{(y+a)^2+b^2}dy$$

$$I = \ln(a^2+b^2)\int^{\infty}_{0}\frac{1}{(y+a)^2+b^2}dy-I$$

$$2I=\frac{\ln(a^2+b^2)}{b}\arctan\bigg(\frac{y+a}{b}\bigg)\bigg|^{\infty}_{0}$$

$$I=\frac{\ln(a^2+b^2)}{2b}\bigg[\frac{\pi}{2}-\arctan\bigg(\frac{a}{b}\bigg)\bigg]$$

$$I=\frac{\ln(a^2+b^2)}{2b}\cot^{-1}\bigg(\frac{a}{b}\bigg)=\frac{1}{b}\arctan\bigg(\frac{b}{a}\bigg)\ln\sqrt{a^2+b^2}$$

For $$a,b>0$$