2.96   ODE No. 96

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

\[ x y'(x)-y(x)^2+1=0 \] Mathematica : cpu = 0.057777 (sec), leaf count = 33

\[\left \{\left \{y(x)\to \frac {1-e^{2 c_1} x^2}{1+e^{2 c_1} x^2}\right \}\right \}\] Maple : cpu = 0.034 (sec), leaf count = 11

\[ \left \{ y \left ( x \right ) =-\tanh \left ( \ln \left ( x \right ) +{\it \_C1} \right ) \right \} \]

Hand solution

\[ xy^{\prime }-y^{2}+1=0 \]

This is Riccati first order non-linear. But it is separable. Hence\begin {equation} y^{\prime }=\frac {y^{2}-1}{x} \tag {1} \end {equation}

Hence

\begin {align*} \frac {dy}{dx} & =\frac {y^{2}-1}{x}\\ \frac {dy}{y^{2}-1} & =\frac {dx}{x} \end {align*}

Integrating

\begin {align*} -\tanh ^{-1}\left ( y\right ) & =\ln x+C\\ y & =-\tanh \left ( \ln x+C\right ) \end {align*}

Verification

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