Solving an integral where the bounds are max and min functions

integrationprobability

I'm trying to solve Problem 1.13 in An intermediate Course in Probability, 2nd Ed. (Gut, 2009):

Let $X$ and $Y$ have a joint density function given by

$$
f_{X,Y} (x, y) = \begin{cases}
1, & \text{for } 0 \le x \le 2, \text{max}(0, x − 1) \le y \le \text{min}(1, x),\\
0, & \text{otherwise.}
\end{cases}
$$

Determine the marginal density functions and the joint and marginal distribution functions.

Earlier in the chapter, Gut shows us how to find these marginal density functions $f_X(x)$ and $f_Y(y)$:

$$
f_X(x) = \int_{-\infty}^{\infty}f_{X,Y}(x,y)dy\\
f_Y(y) = \int_{-\infty}^{\infty}f_{X,Y}(x,y)dx
$$

So in this case we have

$$
\begin{split}
f_X(x) &= \int_{-\infty}^{\infty}f_{X,Y}(x,y)dy\\
&= \int_{\text{max}(0,x-1)}^{\text{min}(1,x)}1dy\\
\end{split}
$$

This is where I'm stuck. How do I solve this integral?

Best Answer

$\min(1,x)=1$ if $x\geqslant 1$ and $x$ if $x\leqslant 1$, $\max(0,x-1)=0$ if $x\leqslant 1$ and $x-1$ if $x\geqslant 1$. Calculate the integral when $x\geqslant 1$ first and then when $x\leqslant 1$. You can also say that $\int_a^b{1dy}=b-a$ for all $(a,b)\in\mathbb{R}^2$