23.1.78 problem 72

Internal problem ID [4685]
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 : 72
Date solved : Tuesday, September 30, 2025 at 07:59:22 AM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=\sin \left (x \right ) \left (2 \sec \left (x \right )^{2}-y^{2}\right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 25
ode:=diff(y(x),x) = sin(x)*(2*sec(x)^2-y(x)^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-2 c_1 \cos \left (x \right )^{2}+\sec \left (x \right )}{c_1 \cos \left (x \right )^{3}+1} \]
Mathematica. Time used: 0.489 (sec). Leaf size: 32
ode=D[y[x],x]==Sin[x]*(2*Sec[x]^2-y[x]^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\sec (x) \left (-2 \cos ^3(x)+c_1\right )}{\cos ^3(x)+c_1}\\ y(x)&\to \sec (x) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(-y(x)**2 + 2*sec(x)**2)*sin(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -(-y(x)**2 + 2*sec(x)**2)*sin(x) + Derivative(y(x), x) cannot be