29.15.35 problem 443

Internal problem ID [5041]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 15
Problem number : 443
Date solved : Sunday, March 30, 2025 at 06:31:42 AM
CAS classification : [[_homogeneous, `class C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.007 (sec). Leaf size: 39
ode:=(2+x+y(x))*diff(y(x),x) = 1-x-y(x); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -x -2-\sqrt {-6 c_1 +6 x +4} \\ y &= -x -2+\sqrt {-6 c_1 +6 x +4} \\ \end{align*}
Mathematica. Time used: 0.119 (sec). Leaf size: 43
ode=(2+x+y[x])D[y[x],x]==1-x-y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -x-\sqrt {6 x+4+c_1}-2 \\ y(x)\to -x+\sqrt {6 x+4+c_1}-2 \\ \end{align*}
Sympy. Time used: 0.868 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x + (x + y(x) + 2)*Derivative(y(x), x) + y(x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - x - \sqrt {C_{1} + 6 x} - 2, \ y{\left (x \right )} = - x + \sqrt {C_{1} + 6 x} - 2\right ] \]