23.1.54 problem 48

Internal problem ID [4661]
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 : 48
Date solved : Tuesday, September 30, 2025 at 07:38:28 AM
CAS classification : [[_1st_order, _with_linear_symmetries], _Riccati]

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