Two answers for Integral of $ \int_0^\infty \frac{\tan^{-1}ax – \tan^{-1}x}{x}\mathrm dx$

definite integralsintegration

$$ I= \int_0^\infty \frac{\tan^{-1}ax – \tan^{-1}x}{x}\mathrm dx$$
Now by using Leibnitz Rule by differentiating w.r.t. to $a$ we get,
$$\frac{\mathrm dI}{\mathrm da}=\frac{\pi}{2a}$$
$$I=\frac{\pi}{2}\ln a$$
But consider ,
$$I_1= \int_0^\infty \frac{\tan^{-1}ax}{x}\mathrm dx$$
$$I_2= \int_0^\infty \frac{\tan^{-1}x}{x}\mathrm dx$$
So
Substituting $ax=t$ in $I_1$
$$I_1= \int_0^\infty \frac{\tan^{-1}t}{t}\mathrm dt$$
So $$I=I_1-I_2=0$$
So where am I wrong here? I know there is some mistake
In second method as the function is always positive integral can't be $0$. But i am not able to figure out where am I wrong.

Note: $a$ is a positive number

Best Answer

You are wrong when you split the original integral into two integrals. This can be done only when both the splitted integrals converge to some finite value, which is not the case here. So your second method fails. The correct answer hence is $$I(a)=\frac {\pi}{2}\ln a$$