2.28   ODE No. 28

\[ x^3 (-y(x))+y'(x)+x y(x)^2-2 x=0 \] Mathematica : cpu = 0.128181 (sec), leaf count = 96


\[\left \{\left \{y(x)\to \frac {\frac {1}{2} \sqrt {\pi } e^{\frac {x^4}{4}} x^3 \text {erf}\left (\frac {x^2}{2}\right )+c_1 e^{\frac {x^4}{4}} x^3+x}{x \left (\frac {1}{2} \sqrt {\pi } e^{\frac {x^4}{4}} \text {erf}\left (\frac {x^2}{2}\right )+c_1 e^{\frac {x^4}{4}}\right )}\right \}\right \}\] Maple : cpu = 0.088 (sec), leaf count = 51


\[y \relax (x ) = \frac {\erf \left (\frac {x^{2}}{2}\right ) \sqrt {\pi }\, c_{1} x^{2}+x^{2} \sqrt {\pi }+2 \,{\mathrm e}^{-\frac {x^{4}}{4}} c_{1}}{\sqrt {\pi }\, \left (\erf \left (\frac {x^{2}}{2}\right ) c_{1}+1\right )}\]

Hand solution

\begin {align} y^{\prime }-yx^{3}+xy^{2}-2x & =0\nonumber \\ y^{\prime } & =2x+yx^{3}-xy^{2}\nonumber \\ & =P\relax (x) +Q\relax (x) y+R\relax (x) y^{2}\tag {1} \end {align}

This is Riccati first order non-linear ODE with \(P\relax (x) =2x,Q\relax (x) =x^{3},R\relax (x) =-x\). We can convert Riccati to Bernoulli which is easier to solve using the substitution \(u=x^{2}-y\) or \(y=x^{2}-u\)\begin {align*} u^{\prime } & =2x-y^{\prime }\\ & =2x-\left (2x+yx^{3}-xy^{2}\right ) \\ & =2x-\left (2x+\left (x^{2}-u\right ) x^{3}-x\left (x^{2}-u\right ) ^{2}\right ) \\ & =2x-\left (2x+\left (x^{5}-ux^{3}\right ) -x\left (x^{4}+u^{2}-2x^{2}u\right ) \right ) \\ u^{\prime } & =2x-\left (2x+\left (x^{5}-ux^{3}\right ) -\left ( x^{5}+xu^{2}-2x^{3}u\right ) \right ) \\ & =2x-2x-\left (x^{5}-ux^{3}\right ) +\left (x^{5}+xu^{2}-2x^{3}u\right ) \\ & =-x^{5}+ux^{3}+x^{5}+xu^{2}-2x^{3}u\\ & =-ux^{3}+xu^{2} \end {align*}

This is of the form \(u^{\prime }=P\relax (x) +Q\relax (x) u+R\relax (x) u^{2}\) and since \(P\relax (x) =0\) then it is Bernoulli differential equation. (when \(P\relax (x) \neq 0\) and \(R\relax (x) \neq 0\) it is Riccati). To solve Bernoulli we always start by dividing by \(u^{2}\)\[ \frac {u^{\prime }}{u^{2}}=-\frac {1}{u}x^{3}+x \] Then we let \(\zeta =-\frac {1}{u}\), hence \(\zeta ^{\prime }=\frac {u^{\prime }}{u^{2}}\), therefore the above becomes\begin {align*} \zeta ^{\prime } & =x^{3}\zeta +x\\ \zeta ^{\prime }-x^{3}\zeta & =x \end {align*}

Integrating factor is \(e^{-\int x^{3}dx}=e^{-\frac {x^{4}}{4}}\), hence \[ d\left (e^{-\frac {x^{4}}{4}}\zeta \right ) =xe^{-\frac {x^{4}}{4}}\] Integrating both sides gives\[ e^{-\frac {x^{4}}{4}}\zeta =\int xe^{-\frac {x^{4}}{4}}dx+C \] \(\int xe^{-\frac {x^{4}}{4}}dx=\frac {\sqrt {\pi }}{2}\operatorname {erf}\left ( \frac {x^{2}}{2}\right ) \), hence from above\begin {align*} e^{-\frac {x^{4}}{4}}\zeta & =\frac {\sqrt {\pi }}{2}\operatorname {erf}\left ( \frac {x^{2}}{2}\right ) +C\\ \zeta & =e^{\frac {x^{4}}{4}}\left (\frac {\sqrt {\pi }}{2}\operatorname {erf}\left (\frac {x^{2}}{2}\right ) +C\right ) \end {align*}

Since \(\zeta =-\frac {1}{u}\) then\[ u=-e^{-\frac {x^{4}}{4}}\left (\frac {\sqrt {\pi }}{2}\operatorname {erf}\left ( \frac {x^{2}}{2}\right ) +C\right ) ^{-1}\]

And since \(y=x^{2}-u\) then\begin {align*} y & =x^{2}+e^{-\frac {x^{4}}{4}}\left (\frac {\sqrt {\pi }}{2}\operatorname {erf}\left (\frac {x^{2}}{2}\right ) +C\right ) ^{-1}\\ & =x^{2}+\frac {e^{-\frac {x^{4}}{4}}}{\frac {\sqrt {\pi }}{2}\operatorname {erf}\left (\frac {x^{2}}{2}\right ) +C} \end {align*}

Verification