Integral over $0\leq x,y,z\leq 1$ and $x+y+z\leq 2$ What is
$$\int_{S}(x+y+z)dS,$$ where $S$ is the region $0\leq x,y,z\leq 1$ and $x+y+z\leq 2$?
We can change the region to $0\leq x,y,z\leq 1$ and $x+y+z\geq 2$, because the total of the two integrals is just
$$\int_0^1\int_0^1\int_0^1(x+y+z)dxdydz=3\int_0^1xdxdydz=\frac{3}{2}.$$
Now, can we write the new integral as
$$\int_0^1\int_{\min(2-x,1)}^1\int_{\min(2-x-y,1)}^1(x+y+z)dzdydx?$$ This gets more involved since we have to divide into cases whether $2-x-y\leq 1$ or $\geq 1$. Is there a simpler way?
 A: You could write
\begin{equation}
\int_S x \, dx dy dz = \int_0^1 \left( \int_{y+z \leq 2-x; \, 0\leq y,z \leq 1} dy dz \right) x dx
\end{equation}
Now, you can interpret $y+z \leq 2-x$ with $y,z \geq 0$ as a triangle in the plane, whose area is $\frac{(2-x)^2}{2}$. 
From this triangle, you subtract two smaller triangles to account for the fact that $0 \leq y,z \leq 1$.
You can write the area of these smaller triangles as $2\times \frac{(2-x-1)^2}{2} = (1-x)^2$.
In total, we have
\begin{equation}
\int_{y+z \leq 2-x; \, 0\leq y,z \leq 1} dy dz = \frac{(2-x)^2}{2} - (1-x)^2 = 1 - \frac{x^2}{2}
\end{equation}
So in total,
\begin{equation}
\int_0^1 x \left(1 - \frac{x^2}{2} \right) dy dz = \frac{3}{8}
\end{equation}
You have three of those integrals, so $\int_S x+y+z \, dx dx dz = \frac{9}{8}$.
A: You already have made two good moves: (i) replacing $S$ by the pyramidal region $S':=[0,1]^3\setminus S$, and (ii) replacing the integrand by $3x$. The integral  in question then comes to
$$Q:=\int_S (x+y+z)\>{\rm d}(x,y,z)={3\over2}-3\int_{S'}x\>{\rm d}(x,y,z)\ .$$
From a figure we read off that
$$\eqalign{\int_{S'}x\>{\rm d}(x,y,z)&=\int_0^1 x\int_{1-x}^1 \int_{2-x-y}^1 \>dz\>dy\>dx\cr &=\int_0^1 x \int_{1-x}^1 (x+y-1)\>dy\>dx\cr  &=\int_0^1 x\cdot{x^2\over2}\>dx={1\over8}\ .\cr}$$
It follows that
$$Q={3\over2}-{3\over8}={9\over8}\ .$$
