Solution (source code)

= Solution

The specified range ensures $\cos y\ne0$, so the <separable differential equation> can be written $\sec^2y\,dy=\sin x\,dx$. Integrating gives $\tan y=C-\cos x$. The range selects the principal <inverse tangent>, hence
$$
\boxed{y(x)=\arctan(C-\cos x),\qquad C\in\mathbb R.}
$$
Every finite $C$ produces a solution within the required range. Constant solutions at the excluded values $y=\pm\pi/2$ are not part of this family or of the question's domain.