72.4.16 problem 17

Internal problem ID [19425]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 2. First order equations. Section 8 (Exact Equations). Problems at page 72
Problem number : 17
Date solved : Thursday, October 02, 2025 at 04:26:18 PM
CAS classification : [_exact, _Bernoulli]

\begin{align*} 1+y^{2} \sin \left (2 x \right )-2 y \cos \left (x \right )^{2} y^{\prime }&=0 \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 24
ode:=1+y(x)^2*sin(2*x)-2*y(x)*cos(x)^2*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \sqrt {x +c_1}\, \sec \left (x \right ) \\ y &= -\sqrt {x +c_1}\, \sec \left (x \right ) \\ \end{align*}
Mathematica. Time used: 0.171 (sec). Leaf size: 32
ode=(1+y[x]^2*Sin[2*x])-( 2*y[x]*Cos[x]^2  )*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\sqrt {x+c_1} \sec (x)\\ y(x)&\to \sqrt {x+c_1} \sec (x) \end{align*}
Sympy. Time used: 3.033 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)**2*sin(2*x) - 2*y(x)*cos(x)**2*Derivative(y(x), x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \frac {\sqrt {C_{1} + x}}{\cos {\left (x \right )}}, \ y{\left (x \right )} = \frac {\sqrt {C_{1} + x}}{\cos {\left (x \right )}}\right ] \]