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>0$. So, \begin{align} \frac{du}{dx}&=u \\ \int \frac{du}{u}&=\int dx \\ \ln|u|&=x+C, \ \ C\in\mathbb{R} \\ u&=Ae^x, \ \ A=e^c\in\mathbb{R} \end{align} Next, for the case where $u<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?
$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>0$ because you assumed $u>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 > 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))$