Solution of given definite integral: $\int _0^a \frac1x \tan ^{-1} \left(\frac{x^2}{d^2+x^2} \right)dx$ Can following integral be solved in terms of elementary functions?

$$\int _{0}^{a} \frac{1}{x} \tan ^{-1} \bigg(\frac{x^2}{d^2+x^2} \bigg)dx$$

where $a,d \in R$

Could someone help me with this?
Could someone help me with this ?


Yes. I can. Here are two facts for future reference :


the presence of $\dfrac{{\bf d}x}x$ usually begs for a linear substitution, since, for $x=\alpha~t,$ we have $$\dfrac{{\bf d}x}x=\dfrac{{\bf d}(\alpha~t)}{\alpha~t}=\dfrac{\alpha~{\bf d}t}{\alpha~t}=\dfrac{{\bf d}t}t.$$
the presence of $1+x^2$ usually requires a trigonometric or hyperbolic substitution,  since, for $x=\tan(t),$ we have $1+x^2=1+\tan^2t=\sec^2t,$ and, for $x=\sinh(u),$ we can  write $1+x^2=1+\sinh^2u$ $=\cosh^2u.$


All in all, it would follow that we should employ the substitution $x=d\tan(t).$ Then, rewriting 

$\sin^2t=\dfrac{1-\cos(2t)}2$ and $\sec(t)\csc(t)=\dfrac1{\sin(t)\cos(t)}=\dfrac2{\sin(2t)}=\dfrac1{\sqrt{1-\cos^2(2t)}},$ it only 

feels natural to let $u=\cos(2t).$ Of course, this could all have been handled much more directly 

by rewriting $\dfrac1x=\dfrac x{x^2}=\dfrac12\cdot\dfrac{{\bf d}(x^2)}{x^2},$ and then simply substituting $v=x^2,$ but where would 

be the fun in that, right ? ;-$)$ Either way, the last and final steps involve yet another linear 

substitution, $w=\dfrac{1-u}2,$ followed by factoring the integrand's new denominator using the 

famous formula $A^2-B^2=(A-B)(A+B),$ and then employing some very basic partial  fraction decomposition, only to be left with a linear combination of integrals of the form 

$\displaystyle\int\dfrac{\arctan(x)}x~dx$ and $\displaystyle\int\dfrac{\arctan(x)}{1-x}~dx,$ none of which are even remotely elementary.
here is the indefinite integral by Maple
$$\ln  \left( x \right) \arctan \left( {\frac {{x}^{2}}{{d}^{2}+{x}^{2}}
} \right) -1/2\,{d}^{2}\sum _{{\it \_R1}={\it RootOf} \left( 2\,{{\it 
\_Z}}^{4}+2\,{{\it \_Z}}^{2}{d}^{2}+{d}^{4} \right) }{\frac {1}{2\,{{
\it \_R1}}^{2}+{d}^{2}} \left( \ln  \left( x \right) \ln  \left( {
\frac {{\it \_R1}-x}{{\it \_R1}}} \right) +{\it dilog} \left( {\frac {
{\it \_R1}-x}{{\it \_R1}}} \right)  \right) }
$$