Evaluating $\int_0^a \int_0^{a-x} e^{y(2a-y)} dy dx $ I = $\int_0^a \int_0^{a-x} e^{y(2a-y)} dy dx $
I have questions in calculating this one, and the reference answer does this:
I = $\int_0^a \int_0^{a-y} e^{y(2a-y)} dx dy $

questions solved: This applies the very basic trick to solve this double integral, which is to shift the integral from "first integrate dy then dx" to "first integrate dx then dy", and more important for me , when I attempted to use the "Fubini's theorem ", this trick doesn't work on this one

 A: $\int_0^a dx \int_0^{a-x} e^{y(2a-y)} dy$ doesn't look right to me. As written, it means
$(\int_0^a dx) (\int_0^{a-x} e^{y(2a-y)} dy)$. I would write it as $\int_0^a \int_0^{a-x} e^{y(2a-y)} dy dx$.
But in any case this is an integral over the triangle with vertices at $(0,0),(0,a),$ and $(a,0)$, which can be expressed as
$$0\le x\text{ and }0\le y\le a-x$$
or as
$$0\le y\text{ and }0\le x\le a-y$$
A: 
$I = \displaystyle \int_{x=0}^a \int_{y=0}^{a-x} e^{y(2 a - y) } dy dx $
The region of integral is the triangle bounded by $x = 0$, $y = 0$ and $ y = a- x$
Flipping the order of integration (see figure above), the above integral becomes
$I = \displaystyle \int_{y = 0}^a \int_{x = 0}^{a - y} e^{y(2 a - y) } dx dy $
Integrating with respect to $x$ , one gets
$I = \displaystyle \int_{y = 0}^a (a - y) e^{2 a y - y^2 } dy $
Now we note that $(a - y) = \frac{1}{2} \dfrac{d}{dy}( 2 a y - y^2 ) $
Hence,
$I = \dfrac{1}{2} \displaystyle \left[ e^{2 ay - y^2} \right]_0^a = \dfrac{1}{2}\left(e^{a^2} - 1\right) $
