Finding the closed form of $\int _0^{\infty }\frac{\ln \left(1+ax\right)}{1+x^2}\:\mathrm{d}x$ I solved a similar case which is also a very well known integral
$$\int _0^{\infty }\frac{\ln \left(1+x\right)}{1+x^2}\:\mathrm{d}x=\frac{\pi }{4}\ln \left(2\right)+G$$
My teacher gave me a hint which was splitting the integral at the point $1$,
$$\int _0^1\frac{\ln \left(1+x\right)}{1+x^2}\:\mathrm{d}x+\int _1^{\infty }\frac{\ln \left(1+x\right)}{1+x^2}\:\mathrm{d}x=\int _0^1\frac{\ln \left(1+x\right)}{1+x^2}\:\mathrm{d}x+\int _0^1\frac{\ln \left(\frac{1+x}{x}\right)}{1+x^2}\:\mathrm{d}x$$
$$2\int _0^1\frac{\ln \left(1+x\right)}{1+x^2}\:\mathrm{d}x-\int _0^1\frac{\ln \left(x\right)}{1+x^2}\:\mathrm{d}x=\frac{\pi }{4}\ln \left(2\right)+G$$
I used the values for each integral since they are very well known.
My question is, can this integral be generalized for $a>0$?, in other words can similar tools help me calculate
$$\int _0^{\infty }\frac{\ln \left(1+ax\right)}{1+x^2}\:\mathrm{d}x$$

You can evaluate this integral with Feynman's trick,
$$I\left(a\right)=\int _0^{\infty }\frac{\ln \left(1+ax\right)}{1+x^2}\:dx$$
$$I'\left(a\right)=\int _0^{\infty }\frac{x}{\left(1+x^2\right)\left(1+ax\right)}\:dx=\frac{1}{1+a^2}\int _0^{\infty }\left(\frac{x+a}{1+x^2}-\frac{a}{1+ax}\right)\:dx$$
$$=\frac{1}{1+a^2}\:\left(\frac{1}{2}\ln \left(1+x^2\right)+a\arctan \left(x\right)-\ln \left(1+ax\right)\right)\Biggr|^{\infty }_0=\frac{1}{1+a^2}\:\left(\frac{a\pi \:}{2}-\ln \left(a\right)\right)$$
To find $I\left(a\right)$ we have to integrate again with convenient bounds,
$$\int _0^aI'\left(a\right)\:da=\:\frac{\pi }{2}\int _0^a\frac{a}{1+a^2}\:da-\int _0^a\frac{\ln \left(a\right)}{1+a^2}\:da$$
$$I\left(a\right)=\:\frac{\pi }{4}\ln \left(1+a^2\right)-\int _0^a\frac{\ln \left(a\right)}{1+a^2}\:da$$
To solve $\displaystyle\int _0^a\frac{\ln \left(a\right)}{1+a^2}\:da$ first IBP.
$$\int _0^a\frac{\ln \left(a\right)}{1+a^2}\:da=\ln \left(a\right)\arctan \left(a\right)-\int _0^a\frac{\arctan \left(a\right)}{a}\:da=\ln \left(a\right)\arctan \left(a\right)-\text{Ti}_2\left(a\right)$$
Plugging that back we conclude that
$$\boxed{I\left(a\right)=\:\frac{\pi }{4}\ln \left(1+a^2\right)-\ln \left(a\right)\arctan \left(a\right)+\text{Ti}_2\left(a\right)}$$
Where $\text{Ti}_2\left(a\right)$ is the Inverse Tangent Integral.
The integral you evaluated can be proved with this,
$$I\left(1\right)=\int _0^{\infty }\frac{\ln \left(1+x\right)}{1+x^2}\:dx=\frac{\pi }{4}\ln \left(2\right)-\ln \left(1\right)\arctan \left(1\right)+\text{Ti}_2\left(1\right)$$
$$=\frac{\pi }{4}\ln \left(2\right)+G$$
Here $G$ denotes the Catalan's constant.
