2.29   ODE No. 29

  1. Problem in Latex
  2. Mathematica input
  3. Maple input

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

\[\left \{\left \{y(x)\to -\frac {3 e^{3 c_1+\frac {3 x^2}{2}}}{e^{3 c_1+\frac {3 x^2}{2}}-1}\right \}\right \}\]

Maple : cpu = 0.089 (sec), leaf count = 19

\[ \left \{ y \left ( x \right ) =3\, \left ( -1+3\,{{\rm e}^{-3/2\,{x}^{2}}}{\it \_C1} \right ) ^{-1} \right \} \]

Hand solution

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

This is Bernoulli first order non-linear ODE since \(P\left ( x\right ) =0\). To solve Bernoulli we always start by dividing by \(y^{2}\)\[ \frac {y^{\prime }}{y^{2}}=\frac {3x}{y}+x \] Then we let \(u=\frac {1}{y}\), hence \(u^{\prime }=\frac {-y^{\prime }}{y^{2}}\), therefore the above becomes\begin {align*} -u^{\prime } & =3xu+x\\ u^{\prime }+3ux & =-x \end {align*}

Integrating factor is \(e^{\int 3xdx}=e^{\frac {3x^{2}}{2}}\), hence \[ d\left ( e^{\frac {3x^{2}}{2}}u\right ) =-xe^{\frac {3x^{2}}{2}}\] Integrating both sides gives\begin {align*} e^{\frac {3x^{2}}{2}}u & =\int -xe^{\frac {3x^{2}}{2}}dx+C\\ & =-\frac {1}{3}e^{\frac {3x^{2}}{2}}+C \end {align*}

Hence from above\[ u=e^{\frac {-3x^{2}}{2}}\left ( -\frac {1}{3}e^{\frac {3x^{2}}{2}}+C\right ) \]

And since \(y=\frac {1}{u}\) then\[ y=\frac {e^{\frac {3x^{2}}{2}}}{C-\frac {1}{3}e^{\frac {3x^{2}}{2}}}\] Verification

eq:=diff(y(x),x)-x*y(x)^2-3*x*y(x) = 0; 
sol:=exp(3*x^2/2)/(_C1- 1/3*exp(3*x^2/2)); 
odetest(y(x)=sol,eq); 
0