Multivariable calculus

Double Integral of exp(-x-y) Over a Triangle

The double integral of e to the power minus x minus y over the triangle with vertices at the origin, (1,0) and (0,1) equals 1 - 2/e, about 0.2642. The inner integral in y runs from 0 to 1 - x and gives e to the minus x, minus 1/e, which then integrates to the answer.

f(x,y)=exyf(x,y) = e^{-x-y}
12e1 - \dfrac{2}{e}

Numerically 0.264241, confirmed by quadrature on every build.

Reading the triangle into bounds

The region is bounded by x=0x = 0, y=0y = 0 and the line x+y=1x + y = 1. Solving that line for yy gives the ceiling y=1xy = 1 - x, and xx itself ranges over [0,1][0,1].

DexydA=01 ⁣ ⁣01xexydydx\iint_{D} e^{-x-y}\,dA = \int_{0}^{1}\!\!\int_{0}^{1-x} e^{-x-y}\,dy\,dx

Split the exponential as exeye^{-x}e^{-y} so the constant factor comes out of the inner integral.

01xexeydy=ex[ey]01x=ex(1ex1)=exe1\int_{0}^{1-x} e^{-x}e^{-y}\,dy = e^{-x}\Big[-e^{-y}\Big]_{0}^{1-x} = e^{-x}\left(1 - e^{x-1}\right) = e^{-x} - e^{-1}

The outer integral, and why the constant term appears

The inner answer simplified because exex1=e1e^{-x} \cdot e^{x-1} = e^{-1}. That constant is the value of the integrand along the hypotenuse: every vertical slice stops on the line x+y=1x + y = 1, and exye^{-x-y} equals e1e^{-1} everywhere on it, whichever slice you are on.

01(exe1)dx=[ex]01e1=(1e1)e1=12e\int_{0}^{1}\left(e^{-x} - e^{-1}\right)\,dx = \Big[-e^{-x}\Big]_{0}^{1} - e^{-1} = \left(1 - e^{-1}\right) - e^{-1} = 1 - \frac{2}{e}

Numerically 12/e0.26421 - 2/e \approx 0.2642. The integrand is positive throughout, and the triangle has area 1/21/2, so a value between 00 and 1/21/2 is exactly what to expect.

The mistake: integrating over the square instead of the triangle

Because exye^{-x-y} splits so cleanly, it is tempting to use the product shortcut and integrate each variable from 00 to 11 independently.

(01exdx)(01eydy)=(1e1)20.3996\left(\int_{0}^{1} e^{-x}\,dx\right)\left(\int_{0}^{1} e^{-y}\,dy\right) = \left(1 - e^{-1}\right)^{2} \approx 0.3996

That is the integral over the whole unit square, which has twice the area of the triangle and gives 0.39960.3996 instead of 0.26420.2642. The product shortcut requires constant bounds, and y=1xy = 1-x is not constant.

The difference of about 0.13530.1353 is the contribution of the upper triangle where x+y>1x + y > 1, which the correct setup excludes.

Frequently asked questions

Would integrating in the other order be harder?

No, and by symmetry it gives the same expression. With yy outer from 00 to 11 and xx inner from 00 to 1y1-y, the inner integral is eye1e^{-y} - e^{-1} and the answer is again 12/e1 - 2/e.

How large is 1 - 2/e compared with the area of the region?

The triangle has area 0.50.5 and the integral is about 0.26420.2642, so the average value of exye^{-x-y} on the triangle is roughly 0.5280.528. That sits sensibly between e10.368e^{-1} \approx 0.368 and 11.