I am having trouble deriving the distribution of the difference of two beta random variables and would like some help verifying the steps I have taken. In particular calculating the bounds.

Say I have $X_1\sim\text{Beta}(a_1,b_1)$ and $X_2\sim\text{Beta}(a_2,b_2)$, independent, and am interested in calculating the distribution of $X_1-X_2$. So here is what I have come up with so far:

Let $Z=X_1-X_2$ and $W=X_1$ where $0\leq X_i\leq 1$ for $i=1,2$. So $X_1=W$ and $X2 = W-Z$.

Likewise $\frac{dX_1}{dW}=1$, $\frac{dX_1}{dZ}=0$, $\frac{dX_2}{dW}=1$, and $\frac{dX_2}{dZ}=-1$. Then the determinant of the Jacobian would be $|J| = 0\times1 - (-1)\times1=1 $

Then we have that

\begin{align} f_{Z,W}(z,w) &=f_{X_1,X_2}(J_1(z,w),J_2(z,w))\times|J|\\ &=f_{X_1,X_2}(w,z-w)\\ &=f_{X_1}(w) f_{X_2}(z-w)\\ &=\text{Beta}(w;a_1,b_1)\times\text{Beta}(w-z;a_2,b_2)\\ &=\frac{(w)^{1-a_1}(1-w)^{1-b_1}}{\beta(a_1,b_1)}\times\frac{(w-z)^{1-a_2}(1-(w-z))^{1-b_2}}{\beta(a_2,b_2)} \end{align}

From there I could integrate out $W$ from $f_{Z,W}(z,w)$ to get the quantity of interest, i.e., the distribution of $Z=X_1-X_2$.

So now this is where I am stuck. I have the following:

$$f_Z(z)=\int f_{Z,W}(z,w)dw=\int \text{Beta}(w;a_1,b_1)\times\text{Beta}(w-z;a_2,b_2) dw$$

But I do not understand how to obtain the bounds for the integral, and if the integral needs to be broken into parts or not. Let me know also if any of the above steps are incorrect.