Why are absolute value signs ignored in the indefinite integral $\int x \sec^{-1}(x) dx$? I have seen that the integral $\int x \sec^{-1}(x) dx$ is evaluated in the following way using partial integration:

$$\int x \sec^{-1}(x) dx =\dfrac{x^2}{2}\sec^{-1}(x)-{\displaystyle\int}\dfrac{x}{2\sqrt{x^2-1}}\,\mathrm{d}x$$

That is, $\frac{d}{dx} \sec^{-1}(x)=\frac{1}{x\sqrt{x^2-1}}$ is used.

However, it is actually known that $\frac{d}{dx} \sec^{-1}(x)=\frac{1}{|x|\sqrt{x^2-1}}$.

Why can the absolute value signs be omitted?

EDIT:
I have also seen this integral but it doesn't solve my problem:

$$\int{{\frac{{du}}{{u\sqrt{{{{u}^{2}}-1}}}}}}\,=\text{arcsec}\,\left| u \right|+C$$
As you have suspected, the absolute value cannot be omitted. So the proposed answer only works for $x &gt; 1$.



For a more precise computation, we may recognize the derivative of $\operatorname{arcsec}$ as

$$ \frac{d}{dz}\operatorname{arcsec}(z) = \frac{1}{z^2\sqrt{1-\frac{1}{z^2}}}. $$

This formula holds on $\{z\in\mathbb{C} : |z| &gt; 1 \}$. Then we can compute the integral as

\begin{align}
\int z \operatorname{arcsec}(z) \, \mathrm{d}z
&amp;= \frac{z^2}{2}\operatorname{arcsec}(z) - \int \frac{1}{2\sqrt{1-\frac{1}{z^2}}} \, \mathrm{d}z \\
&amp;= \frac{z^2}{2}\operatorname{arcsec}(z) - \frac{z}{2}\sqrt{1 - \frac{1}{z^2}} + \mathsf{C}.
\end{align}

Again, this holds on all of $\{z \in \mathbb{C} : |z| &gt; 1\}$, and in particular, this reduces to

$$ \int x \operatorname{arcsec}(x) \, \mathrm{d}x = \frac{x^2}{2}\operatorname{arcsec}(x) - \frac{\operatorname{sign}(x)}{2}\sqrt{x^2 - 1} + \mathsf{C} $$

for real $x$. Obviously this is different from what we get when we compute the first line in OP's question.
As you have suspected, the absolute value cannot be omitted. So the proposed answer only works for $x &gt; 1$.



For a more precise computation, we may recognize the derivative of $\operatorname{arcsec}$ as

$$ \frac{d}{dz}\operatorname{arcsec}(z) = \frac{1}{z^2\sqrt{1-\frac{1}{z^2}}}. $$

This formula holds on $\{z\in\mathbb{C} : |z| &gt; 1 \}$. Then we can compute the integral as

\begin{align}
\int z \operatorname{arcsec}(z) \, \mathrm{d}z
&amp;= \frac{z^2}{2}\operatorname{arcsec}(z) - \int \frac{1}{2\sqrt{1-\frac{1}{z^2}}} \, \mathrm{d}z \\
&amp;= \frac{z^2}{2}\operatorname{arcsec}(z) - \frac{z}{2}\sqrt{1 - \frac{1}{z^2}} + \mathsf{C}.
\end{align}

Again, this holds on all of $\{z \in \mathbb{C} : |z| &gt; 1\}$, and in particular, this reduces to

$$ \int x \operatorname{arcsec}(x) \, \mathrm{d}x = \frac{x^2}{2}\operatorname{arcsec}(x) - \frac{\operatorname{sign}(x)}{2}\sqrt{x^2 - 1} + \mathsf{C} $$

for real $x$. Obviously this is different from what we get when we compute the first line in OP's question.