Evaluate $\int\frac{\sqrt{x^2+2x-3}}{x+1}d\,x$ by trig substitution I am preparing for an exam and found this integral in a previous test. Did I do it correctly?
My attempt.
$$
\int\frac{\sqrt{x^2+2x-3}}{x+1}\,dx
$$
Complete the square of $x^2+2x-3$; I changed the integral to
$$
\int\frac{\sqrt{(x-1)^2-4}}{x+1}\,dx
$$
then set $u=x+1$ to get
$$
\int\frac{\sqrt{u^2-4}}{u}\,dx
$$
Using the triangle, $2\sec\theta=u$ and $du=2\sec\theta\tan\theta d\theta$
$$
\int\frac{\sqrt{(2\sec\theta)^2-2^2}}{2\sec\theta}2\sec\theta \tan\theta\, d\theta
$$
This I simplified to 
$$
2\int\tan^2\theta\, d\theta = 2\int\sec^2\theta-1\,d\theta
=2[\tan\theta-\theta]+C
$$
Back substitute
$$
\theta=\tan^{-1}\frac{\sqrt{u^2-4}}{2}
$$
and
$$
\tan\theta=\frac{\sqrt{u^2-4}}{2}
$$
Back substitute $u=x+1$
$$
\int\frac{\sqrt{x^2+2x-3}}{x+1}\,dx=
\sqrt{(x-1)^2-4}-\tan^{-1}{\sqrt{(x-1)^2-4}}+C
$$


You've made a mistake. I hope you can find it using my answer

$$\int\frac{\sqrt{x^2+2x-3}}{x+1}\space\text{d}x=\int\frac{\sqrt{(x+1)^2-4}}{x+1}\space\text{d}x=$$

Substitute $u=x+1$ and $\text{d}u=\text{d}x$:

$$\int\frac{\sqrt{u^2-4}}{u}\space\text{d}u=$$

Substitute $u=2\sec(s)$ and $\text{d}u=2\tan(s)\sec(s)\space\text{d}s$.
We get that $\sqrt{u^2-4}=\sqrt{4\sec^2(s)-4}=2\tan(s)$ and $s=\text{arcsec}\left(\frac{u}{2}\right)$:

$$2\int\tan^2(s)\space\text{d}s=2\int\left[\sec^2(s)-1\right]\space\text{d}s=2\left[\int\sec^2(s)\space\text{d}s-\int1\space\text{d}s\right]$$
Notice now, the integral of $\sec^2(s)$ is equal to $\tan(s)$ and the integral of $1$ is just $s$.
