Find solution for $\frac{dx}{dt}=|x|$ My solution:

*

*$x>0$ $$\begin{align}\frac{\mathrm dx}{\mathrm dt}=x &\Rightarrow \frac{\mathrm dx}{x}=\mathrm dt \\ &\Rightarrow \int \frac{\mathrm dx}{x} = \int\mathrm dt \\ &\Rightarrow \ln(x)= t + C_{0} \\ &\Rightarrow e^{\ln(x)}=e^{t+C_0} \\ &\Rightarrow x=C_1e^t.\end{align}$$


*$x<0$ $$\begin{align} \frac{\mathrm dx}{\mathrm dt}=-x &\Rightarrow -\frac{\mathrm dx}{x}=\mathrm dt \\ &\Rightarrow -\int \frac{\mathrm dx}{x} = \int\mathrm dt \\ &\Rightarrow \ln(x)= -t - C_{2} \\ &\Rightarrow e^{\ln x} =e^{-t-C_2} \\ &\Rightarrow x=C_3e^{-t}. \end{align}$$


*$x=0$ $$\begin{align}\frac{\mathrm dx}{\mathrm dt}=0 &\Rightarrow \int \frac{\mathrm dx}{\mathrm dt} = \int 0 \\ &\Rightarrow \int\mathrm dx= \int 0\mathrm dt \\ &\Rightarrow x=C_4.\end{align}$$
I think that 1. and 2. are ok but I'm not sure 3. is correct.
 A: I think your solution is right.
Note that in 1. $$\frac{\mathrm dx}{\mathrm dt}=C_1e^t<0\quad\forall\quad C_1>0$$ and in 2. $$\frac{\mathrm dx}{\mathrm dt}=-C_3e^{-t}<0\quad\forall\quad C_3<0$$
So, $x(t)=C_1e^t$ will be a solution as long $C_1>0$ as well as $x(t)=C_3e^{-t}$ as long $C_3<0$ and so will $x(t)=C_4$ as long $C_4=0$.
A: I think you have received a perfectly good answer already, but I would like to contribute some graphs to support it.

Consider for a moment the simpler differential equation,
$$ \frac{\mathrm dx}{\mathrm dt} = x. $$
The general solution for this is
$$ x(t) = C e^t, $$
where $C$ is any real constant; $C$ can be positive, negative, or zero.
Several of these solutions are plotted below.


Now let's consider your equation,
$$ \frac{\mathrm dx}{\mathrm dt} = \lvert x\rvert. $$
Suppose a solution passes through the point $(x_0,t_0).$
What you have found is that the solution is then
$$
x(t) = \begin{cases}
 C_1 e^t & \text{where $C_1 > 0$, if $x_0 > 0$} \\
 0       & \text{if $x_0 = 0$} \\
 C_3 e^t & \text{where $C_3 < 0$, if $x_0 < 0$} \\
\end{cases}
$$
The figure below shows several of these solutions. I colored the different cases differently, but you do not need color to tell which case is which.
The graph is the same as the previous one except that all the curves below the $t$-axis have been flipped left-to-right.

In particular, I believe your solution in your third case ($x=0$) is correct although not as precise as it could be. It is clearly possible to define a function $x(t)$ such that $\frac{\mathrm dx}{\mathrm dt} = 0$ for all $t$, and as the domain of $t$ is all real numbers there is no difficulty in showing that $\frac{\mathrm dx}{\mathrm dt}$ is meaningful.
Any constant function will satisfy the zero derivative condition,
but since in your case the derivative can be zero only when $x = 0,$
you have a valid solution only for $C_4 = 0.$
(Similarly you should note in your other two cases that $C_1 > 0$ and $C_3 < 0$;
I added those conditions in my definition of $x(t)$.)
