# Solutions to differential equations involving signum function

I'm confused about the solution to a differential equation involving the $\operatorname{sgn}$ function. The ODE is

$$\frac{dx}{dt} = -bx\operatorname{sgn}(x).$$

I thought about doing this in "two" (potentially equivalent) ways. First, I used that $\operatorname{sgn}x = x/\lvert x \rvert$ so that, when the ODE is seperated we have

$$\int \frac{dx}{\lvert x\rvert} = -bt + C$$

implying that $\lvert x \rvert = Ae^{-bt}$ is the solution. Is it acceptable to leave the solution with the absolute value around it?

Secondly, is it possible to play around with the signum function as if it were constant? That is, what if I first pulled the signum out of the integral

$$\int \frac{1}{x}dx = -\operatorname{sgn}(x)bt + C$$

(I've absorbed the signum into the constant on the RHS, is that allowed?)

And now the solution is more like $x = Ae^{-\operatorname{sgn}(x)bt}$. Is this less desirable since the RHS now contains an $x$?

## 1 Answer

You can re-write your equation as $\dot{x}=-b|x|$, which has no turning points, i.e., $\dot{x}$ will never change sign. Then, split up your solution into two parts, one for $x>0$ and one for $x<0$:

$$x(t)=\begin{cases}Ce^{-bt}&\mbox{if }\,x>0 \\ Ce^{bt}&\mbox{if }\,x<0\end{cases}$$

Since in either solution $x(t)$ will be positive, the second case is a false solution, and so you get $x(t)=Ce^{-bt}$.

• Note: This is assuming $C$ is positive, but the point is only one solution is the true solution. – William J. Cunningham May 2 '17 at 15:05
• This one is closer to the reality :) $$x(t)=\begin{cases} x(0) e^{-bt}&\mbox{if }\,x(0)>0 \\ x(0) e^{bt}&\mbox{if }\,x(0)<0 \\ 0 &\mbox{if }\, x(0) = 0 \end{cases}$$ – Evgeny May 2 '17 at 15:27