2.109   ODE No. 109

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

\[ x y'(x)-y(x) (2 y(x) \log (x)-1)=0 \] Mathematica : cpu = 0.0117834 (sec), leaf count = 17

\[\left \{\left \{y(x)\to \frac {1}{c_1 x+2 \log (x)+2}\right \}\right \}\]

Maple : cpu = 0.017 (sec), leaf count = 15

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

Hand solution

\(xy^{\prime }+axy^{2}+2y+bx=0\)This is Riccati non-linear first order. Converting it to standard form\begin {align} xy^{\prime }-y\left ( 2y\ln x-1\right ) & =0\nonumber \\ xy^{\prime } & =y\left ( 2y\ln x-1\right ) \nonumber \\ y^{\prime } & =-\frac {1}{x}y+y^{2}\frac {2}{x}\ln x\tag {1}\\ y^{\prime } & =f_{0}+f_{1}y+f_{2}y^{2}\nonumber \end {align}

This is Bernoulli non-linear first order ODE since \(f_{0}=0\). Dividing by \(y^{2}\) gives\[ \frac {y^{\prime }}{y^{2}}=-\frac {1}{x}\frac {1}{y}+\frac {2}{x}\ln x \] Putting \(u=\frac {1}{y}\), hence \(u^{\prime }=-\frac {y^{\prime }}{y^{2}}\), and the above becomes\begin {align*} -u^{\prime } & =-\frac {1}{x}u+2\frac {\ln x}{x}\\ -u^{\prime }+\frac {1}{x}u & =2\frac {\ln x}{x}\\ u^{\prime }-\frac {1}{x}u & =-2\frac {\ln x}{x} \end {align*}

Integrating factor is \(\mu =e^{\int -\frac {1}{x}dx}=e^{-\ln x}=\frac {1}{x}\), hence\begin {align*} d\left ( \mu u\right ) & =-2\mu \frac {\ln x}{x}\\ d\left ( \frac {1}{x}u\right ) & =-2\frac {\ln x}{x^{2}} \end {align*}

Integrating\begin {align*} \frac {1}{x}u & =-2\int \frac {1}{x^{2}}\ln xdx+C\\ & =-2\left ( -\frac {\ln x}{x}-\frac {1}{x}\right ) +C \end {align*}

Therefore\begin {align*} u & =-2x\left ( -\frac {\ln x}{x}-\frac {1}{x}\right ) +Cx\\ & =2\left ( \ln x+1\right ) +Cx \end {align*}

Since \(u=\frac {1}{y}\) then\[ y=\frac {1}{2\left ( \ln x+1\right ) +Cx}\] Verification

restart; 
ode:=x*diff(y(x),x)-y(x)*(2*y(x)*ln(x)-1)=0; 
my_solution:=1/(2*(ln(x)+1)+_C1*x); 
odetest(y(x)=my_solution,ode); 
0