29.1.18 problem 17

Internal problem ID [4625]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 1
Problem number : 17
Date solved : Tuesday, March 04, 2025 at 06:57:07 PM
CAS classification : [_linear]

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

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