60.1.155 problem 158

Internal problem ID [10169]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 158
Date solved : Sunday, March 30, 2025 at 03:21:20 PM
CAS classification : [_separable]

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

Maple. Time used: 0.003 (sec). Leaf size: 22
ode:=(x^2-1)*diff(y(x),x)+a*x*y(x)^2+x*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {1}{\sqrt {x -1}\, \sqrt {x +1}\, c_1 -a} \]
Mathematica. Time used: 0.336 (sec). Leaf size: 57
ode=(x^2-1)*D[y[x],x] + a*x*y[x]^2 + x*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {1}{K[1] (a K[1]+1)}dK[1]\&\right ]\left [-\frac {1}{2} \log \left (1-x^2\right )+c_1\right ] \\ y(x)\to 0 \\ y(x)\to -\frac {1}{a} \\ \end{align*}
Sympy. Time used: 1.598 (sec). Leaf size: 44
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(a*x*y(x)**2 + x*y(x) + (x**2 - 1)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {- C_{1} + \sqrt {C_{1} \left (x^{2} - 1\right )}}{a \left (C_{1} - x^{2} + 1\right )}, \ y{\left (x \right )} = \frac {C_{1} + \sqrt {C_{1} \left (x^{2} - 1\right )}}{a \left (- C_{1} + x^{2} - 1\right )}\right ] \]