Question
In an exercise, I am supposed to evaluate the integral $$ \iint_D(x -y)e^{x+y} $$ where $D$ is the triangle with the three corner points $(0,0)$, $(0,2)$ and $(2,2)$.
I tried computing $$ \int_0^2\int_0^x f(x,y)~dydx $$ and I got the given correct answer, but with the opposite sign eg. $(-1)\cdot$the correct answer. This can happen when the bounds are flipped for an integral as can be seen in this S.E question for example. Have I flipped on any of the bounds? It seems to me, that these are the obvious bounds to choose.
You can see my solution below, if this is not the problem.
My solution
$$ \begin{align} f &= (x-y)e^{x+y}\\ \iint_D f~dydx &= \int_0^2\int_0^x f~dydx\\ \int_0^x f~dy &= \left[(x-y)e^{x+y} + e^{x+y} \right]_0^x\\ &= e^{2x} - xe^x - e^x\\ \Rightarrow \int_0^2\int_0^x f(x,y)~dydx &= \left[\frac{e^{2x}}{2} - xe^x \color{grey}{+e^x - e^x} \right]_0^x\\ = e^4/2 - 2e^2 - 1/2 &=\frac{1}{2}(e^4 - 4e^2 - 1) \end{align} $$ It's supposed to be $-1/2(e^4 - 4e^2 - 1)$. I have double checked with wolfram alpha and it seems that my calculation of the integral is correct.
In the region $D$, $x\leqslant y\leqslant 2$, so the limits for $y$ should be $x$ and $2$ rather than $0$ and $x$. With your limits, you are finding the integral over the triangle with vertices $(0,0), (2,0)$ and $(2,2)$.