TITLE: Compute $\iint_D e^{(x+y)^2} \ dxdy.$
QUESTION [5 upvotes]: Compute $$\iint_D e^{(x+y)^2} \ dxdy,$$
where $D=\{ y\leq3x, \ x\leq 3y, \ 0 \leq x+y \leq 2 \}.$

The area $D$ is easily drawn:

From this image, it's easy to seet that we can split the integral into two parts:
$$\iint_D e^{(x+y)^2} \ dxdy = \int_0^{1/2}\int_{x/3}^{3x}e^{(x+y)^2} \ dydx+\int_{1/2}^{3/2}\int_{x/3}^{2-x}e^{(x+y)^2} \ dydx = \frac{e^4-1}{4}.$$
This is the correct answer. The problem here is that I actually did not compute those two integrals myself, I entered them in Maple and for each one of them I got the answers in terms of the error function, however they canceled out luckily and I was left with the correct answer.
Can anyone help me evaluating this integral by a clever substitution so that I don't have to deal with non-elementary functions?

REPLY [2 votes]: Let use polar coordinates

$x=r \cos \theta$
$y=r \sin \theta$

with

$\theta_1=\arctan \frac13$
$\theta_2=\arctan 3$
$0\le r \le \frac{2}{\sin \theta + \cos \theta}$ (since $y+x=2 \iff r\sin \theta + r \cos \theta=2$)

thus
$$\iint_D e^{(x+y)^2} \ dxdy =\int_{\theta_1}^{\theta_2}d\theta\int_0^{\frac2{\sin \theta+\cos \theta}}re^{r^2(1+\sin 2\theta)}dr$$
we obtain
$$\int_{\theta_1}^{\theta_2}d\theta\int_0^{\frac1{\sin \theta+\cos \theta}}re^{r^2(1+\sin 2\theta)}dr=\int_{\theta_1}^{\theta_2}
\left[\frac{e^{r^2(1+\sin 2\theta)}}{2(1+\sin 2\theta)}\right]_{0}^{\frac2{\sin \theta+\cos \theta}}d\theta=\\\frac{e^4-1}2\int_{\theta_1}^{\theta_2} \frac{1}{1+\sin 2\theta} d\theta=\frac{e^4-1}2\left[ \frac{\tan \theta}{1+\tan \theta}\right]_{\theta_1}^{\theta_2}=\frac{e^4-1}2\left(\frac34-\frac14\right)=\frac{e^4-1}4$$