Evaluate the triple integral $\iiint (x^2+y^2+z^2)\,dx\,dy\,dz$ I have to evaluate this integral. It is enough for me to know the correct limits to integration.
$$ \iiint_W  (x^2 + y^2 + z^2) \,\mathrm dx\,\mathrm dy\,\mathrm dz$$
Conditions: 
$$x\ge 0,\quad y \ge 0 ,\quad z \ge 0,\quad 0 \le x + y + z \le a,\quad (a>0)$$
My ideas:
As I have 
$0 \le x + y + z \le a$,
I can say that $$0 \le x + y + z$$
$$x \le - z - y $$
so my limits to integration could be: 
$$\int _{ z }^{ a }{  } \int _{ -z-y }^{ y }{  } \int _{ 0 }^{ -z-y }{ (x^2 + y^ 2+ z^ 2) \,\mathrm dx\,\mathrm dy\,\mathrm dz } $$
Can somebody help/correct me?
 A: Your integral should be of the form
$$\int_{z_0}^{z_1}\int_{y_0(z)}^{y_1(z)}\int_{x_0(y,z)}^{x_1(y,z)}(x^2+y^2+z^2)\,\mathrm dx\,\mathrm dy\,\mathrm dz $$
By the conditions, we find $0\le z\le a$, and for given $z$, $0\le y\le a-z$, and for given $z$ and $y$ $0\le x\le a-y-z$. So in the end it should be 
$$\int_{0}^{a}\int_{0}^{a-z}\int_{0}^{a-z-y}(x^2+y^2+z^2)\,\mathrm dx\,\mathrm dy\,\mathrm dz $$
A: first for $x$:
$$0<x+y+z<a$$ implies $$0<x<a-y-z$$
Now x is dead :-) hence $$0<y+z<a$$ implies $$0<y<a-z$$ 
Now y is also dead hence $$0<z<a$$ therefore $$\int_0^a \int_0^{a-z}\int_0^{a-y-z}(x^2+y^2+z^2)dxdydz$$
A: *

*Your manipulation of the inequality is wrong: $0\leq x+y+z$ implies $x\geq-y-z$, not $\leq$.

*As @Hagen pointed out, you should NOT have bounds that depend on the variable of integration. Perhaps you meant to order the $d$s differently?

*Again as @Hagen pointed out in his answer, the bounds are much easier.


Here is how to find the bounds:


*

*$z\geq0$, but since all other variables are surely $z\leq a$, so $0\leq z\leq a$ for the outer integral.

*$y\geq0$, and $x+y+z\leq a$ surely implies $x+y\leq a-z$, but $x\geq0$ so you must have $y\leq a-z$.

*$x\geq0$, and $x+y+z\leq a$ equates to $x\leq a-y-z$.


So your integral becomes:
\begin{align*}
\int\limits_0^a\int\limits_0^{a-z}\int\limits_0^{a-z-y}(x^2+y^2+z^2)dxdydz={}&\int\limits_0^a\int\limits_0^{a-z}\left[(y^2+z^2)(a-z-y-0)+\frac{(a-z-y)^3}{3}\right]dydz={} \\
{}={}&\int\limits_0^a\int\limits_0^{a-z}\left[ay^2+az^2-y^2z-z^3-y^3-yz^2+\frac{(a-z-y)^3}{3}\right]dydz={} \\
{}={}&\int\limits_0^a\left[a\frac{(a-z)^3}{3}+a(a-z)z^2-\frac{(a-z)^3}{3}z-(a-z)z^3\right.-{} \\
&{}+\left.\frac{(a-z)^4}{4}-\frac{(a-z)^2}{2}z^2-\frac{(a-z-(a-z))^4}{12}+\frac{(a-z)^4}{12}\right]dydz={} \\
{}={}&-\frac{a}{12}(a-z)^4\Bigg|_0^a+\frac{a^2}{3}z^3\Bigg|_0^a-\frac{a}{4}z^4\Bigg|_0^a+\frac{z}{12}(a-z)^4\Bigg|_0^a-{} \\
&{}+\int\limits_0^a\frac{(a-z)^4}{12}dz-\frac a4z^4\Bigg|_0^a+\frac{z^5}{5}\Bigg|_0^a+\frac{(a-z)^5}{20}\Bigg|_0^a+{} \\
&{}+\frac{(a-z)^3}{6}z^2\Bigg|_0^a-\int\limits_0^a\frac{(a-z)^3}{3}zdz-\frac{(a-z)^5}{60}\Bigg|_0^a={} \\
{}={}&\frac{a^5}{12}+\frac{a^5}{3}-\frac{a^5}{4}+\overline{\frac{(a-z)^5}{60}\Bigg|_0^a}-\frac{a^5}{4}+\frac{a^5}{5}-\frac{a^5}{20}+{} \\
&{}+\frac{(a-z)^4}{12}z\Bigg|_0^a-\int\limits_0^a\frac{(a-z)^4}{12}dz-\overline{\frac{(a-z)^5}{60}\Bigg|_0^a}={} \\
{}={}&a^5\left(\frac{1}{12}+\frac13-\frac14-\frac14+\frac15-\frac{1}{20}\right)+\frac{(a-z)^5}{60}\Bigg|_0^a={} \\
{}={}&a^5\left(\frac{1}{6}-\frac{1}{10}+\frac{1}{60}\right)=\frac{a^5}{12}.
\end{align*}
I hope I didn't get lost in the calculations.
A: By symmetry, the required integral is 
$$3\int_{0}^a z^{2} \underbrace{\int\int dx\,dy}_{\mbox{area of }T} \, dz
={3\over 2}\int_{0}^a z^{2}(a-z)^2\,\,dz={a^5\over 20}.$$
Here, $T$ is the triangle $\{(x,y): x>0,\, y>0,\, x+y<a-z\}.$
