# I'm trying to understand what is wrong with this solution, since I'm not getting the same answer in

I'm trying to understand what is wrong with this solution, since I'm not getting the same answer in Matlab
${y}^{\prime }-xy=x{y}^{3/2}\phantom{\rule{thinmathspace}{0ex}},y\left(1\right)=4$
$\begin{array}{rlr}{y}^{\prime }-xy=& x{y}^{3/2}& \\ \frac{dy}{dx}=& x\left(y+{y}^{3/2}\right)& \\ \frac{dy}{\left(y+{y}^{3/2}\right)}=& x\phantom{\rule{thinmathspace}{0ex}}dx& \\ -2\mathrm{ln}\frac{1+\sqrt{y}}{\sqrt{y}}=& \frac{{x}^{2}}{2}+c& \\ y=& \frac{-1}{\left(1-{\mathrm{e}}^{\frac{-{x}^{2}}{4}+c}{\right)}^{2}}& \\ 4=& \frac{-1}{\left(1-{\mathrm{e}}^{\frac{-1}{4}+c}{\right)}^{2}}& \\ c=& -0.655& \\ y=& \frac{-1}{\left(1-{\mathrm{e}}^{\frac{-{x}^{2}}{4}-0.655}{\right)}^{2}}& \end{array}$
This is what I'm getting in Matlab
$\left(\begin{array}{c}\frac{{\left(\text{tanh}\left(\frac{{x}^{2}}{8}+\text{atanh}\left(3\right)-\frac{1}{8}\right)+1\right)}^{2}}{4}\\ \frac{{\left(\text{tanh}\left(-\frac{{x}^{2}}{8}+\text{atanh}\left(5\right)+\frac{1}{8}\right)-1\right)}^{2}}{4}\end{array}\right)$
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

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

cooloicons62
If you distribute the constant in the exponent to be also a factor, then you get to
$1+{y}^{-1/2}=C{e}^{\frac{1-{x}^{2}}{4}}$
and from that to $C=\frac{3}{2}$, so that in the end
$y\left(x\right)={\left(\frac{3}{2}{e}^{\frac{1-{x}^{2}}{4}}-1\right)}^{-2}$
One can now express the exponential in various ways in terms of hyperbolic functions, for instance one has that $\mathrm{coth}\left(u\right)+1=\frac{{e}^{u}}{\mathrm{sinh}\left(u\right)}=\frac{2}{1-{e}^{-2u}}$, which has a resemblance to parts of the solution.