I've tried this substitution in this integral
$$\int_{-1}^{1}\sqrt{1+x^2}dx$$
Let $x^2=t$, so $x=\sqrt{t}$ and $dx=\frac{1}{2\sqrt{t}}dt$. So we have
$$\frac{1}{2}\int_{1}^{1}\sqrt{\frac{1+t}{t}}dt=0$$
Which is obviously wrong. I know that this integral can be done with integration by parts or hyperbolic substitution, I want to know why this happens. My idea is that $x^2$ isn't always invertible, it is only on $[0, +\infty)$, and that causes this problem with the interval of integration.
Am I right? Thanks for your time.
Trick to reach your method see that, $\sqrt{1+x^2}$ is an even function therefore, $$\int_{-1}^{1}\sqrt{1+x^2}dx = 2\int_{0}^{1}\sqrt{1+x^2}dx$$ Now you are allowed to: Let $x^2=t$, so $x=\sqrt{t}$ and $dx=\frac{1}{2\sqrt{t}}dt$. So we have
$$ \int_{-1}^{1}\sqrt{1+x^2}dx = 2\int_{0}^{1}\sqrt{1+x^2}dx =2\int_{0}^{1}\sqrt{\frac{1+t}{t}}dt$$
and $\sqrt{1+x^2} =\sqrt{1+\sinh u^2} = \cosh u$ $$\int_{-1}^{1}\sqrt{1+x^2}dx =2\int_{0}^{1}\sqrt{1+x^2}dx \\=2\int_{0}^{\sinh^{-1}(1)} \cosh^2 u du= \int_{0}^{\sinh^{-1}(1)} 1+\cosh2 u du\\=\sinh^{-1}(1) +\frac12 \sinh(2\sinh^{-1}(1)) $$
Using $$\cosh2u = \cosh^2 u +\sinh^2 u~~~and~~~~ \cosh^2 u -\sinh^2 u = 1.$$
on the other hand we have, $$\sinh 2u = 2c\cosh u \sinh u = 2\sinh u\sqrt{1+\sinh^2 u}$$
Using this we have $$ \frac12 \sinh(2\sinh^{-1}(1)) =\sinh (\sinh^{-1}(1))\cdot\sqrt{1+\sinh^2\sinh^{-1}(1)} = \sqrt 2$$
Therefore, $$\color{red}{\int_{-1}^{1}\sqrt{1+x^2}dx du=\sinh^{-1}(1) +\frac12 \sinh(2\sinh^{-1}(1)) = \sinh^{-1}(1)+\sqrt2.} $$