29.3.12 problem 66

Internal problem ID [4674]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 3
Problem number : 66
Date solved : Sunday, March 30, 2025 at 03:35:57 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.186 (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.288 (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}} \]