Nonhomogeneous First order differential equation I'm trying to understand what is wrong with this solution, since I'm not getting the same answer in Matlab
$y'-xy=xy^{3/2}\, ,y(1)=4$
\begin{align*}
y'-xy=&xy^{3/2}&\\
\dfrac{dy}{dx}=&x(y+y^{3/2})&\\
\dfrac{dy}{(y+y^{3/2})}=&x\, dx&\\
-2\ln \dfrac{1+\sqrt{y}}{\sqrt{y}}=&\dfrac{x^2}{2}+c&\\
y=&\dfrac{-1}{(1-\mathrm{e}^{\tfrac{-x^2}{4}+c})^2}&\\
4=&\dfrac{-1}{(1-\mathrm{e}^{\tfrac{-1}{4}+c})^2}&\\
c=&-0.655&\\
y=&\dfrac{-1}{(1-\mathrm{e}^{\tfrac{-x^2}{4}-0.655})^2}&
\end{align*}
This is what I'm getting in Matlab
$ \left(\begin{array}{c}
\frac{{{\left(\textrm{tanh}\left(\frac{x^2 }{8}+\textrm{atanh}\left(3\right)-\frac{1}{8}\right)+1\right)}}^2 }{4}\\
\frac{{{\left(\textrm{tanh}\left(-\frac{x^2 }{8}+\textrm{atanh}\left(5\right)+\frac{1}{8}\right)-1\right)}}^2 }{4}
\end{array}\right)$

I think $$y=\frac {1}{(1-e^{-\frac {x^2}{4}+c})^2}$$ instead of what you wrote. $y$ cannot be negative anyway, as $\sqrt y$ is present in the equations.
