75.10.4 problem 235

Internal problem ID [16772]
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, March 13, 2025 at 08:44:50 AM
CAS classification : [[_homogeneous, `class G`], _rational, _Riccati]

\begin{align*} x^{2} y^{\prime }&=x^{2} y^{2}+x y+1 \end{align*}

Maple. Time used: 0.004 (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 (\ln \left (x \right )-c_{1} \right )} \]
Mathematica. Time used: 0.169 (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.158 (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} \]