Solving $\frac{dy}{dx} = -xy$ I'm trying to solve the differential equation $\frac{dy}{dx} = -xy$.
So far I've got:
$\frac{dy}{dx} = -xy$
$-xy\;dx = dy$
$\frac{1}{y}\;dy = -x\;dx$
$\ln(|y|) = -\frac{1}{2}x^2 + c$ (I combined both integration constants into one)
$y = e^c e^{-\frac{1}{2}x^2}$ or $y = -e^c e^{-\frac{1}{2}x^2}$
It looks correct, but I'm missing one particular case: $y = 0$.
$e^c$ is always positive, and thus is $-e^c$ always negative. Using both, I've included all solutions except $y = 0$.
For $y = 0$, the differential equation does hold though: $\frac{dy}{dx} = 0$ for any $x$, and $-xy = 0$ for any $x$ as well.
What am I missing in my computation?
 A: The equation is $y'+xy=0$. Usually I don't like to divide by $y$, instead, try and make this the derivative of some function by multiplying with an exponential. In this case
$$ e^{x^2/2}y'+xe^{x^2/2}y=0 \Leftrightarrow (e^{x^2/2}y)'=0$$
This means that there exists $c$ such that $e^{x^2/2}y=c$ and therefore $y=ce^{-x^2/2}$, and you didn't miss any of the cases.
Of course, the method doesn't work all the time, but this is a linear first order equation, and it is always solvable like this, and there even is a direct formula for solving $y'+p(x)y=q(x)$ when $p,q$ are continuous:
$$ \int q(x)dx \cdot e^{-\int p(x)} $$
A: A "general" solution of a differential equation often misses some particular cases, which might be obtained as limits where a parameter goes to $+\infty$ or $-\infty$.  In this case you would take $c \to -\infty$ so $e^c e^{-x^2/2} \to 0$.  Or you could identify $\pm e^c$ as a new parameter $A$, giving you the solution $y = A e^{-x^2/2}$ (and of course the case $A=0$ works, even though it isn't a value of $\pm e^c$).   
