volume of the region in the first octant bounded by the coordinate planes and the planes The problem requires me to find the volume of the region in the first octant bounded by the coordinate planes and the planes $x+z=1$, $y+2z=2$, and here is my setup:
$$
\begin{aligned}
&\phantom{\implies}x+z=1\\
&\implies z=1-x\\
\end{aligned}
$$
$$
\begin{aligned}
&\phantom{\implies}y+2z=2\\
&\implies y=2-2z=2-2(1-x)=2x\\
\end{aligned}
$$
But the solution in the notes is as follows:
$$
\begin{aligned}
V&=\int_0^1\int_0^{1-x}\int_0^{2-2x}dydzdx\\
&=\int_0^1\int_0^{1-x}\left[y\right]_0^{2-2x}dzdx\\
&=\int_0^1\int_0^{1-x}(2-2x)-(0)dzdx\\
&=\int_0^1\int_0^{1-x}2-2xdzdx\\
&=\int_0^1(2-2x)\left[z\right]_0^{1-x}dx\\
&=\int_0^1(2-2x)[(1-x)-(0)]dx\\
&=\int_0^1(2-2x)(1-x)dx\\
&=\int_0^12x^2-4x+2dx\\
&=\left[\frac{2}{3}x^3-\frac{4}{2}x^2+2x\right]_0^1\\
&=\left[\frac{2}{3}(1)^3-\frac{4}{2}(1)^2+2(1)\right]-\left[\frac{2}{3}(0)^3-\frac{4}{2}(0)^2+2(0)\right]\\
&=\frac{2}{3}\\
\end{aligned}
$$
So I wonder where the upper limit of $y$, which is $2-2x$, comes from.
 A: The region is given by the inequalities $x,y,z\geq 0$, $x+z\leq 1,y+2z\leq 2$. It is pyramid with a rectangular base of sides $1$ and $2$, which lays in the $xy$-plane, and of height $1$ because the apex is at $(0,0,1)$. By elementary geometry the volume of this pyramid is $V=\frac{B\cdot h}{3}=\frac{(1\cdot 2)\cdot 1}{3}=\frac{2}{3}$.
Such volume can be evaluated also as an iterated integral in at least two different ways:

*

*The slices are perpendicular to the $z$-axis: $z\in [0,1]$, $(x,y)\in [0,1-z]\times [0,2-2z]$,
$$\begin{aligned}
V&=\int_{z=0}^1\int_{x=0}^{1-z}\int_{y=0}^{2-2z}dydxdz\\
&=\int_{0}^1(1-z)(2-2z)\,dz=2\int_{z=0}^1(1-z)^2\,dz\\
&=2\int_{t=0}^1t^2 dt=2\Big[\frac{t^2}{3}\Big]_0^1=\frac{2}{3}.
\end{aligned}
$$


*The slices are perpendicular to the $x$-axis: $x\in [0,1]$, $z\in [0,1-x]$, and $y\in [0,2-2z]$,
$$\begin{aligned}
V&=\int_{x=0}^1\int_{z=0}^{1-x}\int_{y=0}^{2-2z}dydzdx\\
&=\int_{x=0}^1\int_{z=0}^{1-x}(2-2z)dzdx\\
&=\int_{x=0}^1(2(1-x)-(1-x)^2)dx\\
&=\int_{t=0}^1(2t-t^2)dt=\Big[t^2-\frac{t^2}{3}\Big]_0^1=\frac{2}{3}.
\end{aligned}
$$
