If $f (y\mid \theta)=(\theta + 1)y^\theta$, find an estimator for $θ$ by the method of moments. Let $Y_1, Y_2, . . . , Y_n$ denote a random sample from the probability density function
$$f (y \mid \theta)=\begin{cases} (\theta + 1)y^\theta, &  0 < y < 1; \theta > −1,\\ 0 ,& \text{ elsewhere }\end{cases}$$ 
Find an estimator for $\theta$ by the method of moments.
I am told that that $μ = \frac{\theta + 1}{\theta + 2} $. I am wondering how do they show this ?
 A: The motivation of the method of moments estimate is that it produces a model that has the same first $n$ raw moments as the data (as represented by the empirical distribution). Let $Y_1, Y_2, \cdots, Y_n$ be a random sample, therefore
$$
\text{E}\left[Y^n\right]=\frac{1}{n}\sum_{i=1}^n y_i^n.\tag1
$$
Let us obtain the first raw moment of the data.
$$
\overline{y}=\frac{1}{n}\sum_{i=1}^n y_i.\tag2
$$
Now, we obtain the first raw moment of the sample distribution.
$$
\begin{align}
\mu&=\text{E}[Y]\\
&=\int_{y=0}^1 yf(y|\theta)\ dy\\
&=\int_{y=0}^1 y(\theta+1)y^\theta\ dy\\
&=(\theta+1)\int_{y=0}^1 y^{\theta+1}\ dy\\
&=(\theta+1)\cdot\left.\frac{y^{\theta+2}}{\theta+2}\right|_{y=0}^1\\
&=\frac{\theta+1}{\theta+2}.\tag3
\end{align}
$$
Thus, based on $(1)$, from $(2)$ and $(3)$ we obtain
$$
\begin{align}
\frac{\hat{\theta}+1}{\hat{\theta}+2}&=\overline{y}\\
\hat{\theta}+1&=\overline{y}(\hat{\theta}+2)\\
\hat{\theta}+1&=\overline{y}\hat{\theta}+2\overline{y}\\
\hat{\theta}-\overline{y}\hat{\theta}&=2\overline{y}-1\\
\hat{\theta}(1-\overline{y})&=2\overline{y}-1\\
\hat{\theta}&=\frac{2\overline{y}-1}{1-\overline{y}}\\
&=-\frac{2\overline{y}-1}{\overline{y}-1}.
\end{align}
$$
$$\\$$

$$\Large\color{blue}{\text{# }\mathbb{Q.E.D.}\text{ #}}$$
A: For the method of moments, you want to estimate the parameter $\theta$ as a function of the sample mean, $\bar{y}$. 
Begin by finding the expected value $\mu = \int_0^1y*(\theta +1)*y^{\theta}dy = \int_0^1(\theta +1)*y^{\theta+1}dy = \frac{\theta +1}{\theta +2}*(y^{\theta+2}|_0^1 = \frac{\theta+1}{\theta +2}$. 
Now replace $\mu$ with the sample mean, $\bar{y} = \frac{1}{n}\sum_{i=1}^nY_i$: $\bar{y} = \frac{\theta+1}{\theta +2}$. 
Now solve $\theta$ in terms of $\bar{y}$: $\hat{\theta} = \frac{1-2\bar{y}}{\bar{y}-1}$
