How to compute these probabilities using integrals? I am given a joint probability density function for X, Y, defined as $f(x, y) = 1,$ for $0 \leq x \leq 1, 0 \leq y \leq 1,$ and $0$ elsewhere. I need to find $P(X-Y \leq \frac{1}{2})$, $P(XY \leq \frac{1}{4}),$ and $P(X^2 + Y^2 \leq 1).$ I solved these using the geometric approach for uniform distributions, but can someone show how to do this with double integrals? I tried, but kept messing up the limits of the integration.
 A: If $x$ and $y$ are positive, then $xy\le 1/4$ is the same as $x \le 1/(4y)$.  We also need $x\le 1$, so $x \le 1\text{ or }1/(4y)\text{, whichever is less}$.  Now $1/(4y)\le 1$ precisely if $y\ge1/4$.  So if $y$ is between $0$ and $1/4$, then $x$ goes from $0$ to $1$, but if $y$ is between $1/4$ and $1$, then $x$ goes from $0$ to $1/(4y)$.  So inside of $\displaystyle\int_0^{1/4}\cdots dy$, where the "$\cdots$" appears, put $\displaystyle\int_0^1 1\;dx$.  Then to that you add $\displaystyle\int_{1/4}^1\cdots dy$, and inside that you have $\displaystyle\int_0^{1/(4y)} 1\;dx$.
If $x,y\ge0$ then $x^2+y^x \le 1$ is the same as $y\le \sqrt{1-x^2}$, so inside the integral $\displaystyle\int_0^1 \cdots dx$ you can put $\displaystyle\int_0^\sqrt{1-x^2} 1\;dy$.
If $x,y\ge0$ and $\le 1$, then $x-y \le 1/2$ can be viewed like this: for $x$ between $0$ and $1/2$, $y$ goes all the way from $0$ to $1$, but for $x$ between $1/2$ and $1$, $y$ goes from $x-1/2$ to $1$.  So inside of $\displaystyle \int_0^{1/2}\cdots dx$ you have $\displaystyle\int_0^1 1\; dy$, and to that you add $\displaystyle\int_{1/2}^1 \cdots dx$, and inside it you have $\displaystyle\int_{x-1/2}^1 1\;dy$.
A: Just one:
$$
\mathrm P(XY\leqslant1/4)=\int\limits_0^{1/4}\int\limits_0^1\mathrm dy\ \mathrm d x+\int\limits_{1/4}^1\int\limits_0^{1/(4x)}\mathrm dy\ \mathrm d x=\int\limits_0^{1/4}\mathrm d x+\int\limits_{1/4}^1\frac{\mathrm d x}{4x}=\left[x\right]_{x=0}^{x=1/4}+\frac14\left[\log x\right]_{x=1/4}^{x=1},
$$
hence
$\mathrm P(XY\leqslant\frac14)=\frac14-\frac14\log\frac14=\frac14+\frac12\log2$.
The other answers are $\mathrm P(X-Y\leqslant\frac12)=\frac78$ (thanks to a similar decomposition into two integrals, one over $x\leqslant\frac12$ and the other over $x\geqslant\frac12$) and $\mathrm P(X^2+Y^2\leqslant1)=\frac\pi4$ (no decomposition).
