89.9.9 problem 9

Internal problem ID [24489]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 4. Additional topics on equations of first order and first degree. Exercises at page 72
Problem number : 9
Date solved : Thursday, October 02, 2025 at 10:42:28 PM
CAS classification : [[_1st_order, _with_linear_symmetries], _rational]

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