62.6.1 problem Ex 1

Internal problem ID [12740]
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 13. Linear equations of first order. Page 19
Problem number : Ex 1
Date solved : Wednesday, March 05, 2025 at 08:23:33 PM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 14
ode:=diff(y(x),x)+y(x)*cot(x) = sec(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \csc \left (x \right ) \left (-\ln \left (\cos \left (x \right )\right )+c_{1} \right ) \]
Mathematica. Time used: 0.043 (sec). Leaf size: 16
ode=D[y[x],x]+y[x]*Cot[x]==Sec[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \csc (x) (-\log (\cos (x))+c_1) \]
Sympy. Time used: 0.680 (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 )}} \]