Average value of function? Find the average value of the function $f(x,y)=e^x$ over the region
$R={(x,y)|x+y=<2,x>=0,y>=0}$.
I’m having real trouble with this one and the reason is because three ranges are given and not two. How would I fit this into a double integral? I made some guesses and made both go from 0 to 2. Solving those I got $2e^2-2$ as my answer.
 A: Sketch the region $R$ and you will see that it is a triangle of height $2$ and width $2$. The function $f$ doesn't depend on $y$, so if we integrate over the region $R$ then we will be integrating a load of vertical strips (as the function $f$ is constant on each vertical line) that make up the triangle.
For instance, at the $x=0$ line, we have height $2$ on the triangle. (That is, on the line segment $x=0,0\le y\le 2$, the value of the function $f$ is a constant value, $e^0=1$, and the length of this line is $2$.) At the $x=1$ line, we have height $1$. And at $x=2$, we have height $0$ (the triangle touches the $x$-axis here).
We can see, then, that the height of the vertical line segment with $x$ co-ordinate $x_0$ ($0\le x_0\le 2$) that is contained within the triangle is $2-x_0$.
This tells us that we can find the total value over the region by integrating $(2-x)e^x$ between $0$ and $2$.
To integrate $xe^x$, you can use integration by parts.
Finally, to find the average value you need to divide by the area of the triangle.
The answer you should eventually reach is $(e^2-3)/2$.

This is a sort of "first principles" approach that doesn't explicitly use double integration, but can you see the parallel to double integration in first finding the height of the triangle to eliminate the variable $y$ ("integrating with respect to $y$") and then integrating with respect to $x$? Reverse engineering, how might we form a double integral that will yield all of the above calculations? The answer is below.

 $\int_0^2 \int_0^{2-x} e^x dy\ dx$

