TITLE: integral with $\log\left(\frac{x+1}{x-1}\right)$
QUESTION [17 upvotes]: I encountered a tough integral and I am wondering if anyone has any ideas on how to evaluate it.
$$\displaystyle \int_{0}^{\infty}\frac{x}{x^{2}+a^{2}}\log\left(\left|\frac{x+1}{x-1}\right|\right)dx=\pi\tan^{-1}(1/a), \;\ a>1$$
I tried breaking up the log and differentiating w.r.t 'a', but did not make considerable progress. Is it possible to do this one with residues?. 
I attempted to write it as $$\displaystyle \frac{1}{a^{2}}\int_{0}^{\infty}\frac{x}{1+(x/a)^{2}}\log(x+1)dx-\frac{1}{a^{2}}\int_{0}^{\infty}\frac{x}{1+(x/a)^{2}}\log(x-1)dx$$
Now, make the sub $t=x/a, \;\ dx=adt$
$\displaystyle \int_{0}^{\infty}\frac{t}{1+t^{2}}\log(1+at)dt-\int_{0}^{\infty}\frac{t}{1+t^{2}}\log(at-1)dt$
Differentiate w.r.t 'a' gives:
$$\displaystyle \int_{0}^{\infty}\frac{t^{2}}{(at+1)(t^{2}+1)}dt-\int_{0}^{\infty}\frac{t^{2}}{(at-1)(t^{2}+1)}dt$$
But, this may not be a good idea because of convergence issues.  
Does anyone have a good idea of how to approach this one?.
Thanks and take care.

REPLY [6 votes]: Consider the parameter $b$ dependent integral:  
$$I(b)=\frac{1}{2}\int_{0}^{\infty}\frac{x}{x^{2}+a^{2}}\ln\left(\frac{x+b}{x-1}\right)^{2}dx$$ At $b=1$ it is equivalent to the original integral.  
After differentiating with respect to $b$ we get:  
$$\frac{dI}{db}=\int_{0}^{\infty}\frac{x}{(b+x)(x^2+a^2)}dx=$$  
$$=\frac{\pi}{2}\frac{a}{a^2+b^2}-\frac{b}{a^2+b^2}\ln\frac{a}{b}$$  
After integrating the last expression with respect to $b$ we get:  
$$I(b)=\frac{\pi}{2}\arctan\frac{b}{a}-\frac{\ln a}{2}\ln(a^2+b^2)+\frac{1}{4}\int_{1}^{b^2}\frac{\ln x}{a^2+x}dx+\text{const}$$ To determine the integration constant we use the fact that $I(-1)=0$  
Taking this into account, we finally get:  
$$I(b)=\frac{\pi}{2}\left(\arctan\frac{b}{a}+\arctan\frac{1}{a}\right)+\frac{\ln a}{2}\ln\frac{a^2+1}{a^2+b^2}+\frac{1}{4}\int_{1}^{b^2}\frac{\ln x}{a^2+x}dx$$ At $b=1$ we get from this the desired result.