Problem: $y'+yx=0, \quad y(0)=-1$
We separate it:
$\frac{dy}{dx}=-yx \Rightarrow \int\frac{-1}{y}dy=\int x dx = \frac{1}{2}x^2 + C_1$
With $\int\frac{-1}{y}dy=\log(\frac{1}{|y|})+C_2$
we get
$\log(\frac{1}{|y|})=\frac{1}{2}x^2 + C$
We solve for $y$:
$|y|=e^{-\frac{1}{2}x^2}\cdot e^C=e^{-\frac{1}{2}x^2}\cdot \hat{C}$
Now, what is the best argumentation to get "rid" of $|\cdot |$?
Like I know that e.g. $|a|=b \Leftrightarrow a=\pm b$ but then I still have $\pm$. I "know" that some wil ltell me that I can "put it into $C$" but that not really an arugmentation. Maybe I just don't get how $C$ can determine if we have the positive or negative solution or why we can't have both at the same time. It just feels like I lack proper understanding to properly argument here.
$$|y|=e^{-\frac{1}{2}x^2}\cdot e^C \implies y(x)=\pm e^Ce^{-x^2/2}$$ Well you can substitute $k= \pm e^C$ so that $$y(x)=ke^{-x^2/2}$$ With integrating factor that problem of the absolute value doesn't arise $$y'+yx=0, \quad y(0)=-1$$ $$ \implies (ye^{x^2/2})'=0 \implies ye^{x^2/2}=C$$ $$y(x)=Ce^{-x^2/2}$$