<s>[INST] Finding method of moments estimate for density function $f(x|\alpha) = \frac {\Gamma(2\alpha)} {\Gamma(\alpha)^2}[x(1-x)]^{\alpha - 1}$ 
Suppose that $X_1, X_2, ..., X_n$ are i.i.d random variables on the interval $[0,1]$ with the density function
$$
f(x|\alpha) = \frac {\Gamma(2\alpha)} {\Gamma(\alpha)^2}[x(1-x)]^{\alpha - 1}
$$
where $\alpha > 0$ is a parameter to be estimated from the sample. It can be shown that
\begin{align}
E(X) &= \frac 1 2 \\
\text{Var}(X) &= \frac 1 {4(2\alpha +1)}
\end{align}
How can the method of moments be used to estimate $\alpha$?

My attempt
It is clear that the first moment of $X$ is $\mu_1 = E(X) = \frac 1 2$.
The second moment of $X$ is given by
\begin{align}
\mu_2 &= E(X^2) \\
&= \text{Var}(X) + (E(X))^2 \\
&= \frac 1 {4(2\alpha + 1)} + \frac 1 4 \\
&= \frac {\alpha + 1} {2(2\alpha + 1)}
\end{align}
Thus we have the relation
$$
\alpha = \frac {1 - 2\mu_2} {4\mu_2 - 1}
$$
Using the method of moments, we obtain
\begin{align}
\hat{\alpha} &= \frac {1 - 2\hat{\mu_2}} {4\hat{\mu_2} - 1} \\
&= \frac {1 - \frac 2 n \sum_{i=1}^n X_i^2} {\frac 4 n \sum_{i=1}^n X_i^2 - 1} \\
&= \frac {n - 2 \sum_{i=1}^n X_i^2} {4 \sum_{i=1}^n X_i^2 - n}
\end{align}
Solution provided
$$
\hat{\alpha} = \frac n {8 \sum_{i=1}^n X_i^2 - 2n} - \frac 1 2
$$
Did I apply the method of moments correctly for this question? I can't seem to obtain the form as suggested in the sample solution provided. Any advice would be greatly appreciated!
 [/INST] You are right. In fact
\begin{align}
\frac n {8 \sum_{i=1}^n X_i^2 - 2n} - \frac 1 2&= \frac{2n - 8 \sum_{i=1}^n X_i^2 + 2n}{16 \sum_{i=1}^n X_i^2 - 4n}\\
&= \frac{4n - 8 \sum_{i=1}^n X_i^2}{16 \sum_{i=1}^n X_i^2 - 4n}\\
&=\frac {n - 2 \sum_{i=1}^n X_i^2} {4 \sum_{i=1}^n X_i^2 - n}\,.
\end{align}
The last equality is just a simplification by $4$.
</s>