2.1.23 Recover a function from its gradient vector

problem number 23

Taken from Mathematica DSolve help pages

Solve for \(f(x,y)\) \begin {align*} \frac { \partial f}{\partial x} &= x y \cos (x y)+ \sin (x y) \\ \frac { \partial f}{\partial y} &= -e^{-y} +x^2 \cos (x y) \end {align*}

Mathematica

ClearAll["Global`*"]; 
eq1 = D[f[x, y], x] == x*y*Cos[x*y] + Sin[x*y]; 
 eq2 = D[f[x, y], y] == -E^(-y) + x^2*Cos[x*y]; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{eq1, eq2}, f[x, y], {x, y}], 60*10]];
 

\[\left \{\left \{f(x,y)\to x \sin (x y)+e^{-y}+c_1\right \}\right \}\]

Maple

restart; 
eq1:=diff(f(x,y),x)=x*y*cos(x*y)+sin(x*y); 
eq2:=diff(f(x,y),y)=-exp(-y)+x^2*cos(x*y); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve({eq1,eq2},f(x,y))),output='realtime'));
 

\[\{f \left (x , y\right ) = x \sin \left (x y \right )+c_{1}+{\mathrm e}^{-y}\}\]

____________________________________________________________________________________