Answer
The differential equation :
$$
(x+2) \sin y d x+x \cos y d y=0
$$
is not exact but becomes exact when multiplied by the given integrating factor $\mu(x, y)=x e^{x} $ and its solutions are given implicitly by
$$
x^{2} e^{x} \sin y =c
$$
where $ c $ is an arbitrary constant
Work Step by Step
$$
(x+2) \sin y d x+x \cos y d y=0, \quad \mu(x, y)=x 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) &=(x+2) \sin y
\\ N(x,y) &=x \cos y \end{aligned}
$$
By calculating $M_{y}$ and $N_{x}$ , we find that
$$
\begin{aligned} M_{y}(x, y) &= (x+2) \cos y
\\ N_{x}(x, y) & = \cos y \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)=x e^{x}$, we obtain
$$
\left( x e^{x} (x+2) \sin y \right) d x+\left( x^{2} e^{x} \cos y\right) d y=0, \quad \quad (ii)
$$
The latter equation is exact, since
$$
M_{y}(x, y)= x e^{x} (x+2) \cos y =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) =\left( x e^{x} (x+2) \sin y \right) ,
\\ \psi_{y}(x, y) &=N(x,y) =\left( x^{2} e^{x} \cos y\right) \end{aligned} \quad \quad (iii)
$$
Integrating the first of these equations with respect to $x$ , we obtain
$$
\begin{split}
\psi(x, y) & =\sin y \int { x e^{x} (x+2) } dx \\
& = \sin y \int { x e^{x} (x+2) } dx +h(y)
\\ & = \sin y \left( \left(x^{2}+2 x\right) e^{x}-\int(2 x+2) e^{x} d x \right)+h(y)
\\ & = \sin y \left( \left(x^{2}+2 x\right) e^{x}-2 e^{x} x \right)+h(y)
\\ & = x^{2} e^{x} \sin y +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)= x^{2} e^{x} \cos y +h^{\prime}(y)= \left( x^{2} e^{x} \cos y\right)
$$
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. (*) gives
$$
\psi(x, y)= x^{2} e^{x} \sin y
$$
Hence solutions of Eq. (i) are given implicitly by
$$
\psi(x, y) = x^{2} e^{x} \sin y =c
$$
where $ c $ is an arbitrary constant