23.1.352 problem 338

Internal problem ID [4959]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 338
Date solved : Tuesday, September 30, 2025 at 09:05:44 AM
CAS classification : [_rational, _Riccati]

\begin{align*} 2 x \left (1-x \right ) y^{\prime }+x +\left (1-x \right ) y^{2}&=0 \end{align*}
Maple. Time used: 0.063 (sec). Leaf size: 97
ode:=2*x*(1-x)*diff(y(x),x)+x+(1-x)*y(x)^2 = 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 (-1+x \right )} \]
Mathematica. Time used: 0.663 (sec). Leaf size: 77
ode=2*x*(1-x)*D[y[x],x]+x+(1-x)*y[x]^2==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*(1 - x)*Derivative(y(x), x) + x + (1 - x)*y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : bad operand type for unary -: list