81.4.15 problem 5-16

Internal problem ID [21529]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 5. Integrating factors. Page 72.
Problem number : 5-16
Date solved : Thursday, October 02, 2025 at 07:46:54 PM
CAS classification : [_rational, [_Abel, `2nd type`, `class A`]]

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