Please help solving this inital-value problem The initial-value problem 
$$\begin{cases}(ye^{xy} + cos(x))dx + (xe^{xy})dy = 0\\y(\dfrac{\pi}{2}) = 0\end{cases}$$
From my calculations it seems the integrating factor depends on y and x, but I am unsure how to find the correct integrating factor. 
Please help

\begin{eqnarray}
\big(ye^{xy} + \cos x\big)dx + (xe^{xy})dy &=& 0\\
e^{xy}(ydx+xdy) + \cos x dx &=& 0\\
e^{xy}d(xy) + \cos x dx &=& 0\\
d(e^{xy}) + d(\sin x)&=& 0\\
d(e^{xy}\sin x)&=& 0\\
e^{xy}\sin x&=& C\\
\end{eqnarray}
with $y(\dfrac{\pi}{2}) = 0$ we have $e^{\frac{\pi}{2}0}\sin\dfrac{\pi}{2}=C$ or$C=1$ and $\color{blue}{e^{xy}\sin x=1}$ is final solution.
