so
then
and
Because when you partially integrate with respect to you forgot to consider an arbitrary function of that was lost (since any function of differentiated w.r.t. is 0) and vice versa.
Another way of solving your problem:
(integrate w.r.t. y)
(integrate w.r.t. x)
Therefore, by inspection, must be , and .
So