60.1.163 problem 166

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

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

Maple. Time used: 0.055 (sec). Leaf size: 97
ode:=2*x*(x-1)*diff(y(x),x)+(x-1)*y(x)^2-x = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x \left (\operatorname {LegendreQ}\left (-\frac {1}{2}, 1, \frac {2-x}{x}\right ) c_1 -\operatorname {LegendreQ}\left (\frac {1}{2}, 1, \frac {2-x}{x}\right ) c_1 +\operatorname {LegendreP}\left (-\frac {1}{2}, 1, \frac {2-x}{x}\right )-\operatorname {LegendreP}\left (\frac {1}{2}, 1, \frac {2-x}{x}\right )\right )}{2 \left (\operatorname {LegendreQ}\left (-\frac {1}{2}, 1, \frac {2-x}{x}\right ) c_1 +\operatorname {LegendreP}\left (-\frac {1}{2}, 1, \frac {2-x}{x}\right )\right ) \left (x -1\right )} \]
Mathematica. Time used: 16.673 (sec). Leaf size: 77
ode=2*x*(x-1)*D[y[x],x] + (x-1)*y[x]^2 - x==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {2 \left (\pi G_{2,2}^{2,0}\left (x\left | \begin {array}{c} \frac {1}{2},\frac {3}{2} \\ 0,1 \\ \end {array} \right .\right )+c_1 (\operatorname {EllipticK}(x)-\operatorname {EllipticE}(x))\right )}{\pi G_{2,2}^{2,0}\left (x\left | \begin {array}{c} \frac {1}{2},\frac {3}{2} \\ 0,0 \\ \end {array} \right .\right )+2 c_1 \operatorname {EllipticE}(x)} \\ y(x)\to 1-\frac {\operatorname {EllipticK}(x)}{\operatorname {EllipticE}(x)} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*(x - 1)*Derivative(y(x), x) - x + (x - 1)*y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : bad operand type for unary -: list