TITLE: Calculating the following definite integral
QUESTION [6 upvotes]: How may I approach and compute the following integral? Could polylogarithm functions and complex numbers be avoided?
$$ \int_0^{\frac{\pi}{2}} \frac{x}{\tan x} dx$$

REPLY [3 votes]: Let's take $t=\tan x$ Then  
$$I= \int_0^{\frac{\pi}{2}} \frac{x}{\tan x} dx=\int_{0}^{\infty}\frac{\arctan t}{t(1+t^2)}dt $$  Consider  
$$I(a)= \int_{0}^{\infty}\frac{\arctan (at)}{t(1+t^2)}dt $$ Then  
$$\frac{dI}{da}=\int_{0}^{\infty}\frac{1}{(1+a^2t^2)(1+t^2)}dt =\frac{\pi}{2(1+a)}$$ and  
$$I(a)=\frac{\pi}{2}\ln (1+a)+const$$ $const=0$ because $I(0)=0$  
Thus
$$I(a)=\frac{\pi}{2}\ln (1+a)$$ and $I=I(1)=\frac{\pi}{2}\ln (2)$