TITLE: A ''strange'' integral from WolframAlpha
QUESTION [7 upvotes]: I want integrate:
$$
\int \frac{1}{\sqrt{|x|}} \, dx
$$
so I divide for two cases
$$
x>0 \Rightarrow \int \frac{1}{\sqrt{x}} \, dx= 2\sqrt{x}+c
$$
$$
x<0 \Rightarrow \int \frac{1}{\sqrt{-x}} \, dx= -2\sqrt{-x}+c
$$
But WolframAlpha gives:
$$
\int \frac{1}{\sqrt{|x|}} \, dx=\left(\sqrt{-x}+\sqrt{x} \right)\operatorname{sgn}(x)-\sqrt{-x}+\sqrt{x}  +c
$$
How I can interpret this result? Maybe I'm wrong?

REPLY [3 votes]: Since the function is not defined for $x=0$, it's not really meaningful to have a single constant of integration for the whole thing. The most general function $F$ (not defined at $0$) for which, at each point $x\ne0$, $F'(x)=\frac{1}{\sqrt{|x|}}$, is
$$
F(x)=\begin{cases}
-2\sqrt{-x}+c_1 & \text{if $x<0$}\\
2\sqrt{x}+c_2 & \text{if $x>0$}
\end{cases}
$$
where $c_1$ and $c_2$ are arbitrary constants.
Among these functions there are some that can be extended by continuity at $0$, namely those for which $c_1=c_2$, but they're just a special case. Note that none of these special functions is differentiable at $0$.