= Solution
Near the initial point, division by $\cos x$ gives $y'+(1+\tan x)y=2\sec x+2\sin x$. An <integrating factor> is $e^x\sec x$, and
$$
\frac{d}{dx}(e^x\sec x\,y)=2e^x\sec^2x+2e^x\tan x=\frac{d}{dx}(2e^x\tan x).
$$
Thus $y=2\sin x+Ce^{-x}\cos x$, and $y(0)=2$ gives
$$
\boxed{y=2\sin x+2e^{-x}\cos x.}
$$
Although division by $\cos x$ was local, direct substitution verifies this smooth solution in the original equation for every real $x$, including the zeros of $\cos x$.
Back to article page