TITLE: Evaluating $\int_0^1\int_0^1 e^{\max\{x^2,y^2\}\,}\mathrm dx\,\mathrm dy$
QUESTION [7 upvotes]: The integral again for convenience is
$$
I=\int_0^1\int_0^1 e^{\max\{x^2,y^2\}}\,\mathrm dx\,\mathrm dy
$$
My thoughts:
Ignoring for a moment that the region is a rectangle, I hoped moving to polar coordinates might help. This gives
$$
I=\int_0^1\int_0^{2\pi}re^{r^2\max\{\cos^2 t,\sin^2t\}} \, \mathrm dt \, \mathrm dr
$$
Then since $|\cos t|\geq |\sin t|$ for $t\in D_1=[-\frac{\pi}{4},\frac{\pi}{4}]\cup [\frac{3\pi}{4},\frac{5\pi}{4}]$ but not for $t\in D_2=[\frac{\pi}{4},\frac{3\pi}{4}]\cup [\frac{5\pi}{4},\frac{7\pi}{4}]$
I think we can break $I$ into 
$$
I=\left[\int_0^1\int_{D_1}re^{r^2\cos^2 t}\,\mathrm dt\,\mathrm dr\right] \left[\int_0^1\int_{D_2}re^{r^2\sin^2 t}\,\mathrm dt\,\mathrm dr\right]
$$
Aside from the problem of the region not being the same, I am stuck here. Is the work above on the right track? How do I evaluate for $[0,1]\times[0,1]$? Thanks!

REPLY [7 votes]: Do not use polar coordinates: Rectangles are bad for polar coordinates.

You have a piecewise definition that's making things difficult, so use each part of the domain separately. Break the integral up into two regions, above and below the diagonal of the unit square. On the lower half,
$$\int_0^1 \int_0^x e^{\max\{x^2, y^2\}} dy \, dx = \int_0^1 \int_0^x e^{x^2} \, dy \, dx = \int_0^1 xe^{x^2} \, dx$$
The upper half is similar.

REPLY [4 votes]: HINT:
Note that
$$I=\int_0^1\int_0^y e^{y^2}\,dx\,dy+\int_0^1\int_y^1 e^{x^2}\,dx\,dy$$
Now, interchange the order of integration in the second integral.