Solution (source code)

= Solution

Where $\cos x\ne0$, the <separable differential equation> is $y'=y\tan x$. Separating and taking <antiderivatives> gives $\ln|y|=-\ln|\cos x|+C$, for nonzero $y$. Including the zero solution, the explicit general solution is
$$
\boxed{y(x)=C\sec x,\qquad C\in\mathbb R,}
$$
on any <interval> with $\cos x\ne0$. It can also be obtained without dividing by $y$: the <product rule> gives $(y\cos x)'=0$.

A nonzero solution cannot extend through a zero of $\cos x$. If a differentiable solution is required on an <interval> containing such a zero, the original equation there requires $y=0$, and the only such solution across that zero is $y\equiv0$.