Absolute values in $\int \frac{dx}{(x+2)\sqrt{(x+1)(x+3)}}$ in my math class we were given a list of indefinite integrals, and one of them was:
$$\int \frac{dx}{(x+2)\sqrt{(x+1)(x+3)}}$$
My working:
$$\int \frac{dx}{(x+2)\sqrt{(x+1)(x+3)}}=\int \frac{dx}{(x+2)\sqrt{(x+2)^2-1}}$$
Then I used the substitution $x+2=\sec t$ to get:
$$\int \frac{\tan t}{\sqrt{\sec^2 t-1}}dt=\int \frac{\tan t}{|\tan t|}dt= t\,\text{sgn}\, (\tan t)+C...$$
Then I checked the answer sheet, and this is what they did:
$$\int \frac{\tan t}{\sqrt{\sec^2 t-1}}dt=\int dt=t+C=\text{arcsec}(x+2)+C$$
What I don't understand is, why are they allowed to say $\sqrt{\sec^2 t-1}=\tan t?$ I tried to put some values in and I have found that:
$$\int_{\sec \left(\frac{8}{5}\right)-2}^{\sec \left(\frac{9}{5}\right)-2} \frac{dx}{(x+2)\sqrt{(x+1)(x+3)}}<0$$ but according to the answer sheet I would get $\dfrac{1}{5}$
My answer looks wrong, I would be happy if someone could explain what the problem is, and also why we are allowed to simplify like they did.
 A: The answer of the book looks wrong. Since the principal range of $\sec x$ is:


*

*$\left[ 0; \frac{\pi}{2} \right)$ if $x \ge 1$, and on this domain, $\tan t$ is positive.

*$\left( \frac{\pi}{2} ; \pi \right]$ if $x \le -1$, whereas on this domain, $\tan t$ is negative.


So, in fact, the solution to that integral should be split in to 2 different parts:
$$\int\limits \frac{dx}{(x+2)\sqrt{(x+1)(x+3)}} = \left\{ \begin{array}{ll} -\mbox{arcsec}(x + 2) + C_1 &, \mbox{for }x < -3 \\
\mbox{arcsec}(x + 2) + C_2 &, \mbox{for }x > -1 \end{array} \right.$$
A: I'm sure that you're more rigorous than the book. But actually it is unnecessary when encountered in definite integration. You just need to be aware of that $ \int \frac{1}{x \sqrt{x^2-1}} dx = {\rm{arcsec}} (x) + C $ is only valid when x>1. Just like in the example of $ y = \ln (x) $, we normally have $ \int \frac{1}{x} dx = \ln (x) $ where you know that x must be positive. When the lower and up limit are negative in definite integration, we just need to convert them to positve region.
A: I know this is an old question, but I think I know why your answer sheet might have ignored the absolute value. Some calculus books (e.g. Stewart´s) define the arcsec function as the inverse function of the secant restricted to $[0,\pi/2)\cup[\pi,3\pi/2)$, instead of the usual $[0,\pi/2)\cup(\pi/2,\pi]$. I, personally, think this is a bad idea. However, by doing this, you avoid the absolute value "problem" in these integrals. Note that now the tangent is non-negative in the range of the arcsec. But then you have to be careful, because with this definition we actually have: $$arcsec(sec(8/5))=2\pi-8/5$$ and similarly with $9/5$, so that the integral in your example would give $2\pi-9/5 -(2\pi-8/5)=-1/5.$
A: To avoid absolute value
Letting $y=x+2$ yields
$$
\begin{aligned}
\int \frac{1}{(x+2) \sqrt{(x+1)(x+3)}}&=\int \frac{d y}{y \sqrt{y^2-1}}\\&=\int \frac{1}{y^2} d\left(\sqrt{y^2-1}\right) \\
&=\int \frac{\left.d \sqrt{y^2-1}\right)}{\left(\sqrt{y^2-1}\right)^2+1} \\
&=\arctan \left(\sqrt{y^2-1}\right)+C \\
&=\arctan \left(\sqrt{x^2+4 x+3}\right)+C
\end{aligned}
$$
