Show $\frac{du}{dx}=|u| \ (x\in\mathbb{R}$) has solutions $u=Ae^x$ Show the following ODE has solutions of the form $u=Ae^x$: $$\frac{du}{dx}=|u|, \ x\in\mathbb{R}.$$


My attempt:

I first considered the case where $u&gt;0$.
So, \begin{align}
\frac{du}{dx}&amp;=u \\
\int \frac{du}{u}&amp;=\int dx \\
\ln|u|&amp;=x+C, \ \ C\in\mathbb{R} \\
u&amp;=Ae^x, \ \ A=e^c\in\mathbb{R}
\end{align}
Next, for the case where $u&lt;0$ (using separations of variables as above), I get that,
$$u=Ae^{-x}.$$
For the final case, $u=0$,
$$u=0.$$
Only one of these cases admits the required form. Where have I gone wrong?
Actually, $u&gt;0$ and $u&lt;0$ are not both possible. Either $u&gt;0$ everywhere or $u&lt;0$ everywhere. Here is the argument: consider the open set $U=\{x: u(x)&gt;0\}$.  On this set we have $u(x)=Ae^{x}$. Clearly $A &gt;0$. Let us show that the open set $U$ has no boundary point. If there is a boundary point $x$ then there is a sequence $x_n \in U$ converging to $x$. We then have $u(x) =0$ and $u(x)=\lim u(x_n)$ so $Ae^{x_n} \to 0$, hence $e^{x_n} \to 0$, But this is possible only when $x_n \to -\infty$ contradicting the fact that $x_n \to x$. This proves that $U$ is an open set with no boundary points. This implies that it is either empty or the whole line. Thus the cases $u&gt;0$ and $u&lt;0$ cannot both occur.
$u=0$ is part of the first case for $u=Ae^x$ if you were to say $A \ge 0$. Your first case can actually be $A&gt;0$ because you assumed $u&gt;0$. For your second case you should get

$$\ln|u|=x+C$$

$$\implies \ln(-u)=x+C$$

$$\implies -u=Ae^x$$

$$\implies u=-Ae^x$$

for $A=e^C &gt; 0$

Altogether we can merge the three cases to have $u(x)=Ae^x, x \in \mathbb R, A \in \mathbb R$ where $sgn(A)=sgn(u(x))$