PDF of the difference between two independent beta random variables

We have $0<x_1<1$ and $0<x_2<1$. Since $W=X_1$ and $X_2=W-Z$, we then have $0<w<1$ and $0<w-z<1\quad\longrightarrow\quad z<w<1+z$ after transformation. It is easy to see that these are equivalent to $w>0$, $w<1$, $z<w$, and $z>w-1$. To make it more clearly, let's plot these four inequalities

enter image description here

From $w$-axis viewpoint, the region $0<w<1$ is bounded by $z=w$ and $z=w-1$. On the other hand, from $z$-axis viewpoint, the region $-1<z<0$ is bounded by $w=1+z$ and $w=0$ and the region $0<z<1$ is bounded by $w=1$ and $w=z$. Hence, If we refer to figure above, it is seen that the marginal pdf of $W$ is given by \begin{equation} f_W(w)=\left\{ \begin{array}{l} &\displaystyle\int_{w-1}^{w}f_{W,Z}(w,z)\ dz\qquad &0<w<1\\[10pt] &0\qquad &\text{elsewhere} \end{array} \right. \end{equation} In a similar manner, the marginal pdf of $Z$ is given by \begin{equation} f_Z(z)=\left\{ \begin{array}{l} &\displaystyle\int_{0}^{1+z}f_{W,Z}(w,z)\ dw\qquad &-1<z<0\\[10pt] &\displaystyle\int_{z}^{1}f_{W,Z}(w,z)\ dw\qquad &0<z<1\\[10pt] &0\qquad &\text{elsewhere} \end{array} \right. \end{equation}