I would like to get the following integral:
$$\int -\frac{\log(a^2+x^2)}{(a^2+x^2)}dx \quad \text{or} \quad \int_{t}^{+\infty}-\frac{\log(a^2+x^2)}{(a^2+x^2)}dx$$
where $t>0$.
I used WolframAlpha to compute, and I got following expression:
I am just wondering why some complex value i appears? Any ideas of how to get the closed form of integral from t to +inf ? I guess I need to give more specification to wolframalpha to compute ?

For real $x$ and $a$ it is possible to rewrite the result using only real-valued functions. After copious use of the function relations $$\arctan z=-\frac i2\log\frac{i-z}{i+z}$$ $$\operatorname{Li}_2(e^{it})=\frac{\pi^2}6-\frac{\pi t}2+\frac{t^2}4+i\operatorname{Cl}_2(t)$$ where $\operatorname{Cl}_2$ is the classical Clausen function, the simplified result is $$\int_0^x\frac{\log(t^2+a^2)}{t^2+a^2}\,dt=\frac1a\left(2\log2a\arctan\frac xa-\operatorname{Cl}_2\left(\pi-2\arctan\frac xa\right)\right)$$ The integral over $[0,\infty)$ is $\frac{\pi\log2a}a$; cf. here.