When are absolute values needed in the antiderivative

absolute valueintegration

I just tackled a STEP I past paper question (Q4(iii), 2004) which asked me to determine the antiderivative for this integral:

$\int \frac{1}{(x+2)\sqrt{x^2+4x-5}}dx$

which (after substituting $\frac{x+2}{3}= \sec(t)$) gives:

$\frac{1}{3}\sec^{-1}{(\frac{x+2}{3})} + C$

This is also the answer given by Cambridge in the answer booklet. However, I also put this integral into an online integral calculator and one of the possible antiderivatives was

$-\frac{1}{3}\arcsin{(\frac{3}{\mid x+2 \mid})} + C_1$

This is (according to Desmos) is equivalent to:

$\frac{1}{3} \sec^{-1} {(\frac{\mid x+2 \mid}{3})} + C_2$

which is not at all the same function as the one I got. However, looking at the graphs (of the original functions and the antiderivatives), it would seem that the integral calculator is correct. I am presuming that Cambridge simplified the answer for STEP.

I can see that the quadratic in the radical has a minimum point at $x=-2$, but we haven't really been taught much about absolute values and discontinuities, except for

$\int\frac{1}{x}dx = \ln{\mid x\mid}+C$,

which we were told was because $\ln(x)$ can't take negative values. Yet, $\arcsin(x)$ above can, and there's an absolute value there.

Could someone explain to me how all of this works, please?

Best Answer

Your antiderivative is wrong when $x < -1$ (its derivative has the wrong sign).
If you use the substitution $(x+2)/3 = \sec(t)$ (I don't think you really used $x = \sec(t)$), your integral becomes $$\int \frac{\tan(t)}{3 \sqrt{\sec^2(t)-1}}\; dt $$ Now $\sec^2(t)-1 = \tan^2(t)$, so it may be tempting to write this as $\int dt/3 = t/3 + C$ leading to your answer. But this is wrong: if $\tan(t) < 0$ (which corresponds to $x < -5$) we will have $\sqrt{\sec^2(t)-1} = -\tan(t)$. So a correct answer would be $$ \cases{ \frac{1}{3} \sec^{-1}\left(\frac{x+2}{3}\right)+C & if $x > 1$\cr -\frac{1}{3} \sec^{-1}\left(\frac{x+2}{3}\right)+C & if $x < -5$\cr}$$ which (with different $C$ in the second case, but there's no need for the $C$'s to be the same) could be written as $$ \frac{1}{3} \sec^{-1} \left ( \frac{|x+2|}{3}\right) + C $$ Of course, if for some reason you're only interested in $x > 5$ your answer would be OK.