Integrating $\int_0^1 \int_0^1 |x-y|\,\text{d}x\,\text{d}y$ by hand

calculusgeometric-probabilityintegrationmultivariable-calculusprobability

Here's a problem from my probability textbook:

If two points be taken at random on a finite straight line their average distance apart will be one third of the line.

What I did: I got the integral$${{\int_0^1 \int_0^1 |x-y|\,\text{d}x\,\text{d}y}\over{1^2}},$$which ends up evaluating to ${1\over3}$ according to Wolfram Alpha. However, I am not sure how to evaluate the integral by hand, given that there's the absolute value sign. Any help would be appreciated.

Best Answer

Hint $:$ $$\begin{align*}\int_{0}^{1}\int_{0}^{1} |x - y|\ dx\ dy & = \int_{0}^{1}\int_{0}^{y} (y - x) \ dx\ dy + \int_{0}^{1}\int_{y}^{1} (x - y)\ dx\ dy. \end{align*}$$