Solution (source code)

= Solution

First write the forcing as $\sin x\cos x$. An <integrating factor> for the <linear ordinary differential equation> is $e^{-\sin x}$, giving
$$
\frac d{dx}\big(ye^{-\sin x}\big)=\sin x\cos x\,e^{-\sin x}.
$$
Set $u=\sin x$ inside the <antiderivative>. Then
$$
\int u e^{-u}du=-(u+1)e^{-u}+C,
\qquad y=-(\sin x+1)+Ce^{\sin x}.
$$
The initial value forces $C=1$, hence
$$
\boxed{y(x)=e^{\sin x}-\sin x-1.}
$$
The resulting expression is explicit and valid for all real $x$; the substitution does not impose a global monotonicity condition on $\sin x$ when verifying an <antiderivative>.