I am having trouble calculating this integral:

$$ g(a) \int_{0}^{\frac{\pi}{2}} \frac{\arctan(a \tan x)}{\tan x}dx $$
 
I tried calculating $g'(a)$ but then I get stuck.