15.6.20 problem 20

Internal problem ID [2977]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 10, page 41
Problem number : 20
Date solved : Sunday, March 30, 2025 at 01:03:03 AM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 14
ode:=diff(y(x),x)+y(x)*cot(x)-sec(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (-\ln \left (\cos \left (x \right )\right )+c_1 \right ) \csc \left (x \right ) \]
Mathematica. Time used: 0.049 (sec). Leaf size: 16
ode=D[y[x],x]+(y[x]*Cot[x]-Sec[x])==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \csc (x) (-\log (\cos (x))+c_1) \]
Sympy. Time used: 0.679 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)/tan(x) + Derivative(y(x), x) - 1/cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} - \log {\left (\cos {\left (x \right )} \right )}}{\sin {\left (x \right )}} \]