Q:

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$$

