4.1.18 \(y'(x)=\sec (x)-y(x) \cot (x)\)

ODE
\[ y'(x)=\sec (x)-y(x) \cot (x) \] ODE Classification

[_linear]

Book solution method
Linear ODE

Mathematica
cpu = 0.0225697 (sec), leaf count = 16

\[\left \{\left \{y(x)\to \csc (x) \left (c_1-\log (\cos (x))\right )\right \}\right \}\]

Maple
cpu = 0.023 (sec), leaf count = 16

\[ \left \{ y \left ( x \right ) ={\frac {-\ln \left ( \cos \left ( x \right ) \right ) +{\it \_C1}}{\sin \left ( x \right ) }} \right \} \] Mathematica raw input

DSolve[y'[x] == Sec[x] - Cot[x]*y[x],y[x],x]

Mathematica raw output

{{y[x] -> Csc[x]*(C[1] - Log[Cos[x]])}}

Maple raw input

dsolve(diff(y(x),x) = sec(x)-y(x)*cot(x), y(x),'implicit')

Maple raw output

y(x) = (-ln(cos(x))+_C1)/sin(x)