I am having doubt in the calculation of the integral $$ \int\frac{1}{1+x} \ dx,$$
the solution of which is
$$
\log(1+x)+C.$$
I have solved this integration in a different way. First I converted the above integral to
$$
\;\int\frac{1}{1+(\sqrt{x})^2} \ dx.$$
Then I used the formula as
$$
{\int\frac{1}{1+x^2} dx}=\tan^{-1}x+C
$$
so by using this formula I got as an answer $\tan^{-1}(\sqrt{x})+C$ which is different from the solution.
Am I correct about this?