89.10.21 problem 21

Internal problem ID [24514]
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 77
Problem number : 21
Date solved : Thursday, October 02, 2025 at 10:44:17 PM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`], [_Abel, `2nd type`, `class A`]]

\begin{align*} \left (x -1\right ) y-\left (x^{2}-2 x -2 y\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 53
ode:=(x-1)*y(x)-(x^2-2*x-2*y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {2-\sqrt {4+\left (-2 x^{2}+4 x \right ) c_1}}{2 c_1} \\ y &= \frac {2+\sqrt {4+\left (-2 x^{2}+4 x \right ) c_1}}{2 c_1} \\ \end{align*}
Mathematica. Time used: 0.818 (sec). Leaf size: 81
ode=y[x]*( x-1)-( x^2-2*x-2*y[x] )*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {i (x-2) x}{\sqrt {c_1 x^2-2 c_1 x-4}-2 i}\\ y(x)&\to \frac {i (x-2) x}{\sqrt {c_1 x^2-2 c_1 x-4}+2 i}\\ y(x)&\to 0\\ y(x)&\to \text {Indeterminate} \end{align*}
Sympy. Time used: 0.784 (sec). Leaf size: 54
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - 1)*y(x) - (x**2 - 2*x - 2*y(x))*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {- \frac {\sqrt {2} \sqrt {- C_{1} x^{2} + 2 C_{1} x + 2}}{2} + 1}{C_{1}}, \ y{\left (x \right )} = \frac {\frac {\sqrt {2} \sqrt {- C_{1} x^{2} + 2 C_{1} x + 2}}{2} + 1}{C_{1}}\right ] \]