Suppose that $X$ and $Y$ are independent and $Z=X+Y$. If the probability density functions of $X$ and $Y$ are:
$f_X(x)=e^{-x}, x>0$ ($0$ if otherwise),
$f_Y(x)=1/2, 0<y<2$ ($0$ if otherwise),
What's the PDF of $X+Y$?
I know the formula but I don't quite get the domains of $X$ and $Y$. Please help, thanks!
The only thing that's tricky is that the ranges of $X$ and $Y$ are different; we can take care of that by breaking into cases.
Note that the ranges are such that $X>0$ and $Y\in(0,2)$. So, how can we make $X$ and $Y$ add up to a given value $z$?
First, consider the case where $z\leq 0$. This has density $0$. (Why?)
Next, consider the case where $Z=z$, $z\geq 2$. This happens by letting $Y$ take any value in $(0,2)$, and then using $X$ to "make up the rest". So, you could model the density for a given $z\geq2$ by $$ f_Z(z)=\int_0^2f_Y(y)f_X(z-y)\,dy. $$
Finally, consider the case where $z\in (0,2)$. In this case, we are restricted in what values of $Y$ are possible; in particular, it must be the case that $Y=y\in(0,z)$. And then once again, we use $X$ to 'make up the rest'. So, for $z\in(0,2)$, $$ f_Z(z)=\int_0^zf_Y(y)f_X(z-y)\,dy. $$