2.96   ODE No. 96

\[ x y'(x)-y(x)^2+1=0 \]

Mathematica : cpu = 0.0536265 (sec), leaf count = 33

DSolve[1 - y[x]^2 + x*Derivative[1][y][x] == 0,y[x],x]
 
\[\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.059 (sec), leaf count = 11

dsolve(x*diff(y(x),x)-y(x)^2+1 = 0,y(x))
 
\[y \left (x \right ) = -\tanh \left (\ln \left (x \right )+c_{1} \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