How do I solve a double integral with an absolute value? Given the following integral
$$\int_{y=0}^1 \int_{x=0}^1|x-y|(6x^2y) \, dx \, dy$$
how do I change the limits of integration?
According to my textbook, it is
$$\int_{y=0}^1 \int_{x=y}^{1}(x-y)(6x^2y) \, dx \, dy +\int_{y=0}^1 \int_{x=0}^y (y-x)(6x^2y)\,dx\,dy$$
How did the textbook get the new limits of integration? Can someone explain to me he steps I should use?
 A: By exchanging the $x$-variable and the $y$-variable:
$$\iint_{(0,1)^2}|x-y|x^2 y\,dx\,dy = \iint_{(0,1)^2}|x-y|y^2 x\,dx\,dy$$
hence we just need to compute:
$$\begin{eqnarray*}I&=&3\iint_{(0,1)^2}|x-y|xy(x+y)\,dx\,dy = 6\int_{0}^{1}\int_{0}^{x}xy(x^2-y^2)\,dy\,dx\\&=&6\int_{0}^{1}x^5\int_{0}^{1}z(1-z^2)\,dz\,dx=6\cdot\frac{1}{6}\cdot\frac{1}{4}=\color{red}{\frac{1}{4}}.\end{eqnarray*}$$
A: Take the x integral for fixed $y$:
$$\int_{x=0}^{1}|x-y|(6x^2y)dx = \int_{x=0}^{y}|x-y|(6x^2y)dx + \int_{x=y}^{1}|x-y|(6x^2y)dx$$
$$=\int_{x=0}^{y}(y-x)(6x^2y)dx + \int_{x=y}^{1}(x-y)(6x^2y)dx$$
A: Think of it like this, you are giving a two dimensional input in $~xy~$ plane (if you visualize total input area is a square of side $~1~$) and getting output of your function assume $~z=f(x)~$ on $~z~$ axis.
We have to calculate the total volume. 
Small volume is $~(z~dx~dy )~$. 
Now mod is over $~x-y~$ so draw its graph on our input $~xy~$ plane it divides in two area if $~x-y<0~$ then mod opens with negative sign and $~x-y >0~$ then it opens directly. 
Now you divide your integration in two parts and simply put limit like you do in simple double integral. 
Hope it helped.
