ODE No. 108

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

\[ x y'(x)+y(x)+y(x)^2 (-\log (x))=0 \] Mathematica : cpu = 0.0119559 (sec), leaf count = 15

\[\left \{\left \{y(x)\to \frac {1}{c_1 x+\log (x)+1}\right \}\right \}\] Maple : cpu = 0.029 (sec), leaf count = 13

\[ \left \{ y \left ( x \right ) = \left ( 1+{\it \_C1}\,x+\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^{2}\ln x+y & =0\tag {1}\\ y^{\prime } & =-\frac {1}{x}y+y^{2}\frac {\ln x}{x}\nonumber \\ & =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 {\ln x}{x}\]

Let \(u=\frac {1}{y}\), hence \(u^{\prime }=-\frac {y^{\prime }}{y^{2}}\), and the above becomes

\begin {align*} -u^{\prime } & =-\frac {1}{x}u+\frac {\ln x}{x}\\ u^{\prime }-\frac {1}{x}u & =-\frac {\ln x}{x} \end {align*}

Integrating factor is \(\mu =e^{\int -\frac {1}{x}dx}=e^{-\ln x}=\frac {1}{x}\), hence

\[ d\left ( \mu u\right ) =-\mu \frac {\ln x}{x}\]

Integrating

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

Therefore

\[ u=\ln x+1+Cx \]

Since \(u=\frac {1}{y}\) then

\[ y=\frac {1}{\ln x+1+Cx}\]

Verification

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