29.12.16 problem 335

Internal problem ID [4935]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 12
Problem number : 335
Date solved : Tuesday, March 04, 2025 at 07:32:01 PM
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.146 (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 \left (x \right ) = \frac {x \left (\operatorname {LegendreQ}\left (-\frac {1}{2}, 1, \frac {-x +2}{x}\right ) c_{1} -\operatorname {LegendreQ}\left (\frac {1}{2}, 1, \frac {-x +2}{x}\right ) c_{1} +\operatorname {LegendreP}\left (-\frac {1}{2}, 1, \frac {-x +2}{x}\right )-\operatorname {LegendreP}\left (\frac {1}{2}, 1, \frac {-x +2}{x}\right )\right )}{2 \left (\operatorname {LegendreQ}\left (-\frac {1}{2}, 1, \frac {-x +2}{x}\right ) c_{1} +\operatorname {LegendreP}\left (-\frac {1}{2}, 1, \frac {-x +2}{x}\right )\right ) \left (x -1\right )} \]
Mathematica. Time used: 16.863 (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