(1 + xy)e^{xy} + cosy =
(1 + xy)e^{xy} + g'(y) \implies\\
g'(y) = cosy \implies\\
g(y) = siny