23.1.73 problem 67

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

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