23.1.137 problem 141

Internal problem ID [4744]
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 : 141
Date solved : Tuesday, September 30, 2025 at 08:20:56 AM
CAS classification : [_Riccati]

\begin{align*} 2 y^{\prime }+2 \csc \left (x \right )^{2}&=y \csc \left (x \right ) \sec \left (x \right )-y^{2} \sec \left (x \right )^{2} \end{align*}
Maple. Time used: 0.018 (sec). Leaf size: 69
ode:=2*diff(y(x),x)+2*csc(x)^2 = y(x)*csc(x)*sec(x)-y(x)^2*sec(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\sqrt {-\csc \left (x \right )^{4} \sec \left (x \right )^{4}}\, \sin \left (x \right ) \cos \left (x \right )^{3} \tan \left (\frac {\sqrt {-\csc \left (x \right )^{4} \sec \left (x \right )^{4}}\, \left (\ln \left (\tan \left (x \right )\right )+2 \ln \left (\sin \left (x \right )\right )-2 \ln \left (\cos \left (x \right )\right )+2 c_1 \right ) \sin \left (x \right )^{2} \cos \left (x \right )^{2}}{12}\right )}{2}+\frac {3 \cot \left (x \right )}{2} \]
Mathematica. Time used: 3.576 (sec). Leaf size: 54
ode=2*D[y[x],x]+2*Csc[x]^2==y[x]*Csc[x]*Sec[x]-y[x]^2*Sec[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\cot (x) \left (2 \sqrt [4]{\sin ^2(x)}+c_1 \sqrt {\cos (x)}\right )}{\sqrt [4]{\sin ^2(x)}+c_1 \sqrt {\cos (x)}}\\ y(x)&\to \cot (x) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)**2*sec(x)**2 - y(x)*csc(x)*sec(x) + 2*csc(x)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE y(x)**2*sec(x)**2 - 2*y(x)/sin(2*x) + 2*csc(x)**2 + Derivative(y