23.1.179 problem 179

Internal problem ID [4786]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 179
Date solved : Tuesday, September 30, 2025 at 08:36:06 AM
CAS classification : [[_homogeneous, `class D`], _rational, _Riccati]

\begin{align*} x y^{\prime }&=x^{3}+\left (2 x^{2}+1\right ) y+x y^{2} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 24
ode:=x*diff(y(x),x) = x^3+(2*x^2+1)*y(x)+x*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {x \left (x^{2}+2 c_1 +2\right )}{x^{2}+2 c_1} \]
Mathematica. Time used: 0.105 (sec). Leaf size: 34
ode=x*D[y[x],x]==x^3+(1+2*x^2)*y[x]+x*y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {x \left (x^2+2+2 c_1\right )}{x^2+2 c_1}\\ y(x)&\to -x \end{align*}
Sympy. Time used: 0.204 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3 - x*y(x)**2 + x*Derivative(y(x), x) - (2*x**2 + 1)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x \left (- C_{1} - x^{2} - 1\right )}{C_{1} + x^{2} - 1} \]