If $X_1,X_2$ are independent beta then show $\sqrt{X_1X_2}$ is also beta Here is a problem that came in a semester exam in our university few years back which I am struggling to solve.

If $X_1,X_2$ are independent $\beta$ random variables with densities $\beta(n_1,n_2)$ and $\beta(n_1+\dfrac{1}{2},n_2)$ respectively then show that $\sqrt{X_1X_2}$ follows $\beta(2n_1,2n_2)$.

I used the Jacobian method to obtain that the density of $Y=\sqrt{X_1X_2}$ is as follows:
$$f_Y(y)=\dfrac{4y^{2n_1}}{B(n_1,n_2)B(n_1+\dfrac{1}{2},n_2)}\int_y^1\dfrac{1}{x^2}(1-x^2)^{n_2-1}(1-\dfrac{y^2}{x^2})^{n_2-1}dx$$
I am lost at this point actually. Now, in the main paper, I found a hint had been supplied. I tried to use the hint but could not obtain the desired expressions. The hint is verbatim as follows:

Hint: Derive a formula for the density of $Y=\sqrt{X_1X_2}$ in terms of the given densities of $X_1$ and $X_2$ and try to use a change of variable with $z=\dfrac{y^2}{x}$.

So at this point, I try to make use of this hint by considering this change of variable. Hence I get, $$f_Y(y)=\dfrac{4y^{2n_1}}{B(n_1,n_2)B(n_1+\dfrac{1}{2},n_2)}\int_{y^2}^y\dfrac{z^2}{y^4}(1-\dfrac{y^4}{z^2})^{n_2-1}(1-y^2.\dfrac{z^2}{y^4})^{n_2-1}\dfrac{y^2}{z^2}dz$$which after simplification turns out to be (writing $x$ for $z$)$$f_Y(y)=\dfrac{4y^{2n_1}}{B(n_1,n_2)B(n_1+\dfrac{1}{2},n_2)}\int_{y^2}^y\dfrac{1}{y^2}(1-\dfrac{y^4}{x^2})^{n_2-1}(1-\dfrac{x^2}{y^2})^{n_2-1}dx$$
I do not really know how to proceed. I am not even sure that I am interpreting the hint properly. Anyway, here goes the rest of the hint:

Observe that by using the change of variable $z=\dfrac{y^2}{x}$, the required density can be expressed in two ways to get by averaging $$f_Y(y)=constant.y^{2n_1-1}\int_{y^2}^1(1-\dfrac{y^2}{x})^{n_2-1}(1-x)^{n_2-1}(1+\dfrac{y}{x})\dfrac{1}{\sqrt{x}}dx$$Now divide the range of integration into $(y^2,y)$ and $(y,1)$ and write $(1-\dfrac{y^2}{x})(1-x)=(1-y)^2-(\dfrac{y}{\sqrt{x}}-\sqrt{x})^2$ and proceed with $u=\dfrac{y}{\sqrt{x}}-\sqrt{x}$.

Well, honestly, I cannot understand how one can use these hints: it seems I am getting nowhere. Help is appreciated. Thanks in advance.
 A: I would prove this in a different manner, using moment-generating functions. Or equivalently, by showing that the $q$th moment of $\sqrt{X_1X_2}$ is equal to the $q$th moment of a random variable $B$ with $\beta(2n_1,2n_2)$ distribution. If this is so for all $q=1,2,\ldots$, then by the strength of the moment problem, the exercise is proven.
For the last part, we obtain from http://en.wikipedia.org/wiki/Beta_distribution#Other_moments
that the $q$th moment of $B$ is
$$
 \mathrm{E}[B^q] = \prod_{j=0}^{q-1} \frac{2n_1+j}{2n_1+2n_2+j} = \ldots = \frac{\Gamma(2n_1+q)\Gamma(2n_1+2n_2)}{\Gamma(2n_1)\Gamma(2n_1+2n_2+q)}
$$
Now for the first part:
$$
\mathrm{E}[(\sqrt{X_1X_2})^q] = \int\int (\sqrt{x_1x_2})^q f_{X_1}(x_1) f_{X_2}(x_2) dx_1dx_2 \\
= \int x^{q/2} f_{X_1}(x_1) d x_1 \cdot \int x_2^{q/2} f_{X_2}(x_2) d x_2\\
= \frac{1}{B(n_1,n_2)} \int x_1^{n_1+q/2-1}(1-x_1)^{n_2-1}dx_1 \cdot \frac{1}{B(n_1+\frac{1}{2},n_2)} \int x_2^{n_1+\frac{q+1}{2}-1}(1-x_2)^{n_2-1}dx_2\\
= \frac{B(n_1+\frac{q}{2},n_2)B(n_1+\frac{q+1}{2},n_2)}{B(n_1,n_2)B(n_1+\frac{1}{2},n_2)}
$$
Now all that remains is to apply the definition $B(\alpha,\beta)=\frac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha+\beta)}$ and then the doubling formula $\Gamma(\alpha)\Gamma(\alpha+\frac{1}{2})=2^{1-2\alpha}\sqrt{\pi}\Gamma(2\alpha)$. It then turns out that the first part and the second part are exactly the same.
