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?

  • 1
    $\begingroup$ Wolfram Alpha gives $\left(\sqrt{-x}+\sqrt{x} \right)\mbox{sgn}(x)-\sqrt{-x}\color{red}{+}\sqrt{x}+c$ $\endgroup$
    – mathlove
    Nov 28, 2015 at 17:22
  • 2
    $\begingroup$ In your results, you wrote $\dfrac{1}{2}$ instead of $2$. $\endgroup$
    – Esperluet
    Nov 28, 2015 at 17:22

2 Answers 2


Using $\operatorname{sgn}(x)$ is just a (half-dirty) trick to put the two cases into one. Put in $-1$ vs. $+1$ for $\operatorname{sgn}(x)$ and your eyes will be open.

  • $\begingroup$ The trick is to be considered dirty because $\sqrt{-1}$ is hybris. $\endgroup$ Nov 28, 2015 at 17:42
  • $\begingroup$ Thank you. I understand, but I am a bit bewildered by this trick. It seems too wild. $\endgroup$ Nov 28, 2015 at 18:00
  • 3
    $\begingroup$ "hybris", as in offending the gods by thinking one is their equal, or did you maybe mean "hybrid"? ${}\qquad{}$ $\endgroup$ Nov 28, 2015 at 18:01
  • $\begingroup$ I think this is a good example (+1) that we have to be cautious what online tools provide us as an answer. Not that it is wrong, but certainly an eye opener and it is justified to be a bit critical. $\endgroup$
    – imranfat
    Nov 28, 2015 at 18:03
  • 1
    $\begingroup$ It's just a way to write it in one line without having to break it down into two separate cases (this sort of thing is frequently done). $\endgroup$ Nov 28, 2015 at 20:16

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$.

  • $\begingroup$ +1 for pointing out that 2 constants are needed for a general solution. $\endgroup$ Dec 1, 2015 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.