Solution (source code)

= Solution

The <first-order linear differential equation> has <integrating factor> $e^{\sin x}$. Multiplying through gives
$$
(ye^{\sin x})'=2\sin x\cos x\,e^{\sin x}.
$$
With $u=\sin x$, the right side integrates to $2e^u(u-1)$. Consequently
$$
\boxed{y=2\sin x-2+Ce^{-\sin x}.}
$$
All coefficients are smooth, so these real solutions extend over the whole real axis.