I am working on the following exercise:
Let $(X_1,\ldots,X_n)$ be a random sample from a uniform distribution $U[0,\theta]$. Show that the estimator $$A_n = \frac{n+1}{n} \max\{X_1,\ldots,X_n\}$$ is unbiased, i.e. $E(A_n) = \theta$.
I first computed the CDF of $\max\{X_1,\ldots,X_n\}$ as
$$\prod_{i=1}^{n} P(X_i \le x) = x^n$$
and so the PDF is $nx^{n-1}$. But when I try to calculate the expected value I get:
$$E(A_n) = \frac{n+1}{n} \cdot E(\max\{X_1,\ldots,X_n\} = \frac{n+1}{n} \cdot \int_{0}^{\theta}nx^{n-1} \cdot x \ dx = \theta^{n+1}.$$
Could you tell me what I am doing wrong?