# Two different solutions of $\int\frac{1}{1+x} dx$

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.

• Differentiating $\tan^{-1}\sqrt x$ gives $\frac1{2\sqrt x(1+x)}$. Dec 26 '18 at 18:48
• The correct answer is $\ln(|1+x|)+C$. Dec 26 '18 at 20:02
No. You forgot to change $$\rm{d}x$$ into $$\rm{d}(\sqrt x)$$.
The substitution $$x=t^2$$ (which, by the way, can be done only for $$x\ge0$$) brings the integral in the form $$\int\frac{1}{1+t^2}\cdot 2t\,dt=\log(1+t^2)+c=\log(1+x)+c$$
Recall that integration by substitution is an application of the chain rule for derivatives. The $$dx$$ is a reminder for you to apply it (more than that, actually).
Otherwise you'd get, similarly to your manipulation, $$\int x\,dx=\int (\sqrt{x})^2\,dx=\frac{(\sqrt{x})^3}{3}+c$$ which is clearly absurd. Or $$\int\frac{1}{\sqrt{1-x}}\,dx=\int\frac{1}{\sqrt{1-(\sqrt{x})^2}}\,dx=\arcsin\sqrt{x}+c$$ whereas the correct antiderivative is $$-2\sqrt{1-x}+c$$.