Let $x_1$ and $x_2$ be independent uniform variables from [0, 2]. What is the probability that $|x_1-x_2| \leq 1$? What I have so far for the solution
Since they are both continuous uniform variables. And because they are independent, we can say that
$$f(x_1, x_2)=\frac{1}{4}$$
$$P(|x_1-x_2| \leq 1) = P(x_1-1 \leq x_2 \leq x_1+1)$$
$$P(x_1-1 \leq x_2 \leq x_1+1) = \int_{-\infty}^{+\infty} \int_{x_1 - 1}^{x_1 + 1}\frac{1}{4}dx_2dx_1$$
What I am having trouble with
However, when I compute the aforementioned integral, I get a probability of $1$ or $100\%$
$$\int_{-\infty}^{+\infty} \int_{x_1 - 1}^{x_1 + 1}\frac{1}{4}dx_2dx_1 = \int_{0}^{2} \int_{x_1 - 1}^{x_1 + 1}\frac{1}{4}dx_2dx_1 = 1$$
I know that I am supposed to get $\frac{3}{4}$. But I have no idea how.
 A: In cases like this, when dealing with integration over a restricted range of a multivariate function, it helps to plot the domain of integration:
                        

From this plot we can see how to break down the integral:
$$\begin{equation} \begin{aligned}
\iint \limits_{\begin{matrix} |x_1-x_2| \leqslant 1 \\ 0 \leqslant x_1 \leqslant 2 \\ 0 \leqslant x_2 \leqslant 2 \end{matrix}} f(x_1,x_2) \ dx_1 \ dx_2 
&= \int \limits_0^2 \int \limits_{\max (0, x_1-1)}^{\min (2, x_1+1)} f(x_1,x_2) \ dx_2 \ dx_1  \\[6pt]
&= \int \limits_0^1 \int \limits_0^{x_1+1} f(x_1,x_2) \ dx_2 \ dx_1 + \int \limits_1^2 \int \limits_{x_1-1}^2 f(x_1,x_2) \ dx_2 \ dx_1. \\[6pt]
\end{aligned} \end{equation}$$
A: In addition to the condition $x_1-1 \leq x_2 \leq x_1+1$ you have to remember that $x_2$ has to lie between $0$ and $2$. For example, if $x_1 <1$ then $x_1-1 <0$ so the integral w.r.t. $x_2$ cannot start from the negative number $x_1-1$. 
If $x_1 <1$ then the integral w.r.t. $x_2$ starts from $0$ and if $x_1 >1$ then the integal ends at $2$. So split the integral into two parts depending on whether $x_1 <1$ or $>1$. 
So you have to compute $\int_0^{1} \int_0^{x_1+1} \frac 1 4 dx_2dx_1+\int_1^{2} \int_{x_1-1}^{2} \frac 1 4 dx_2dx_1$. 
