Proof of integral involving the inverse hyperbolic secant and cosent We know that $$ \int \frac{dx}{x \sqrt{a^2 \pm x^2} } = -\frac{1}{a} \ln \frac{a+ \sqrt{a^2 \pm x^2}}{\lvert x\rvert }+C$$
I tried proving this integral setting $x = a \ \mathrm{csch} \ u $ and using substitution (and assuming that $u$ and $a$ are both greater than zero), but that got me all the right answers without the absolute value symbol at the $x$. How/why is the absolute value symbol included? It would be great if you could show the whole proof process.
 A: Consider the addition case. First use $x = a \text{ csch} u $ and $dx = -a \text{ csch} u \text{ coth} u du$
\begin{align}
\int \frac{dx}{x\sqrt{a^2 + x^2}} &= \int \frac{-a (\text{ csch} u) (\text{ coth} u) du}{(a \text{ csch} u)(a \text{ coth} u)}\\
&= -\int \frac{1}{a} du\\
&= -\frac{1}{a}u + c\\
&= - \frac{1}{a}\text{ arcsch} \frac{x}{a} + c\\
&= -\frac{1}{a} \ln \Bigg(\frac{1}{\frac{x}{a}} + \sqrt{\frac{1}{\frac{x^2}{a^2}} + 1}\Bigg) + c\\
&= \frac{-1}{a} \ln\bigg(\frac{a}{x} + \sqrt{\frac{a^2}{x^2} + 1}  \bigg) + c\\
&= \frac{-1}{a} \ln\bigg(\frac{a}{x} + a\sqrt{\frac{1}{x^2} + \frac{1}{a^2}}\bigg)+ c\\
&= \frac{-1}{a} \ln\bigg(\frac{a}{x} + a\sqrt{\frac{a^2 + x^2}{a^2x^2}}  \bigg) + c
\end{align}
Its in that step where the absolute value is introduced, as the square root of $a^2 x^2$ will be positive.
This yields
\begin{equation}
\int \frac{dx}{x\sqrt{a^2 + x^2}} = \frac{1}{-a}\ln \bigg(\frac{a}{x} + \frac{\sqrt{a^2 + x^2}}{|x|} \bigg)
\end{equation}
You can do the same for the negative case.
A: Note that $\frac{1}{x}$ is an odd function, then $\int \frac{dx}{x}$ is even whatever the integration constant is.  Therefore we can make the anti-derivative even by inserting the absolute sign, that is $\int \frac{dx}{x}=\ln |x|+C$.  This can be verified by differentiate the RHS: for $x<0$, 
$(\ln |x|)'=[\ln (-x)]'=-\frac{1}{(-x)}$.  Similar reason for your case.
A: W|A can integrate that and show the process of derivation.
You can also check and verify the answer you arrived at ($|\cdot|$ omitted) evaluates to the integrand when differentiated, which is a sufficient proof of validity by definition of integral.
On your actual question, I am fairly sure the issue here is exactly the same one as with the infamous $$\int\frac{\mathrm dx}{x}=\log\left|x\right|+C.$$
You see, this is not even wrong, $\log|x|$ gives $1/x$ when differentiated with respect to $x$, but evaluating that integral like that implicitly makes two assumptions:


*

*the integral must be a real-valued function on the domain where the integrand is real,

*$|\cdot|$, which multiplies by $-1$ whenever $x<0$ is somehow better than multiplying by any other negative real;


there is no sufficient necessity at all to assume any of these, moreover, by some slightly stricter definitions of $\int$, one must provide all possible antiderivatives, not only those which differ by a constant. It is guaranteed by some theorem in real analysis the antiderivatives differ by a constant only when the domain of integration is connected.
There is no way you can assume $(1)$ and have a connected domain, $x\mapsto1/x$ is discontinuous at $x=0$, so getting rid of $(2)$ provides more sense:
$$\int\frac{\mathrm dx}{x}=\begin{cases}\log(c_1 x)=\log(x)+\log(c_1),\,x\geq0;\\\log(c_2 x)=\log(x)+\log(c_2),\,x<0,\end{cases}$$
where $c_1,\,c_2$ are arbitrary real constants. Via the RHS after the piecewise brace you can easily see the derivative is still $1/x$, no matter for which piece of the function it falls for, and via the LHS just after the brace you can easily see how setting $c_2<0$ and $c_1>0$ makes the function real whenever $1/x$ is real.
The $|\cdot|$ thing is just a specific specialization, where the second constant is taken to be $c_2=-c_1$, which reduces just to $\log|x|+c_1$.
As getting rid of nonsensical assumptions makes things less obscured, lets also get rid of $(1):$
$$\log(x)=\ln|x|+i\arg(x).$$
Magically, now $\log$ is complex-differentiable everywhere, and $\dfrac{\mathrm d}{\mathrm dx}\log(x)=\dfrac{1}{x}$ for $x\neq0$.
Yes, neither $\log|x|$, nor the more general case are not complex differentiable anywhere.
And as a bonus, viewing $1/x$ as a complex function $\mathbb{C}\setminus\{0\}\mapsto\mathbb{C}$, its domain is not even disconnected at $0$ no longer! Hence only one integration constant is required.
$$\int\frac{\mathrm dx}{x}=\log(x)+C.$$
That is, I cannot see any reason to include that modulus sign.
