29.4.5 problem 5

Internal problem ID [7258]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 4. OTHER METHODS FOR FIRST-ORDER EQUATIONS. page 406
Problem number : 5
Date solved : Tuesday, September 30, 2025 at 04:26:27 PM
CAS classification : [[_homogeneous, `class C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

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