69.10.4 problem 235

Internal problem ID [18138]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 9. The Riccati equation. Exercises page 75
Problem number : 235
Date solved : Thursday, October 02, 2025 at 03:02:00 PM
CAS classification : [[_homogeneous, `class G`], _rational, _Riccati]

\begin{align*} x^{2} y^{\prime }&=1+y x +x^{2} y^{2} \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 23
ode:=x^2*diff(y(x),x) = x^2*y(x)^2+x*y(x)+1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\ln \left (x \right )+c_1 -1}{x \left (-c_1 +\ln \left (x \right )\right )} \]
Mathematica. Time used: 0.108 (sec). Leaf size: 33
ode=x^2*D[y[x],x]==x^2*y[x]^2+x*y[x]+1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {\log (x)+1+c_1}{x \log (x)+c_1 x}\\ y(x)&\to -\frac {1}{x} \end{align*}
Sympy. Time used: 0.099 (sec). Leaf size: 7
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*y(x)**2 + x**2*Derivative(y(x), x) - x*y(x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {1}{x} \]