Answer
The differential equation :
$$
\left(\frac{\sin y}{y}-2 e^{-x} \sin x\right) d x+\left(\frac{\cos y+2 e^{-x} \cos x}{y}\right) d y=0, \quad
$$
is not exact but becomes exact when multiplied by the given integrating factor $\mu(x, y)=y e^{x} $
and its solutions are given implicitly by
$$
e^{x}\sin y+2 y \cos x=c
$$
where $ c $ is an arbitrary constant
Work Step by Step
$$
\left(\frac{\sin y}{y}-2 e^{-x} \sin x\right) d x+\left(\frac{\cos y+2 e^{-x} \cos x}{y}\right) d y=0, \quad \mu(x, y)=y e^{x}
\quad \quad (i)
$$
Comparing this Equation with the differential form:
$$
M(x,y) d x+N(x,y) d y=0
$$
we observe that
$$
\begin{aligned}M(x,y) &= \left(\frac{\sin y}{y}-2 e^{-x} \sin x\right)
\\ N(x,y) &=\left(\frac{\cos y+2 e^{-x} \cos x}{y}\right) \end{aligned}
$$
By calculating $M_{y}$ and $N_{x}$ , we find that
$$
\begin{aligned} M_{y}(x, y) &= \frac{\cos y}{y}-\frac{\sin y}{y^{2}}
\\ N_{x}(x, y) & =\frac{-2e^{-x}}{y} \left( \sin x +\cos x \right) \end{aligned}
$$
we obtain that
$$
M_{y}(x, y) \neq N_{x}(x, y)
$$
so the given equation is not exact.
Multiplying Eq. (i) by this integrating factor $ \mu(x, y)=y e^{x} $, we obtain
$$
\left( e^{x}\sin y-2 y \sin x\right) d x+\left( e^{x} \cos y+2\cos x \right) d y=0, \quad \quad (ii)
$$
The latter equation is exact, since
$$
M_{y}(x, y)=e^{x} \cos y-2\sin x=N_{x}(x, y)
$$
the equation (ii) is exact. Thus there is a $\psi (x, y)$ such that
$$
\begin{aligned} \psi_{x}(x, y) &=M(x,y) =e^{x}\sin y-2 y \sin x ,
\\ \psi_{y}(x, y) &=N(x,y) =e^{x} \cos y+2\cos x \end{aligned} \quad \quad (iii)
$$
Integrating the first of these equations with respect to $x$ , we obtain
$$
\begin{split}
\psi(x, y) & = \int { \left( e^{x} \sin y-2 y \sin x \right) } dx \\
& = e^{x}\sin y+2 y \cos x +h(y) \quad \quad (*)
\end{split}
$$
where $h(y)$ is an arbitrary function of $y$ only. To try to satisfy the second of Eqs. (iii), we compute $\psi_{y}(x, y) $ from Eq. (*) and set it equal to $N$, obtaining
$$
\psi_{y}(x, y)= e^{x} \cos y+2\cos x +h^{\prime}(y)= e^{x} \cos y+2\cos x
$$
Thus $h^{\prime}(y)=0$ and $h(y)=0$ The constant of integration can be omitted since any solution of the preceding differential equation is satisfactory.
Now substituting for h(y) in Eq. (iii) gives
$$
\psi(x, y)= e^{x}\sin y+2 y \cos x
$$
Hence solutions of Eq. (i) are given implicitly by
$$
\psi(x, y) = e^{x}\sin y+2 y \cos x=c
$$
where $ c $ is an arbitrary constant