Solution (source code)

= Solution

The <product rule> gives
$$
d(y\sin^2x)=y\sin(2x)dx+\sin^2x\,dy.
$$
Thus this is an <exact differential>, and its zero level differential means $y\sin^2x=C$. The initial data set $C=1$, giving
$$
\boxed{y=\csc^2x,\qquad0<x<\pi.}
$$
The displayed interval is the maximal connected real interval containing $\pi/2$ on which this finite-valued solution is defined.