62.2.1 problem Ex 1

Internal problem ID [12732]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter 2, differential equations of the first order and the first degree. Article 9. Variables searated or separable. Page 13
Problem number : Ex 1
Date solved : Monday, March 31, 2025 at 06:56:29 AM
CAS classification : [_separable]

\begin{align*} \sec \left (x \right ) \cos \left (y\right )^{2}-\cos \left (x \right ) \sin \left (y\right ) y^{\prime }&=0 \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 9
ode:=sec(x)*cos(y(x))^2-cos(x)*sin(y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \operatorname {arcsec}\left (c_1 +\tan \left (x \right )\right ) \]
Mathematica. Time used: 0.796 (sec). Leaf size: 45
ode=(Sec[x]*Cos[y[x]]^2)-(Cos[x]*Sin[y[x]])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\sec ^{-1}(\tan (x)+2 c_1) \\ y(x)\to \sec ^{-1}(\tan (x)+2 c_1) \\ y(x)\to -\frac {\pi }{2} \\ y(x)\to \frac {\pi }{2} \\ \end{align*}
Sympy. Time used: 0.849 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-sin(y(x))*cos(x)*Derivative(y(x), x) + cos(y(x))**2/cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \operatorname {acos}{\left (\frac {\cos {\left (x \right )}}{C_{1} \cos {\left (x \right )} + \sin {\left (x \right )}} \right )} + 2 \pi , \ y{\left (x \right )} = \operatorname {acos}{\left (\frac {\cos {\left (x \right )}}{C_{1} \cos {\left (x \right )} + \sin {\left (x \right )}} \right )}\right ] \]