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.
Numerically 0.264241, confirmed by quadrature on every build.
Reading the triangle into bounds
The region is bounded by , and the line . Solving that line for gives the ceiling , and itself ranges over .
Split the exponential as so the constant factor comes out of the inner integral.
The outer integral, and why the constant term appears
The inner answer simplified because . That constant is the value of the integrand along the hypotenuse: every vertical slice stops on the line , and equals everywhere on it, whichever slice you are on.
Numerically . The integrand is positive throughout, and the triangle has area , so a value between and is exactly what to expect.
The mistake: integrating over the square instead of the triangle
Because splits so cleanly, it is tempting to use the product shortcut and integrate each variable from to independently.
That is the integral over the whole unit square, which has twice the area of the triangle and gives instead of . The product shortcut requires constant bounds, and is not constant.
The difference of about is the contribution of the upper triangle where , 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 outer from to and inner from to , the inner integral is and the answer is again .
How large is 1 - 2/e compared with the area of the region?
The triangle has area and the integral is about , so the average value of on the triangle is roughly . That sits sensibly between and .