23.1.71 problem 65

Internal problem ID [4678]
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 : 65
Date solved : Tuesday, September 30, 2025 at 07:58:09 AM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=1-x -x^{3}+\left (2 x^{2}+1\right ) y-x y^{2} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 30
ode:=diff(y(x),x) = 1-x-x^3+(2*x^2+1)*y(x)-x*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_1 \left (x^{2}-x +1\right ) {\mathrm e}^{x}+x}{1+c_1 \left (x -1\right ) {\mathrm e}^{x}} \]
Mathematica. Time used: 0.66 (sec). Leaf size: 90
ode=D[y[x],x]==1-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 \int _1^xe^{K[2]+1} K[2]dK[2]+e^{x+1}+c_1 x}{\int _1^xe^{K[2]+1} K[2]dK[2]+c_1}\\ y(x)&\to x\\ y(x)&\to \frac {e^{x+1}}{\int _1^xe^{K[2]+1} K[2]dK[2]}+x \end{align*}
Sympy. Time used: 0.250 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**3 + x*y(x)**2 + x - (2*x**2 + 1)*y(x) + Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {- C_{1} x + x^{2} e^{x} - x e^{x} + e^{x}}{- C_{1} + x e^{x} - e^{x}} \]