Calculating $\int \sqrt{1 + x^{-2}}dx$

$$ \int \frac{1}{\sin(\theta)\cos^2(\theta)}d\theta $$ $$ =\int \frac{\sin(\theta)}{\cos^2(\theta)(1-\cos^2(\theta))}d\theta $$ then use $u=\cos(\theta)$ and partial fractions on the result.


Let $x^2+1=u^2$, so that $2x\,dx=2u\,du$, which implies

$${dx\over x}={u\,du\over x^2}={u\over u^2-1}du$$

Then

$$\int{\sqrt{1+x^2}\over x}dx=\int{u^2\over u^2-1}du={1\over2}\int\left(2+{1\over u-1}-{1\over u+1} \right)du=u+{1\over2}\ln\left(u-1\over u+1 \right)+C\\=\sqrt{x^2+1}+{1\over2}\ln\left(\sqrt{x^2+1}-1\over\sqrt{x^2+1}+1 \right)+C$$


and $$ \int \frac{1}{\sin(\theta)\cos^2(\theta)}d\theta= \int \frac{\sin\theta}{\sin^2(\theta)\cos^2(\theta)}d\theta= \int \frac{-d(\cos\theta)}{(1-\cos^2\theta)\cos^2(\theta)}d\theta=... $$