We have a gradient field $F = \nabla f = <(x+1)e^{x+y},\space xe^{x+y} >$ .
It's easy to find that $f = xe^{x+y} + c \space$ only by guessing, but I try to solve it as follows:
By the Fundamental Theorem for Line Integrals:
$\int_{(x_0, y_0)}^{(x, y)} F.dr = f(x, y) - f(x_0, y_0)$
We know that $f(x_0, y_0)\space is\space constant$, so we can rewrite that as follow :
$f(x, y) = \int_{(x_0, y_0)}^{(x, y)} F.dr + c$
And because $F$ is a gradient field, we know that it is path-independent so we can choose
a path $C$ that consists of two paths $C = C_1 + C_2$ :
So $C_1$ goes from $(0,0)\space to \space (x_1, 0)$ , and $C_2$ goes from $(x_1,0)\space to \space (x_1, y_1)$
And we have :
$\int_{(x_0, y_0)}^{(x, y)} F.dr = \int_{C}F.dr$
$\int_{C}F.dr = \int_{C_1}F.dr + \int_{C_2}F.dr$
And also :
$F.dr = M.dx + N.dy$, where $M = f_x, N = f_y$
On $C_1$ we have that : $y = 0 \implies dy = 0 \space, x \space goes \space from \space 0 \space to \space x_1 $, so:
$\int_{C_1}F.dr = \int_{0}^{x_1}M.dx = \int_{0}^{x_1}(x+1)e^{x+0} dx = x_1e^{x_1}$
On $C_2$ we have that : $x = x_1 \implies dx = 0 \ \, y \space goes \space from \space 0 \space to \space y_1 $, so:
$\int_{C_2}F.dr = \int_{0}^{y_1}N.dy = \int_{0}^{y_1}x_1e^{x_1+y} dy = x_1e^{x_1+y_1}$
But :
$\int_CF.dr = x_1e^{x_1} + x_1e^{x_1+y_1} = x_1e^{x_1}(1+e^{y_1})$
And because $x_1$ and $y_1$ is just x and y (we put the subscript to avoid confusion):
$\int_CF.dr = xe^x(1+e^y)$
$\implies f(x, y) = \int_CF.dr + \space c = xe^x(1+e^y) + c \neq \space xe^{x+y} + c $
Can anyone tell me what the wrong in my solution?

The only mistake is that $$\int_{C_2} F\,\mathrm d(\text{curve})=\int_0^y x e^{x+t}\,\mathrm dt=xe^x(e^y-1)\color{red}\neq xe^{x+y}.$$