29.2.19 problem 44

Internal problem ID [4652]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 2
Problem number : 44
Date solved : Sunday, March 30, 2025 at 03:32:33 AM
CAS classification : [[_homogeneous, `class C`], _Riccati]

\begin{align*} y^{\prime }&=3-3 x +3 y+\left (x -y\right )^{2} \end{align*}

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