# Changing order of integration for the triple integral $\int_{0}^{1}dx\int_{0}^{1-x}dy\int_{0}^{x+y}f(x,y,z)dz$

In questions about changing the order of integration for triple integrals on this website, I see most answers (like this one) give as a rule of thumb, that the outermost variable in the new order should be in the maximal domain. That is, its minimum value should be the smallest, and its maximum value should be the largest, given the limits of the other two variables in the old order.

But I have an integral where this rule isn't so clear:

I should change this integral: $$\int_{0}^{1}dx\int_{0}^{1-x}dy\int_{0}^{x+y}f(x,y,z)dz$$

to this integral:

$$\int dz\int dx\int f(x,y,z)dy$$

with matching limits of integration.

Since $z$ is the outermost variable in the new order, let's start with finding its maximal domain.

There are two options.

1. Since $0\leq z\leq x+y$ and $0\leq y\leq 1-x$, we have $x\leq y+x \leq 1$ so $0\leq z \leq 1$.

2. Since $0\leq x\leq 1$ and $0\leq y\leq 1-x$, we have $0\leq y\leq 1$ and so $0\leq z\leq 2$.

I think option $1$ is correct, since we are interested in the maximal value of $x+y$, which is given by $1$ in the corresponding inequality.

Now, next: I need to find the limits of integration of $x$. Given a constant $z$, we get $z-y\leq x\leq 1-y$ (by the two relevant inequalities). But we want only $z$ to be in this inequality. So we have $z-x \leq y\leq 1-x$, and plugging that in gives $z+x-1 \leq x \leq 1+x-z$, which gives $z-1\leq 0\leq 1-z$, and $x$ is eliminated.

How do I get around that? (without having to draw the domain)

Any hint, tip or general approach would be greatly apreciated.

If you draw the domain (you should !), you'll see that it's a pyramid of edge $O$ with base the rectangle $x+y=1$, $0\le x\le 1$, $0\le z\le 1$.
So your bounds should be : $$\int_0^1 dz \int_0^1 dx \int_{\max(z-x,0)}^{1-x} f(x,y,z) dy$$ Hope I got it right.