We are given two Independent Identically Distributed random variables $X$ and $Y$ where $X,Y$~$U(0,1)$. Letting $Z=X+Y$ , we need to find the distribution of $Z$.
The text I am reading goes as follows :
$f_Z(z)=\int_{- \infty}^{\infty}f_X(x)f_Y(z-x)dx = \int_{- \infty}^{\infty}I_{(0,1)}(x)I_{(0,1)}(z-x)dx$
=> $\int_{- \infty}^{\infty}(I_{(0,z)}(x)I_{(0,1)}(z)+I_{(z-1,1)}(x)I_{[1,2)}(z))dx$
I have no idea what happened there in the third step. Also , if $X$~$U(0,1)$ , then why the integration limits of $X$ are taken from $- \infty$ to $\infty$ ? Can anyone explain ?