Evaluating a Triple integral where one bound is a function of two variables

We have $$\min(8 - x - y,3) = \begin{cases} 8-x-y & \text{if } x+y\ge5, \\ 3 & \text{if } x+y \le 5. \end{cases}$$ when the triangle $x+y \leq 5 $ contains some points out of the rectangle, to fix this we have to split it into two parts: $1\leq y \leq 3 $ when $1\leq x \leq 2$ and $1 \leq y \leq 5-x$ when $2\leq x \leq 3$ So:

$$\int_1^3 \int_1^3 \displaystyle \int_1^{\min(8-x-y,3)} 2\,dz\,dy\,dx \qquad= \int_1^2 \int_1^3 \int_1^3 2\,dz\,dy\,dx \qquad + \int_2^3 \int_1^{5-x} \int_1^3 2\,dz\,dy\,dx +\int_2^3 \int_{5-x}^3 \int_1^{8-x-y} 2\,dz\,dy\,dx \qquad $$ I think that you can take it from here.


Draw a picture of the rectangle $1\leq x\leq 3, 1\leq y\leq 3$ and of the boundary line $8-x-y=3 \Leftrightarrow y=5-x$. Notice that below the line (and staying in the rectangle) $\min(8-x-y,3)=3$ and above the line in the rectangle $\min(8-x-y,3)=8-x-y$. Also notice that $\min(8-x-y,3)=3$ in the rectangle $1\leq x\leq 2,1\leq y\leq 3$. So, we can split it up as: $$\int_1^2\int_1^3\int_1^32\,\mathrm{d}z\,\mathrm{d}y\,\mathrm{d}x+\int_2^3\int_1^{5-x}\int_1^32\,\mathrm{d}z\,\mathrm{d}y\,\mathrm{d}x+\int_2^3\int_{5-x}^3\int_1^{8-x-y}2\,\mathrm{d}z\,\mathrm{d}y\,\mathrm{d}x $$