60.1.153 problem 156

Internal problem ID [10167]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 156
Date solved : Wednesday, March 05, 2025 at 08:34:44 AM
CAS classification : [_rational, _Bernoulli]

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

Maple. Time used: 0.003 (sec). Leaf size: 20
ode:=(x^2-1)*diff(y(x),x)-y(x)*(y(x)-x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {1}{\sqrt {x -1}\, \sqrt {x +1}\, c_{1} +x} \]
Mathematica. Time used: 0.192 (sec). Leaf size: 26
ode=(x^2-1)*D[y[x],x] - y[x]*(y[x]-x)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {1}{x+c_1 \sqrt {x^2-1}} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.669 (sec). Leaf size: 58
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(-x + y(x))*y(x) + (x**2 - 1)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \begin {cases} \frac {1}{C_{1} \sqrt {x^{2} - 1} + x} & \text {for}\: x > 1 \vee x < -1 \\\frac {\sqrt {1 - x^{2}}}{C_{1} \sqrt {1 - x^{2}} \sqrt {x^{2} - 1} - i x \sqrt {x^{2} - 1}} & \text {otherwise} \end {cases} \]