In a particular task I am given, I have to compute the Bayes estimator of $Bernoulli(\theta$) random variables $X_1, ..., X_n$. As a prior distribution $p(\theta)$, I have to assume a $Beta(\alpha, \beta)$ distribution. When I multiply the likelihood function with the prior distribution and simplify the term by dropping the proportional constants, I get:
$$ p(\theta \vert x_1, ... , x_n )= \theta^{Y+\alpha -1 } (1- \theta)^{n-Y + \beta - 1} $$ where $Y = \sum_i X_i $. Now in the "standard procdedure", the next step is to calculate the expected value of this term, in other words $\mathbf{E}(\theta \vert x_1, ... , x_n$ ), correct?
So if I do that, I get:
$$\mathbf{E}(\theta \vert x_1, ... , x_n ) = \int_0^{\infty} \theta \cdot \theta^{Y+\alpha -1 } (1- \theta)^{n-Y + \beta - 1} \text{d}\theta= \int_0^{\infty} \theta^{Y+\alpha } (1- \theta)^{n-Y + \beta - 1} \text{d}\theta $$
But when I compute this last integral (just using the "standard integration rule" for polynoms), this thing converges to infinity which would imply that the expected value doesn't exist.
Where am I wrong?
Additional question:
In particular, it is given that
$$ p(\theta \vert x_1, ... , x_n )= \theta^{Y+\alpha -1 } (1- \theta)^{n-Y + \beta - 1} \sim Beta(Y + \alpha, n - Y + \beta)$$
Why is that true? I clearly see the point that the $\theta \cdot (1-\theta)$ part shows similarities and could be written like that, but why can we just drop the constant part (why can we just drop $\frac{\Gamma(\alpha + \beta)}{\Gamma(\alpha) \Gamma(\beta)}$)?
Edit: I want to add a side question to this, since I realised that I actually have not fully understood the thing:
From the comments I now know that $$ c \cdot p(\theta \vert x_1, ... , x_n )= \theta^{Y+\alpha -1 } (1- \theta)^{n-Y + \beta - 1} \sim Beta(Y + \alpha, n - Y + \beta)$$ where c is a constant so that $p(\theta \vert x_1, ... , x_n )$ fulfills the requirements of a pdf. Now we know that the expected value of a $Beta(\alpha, \beta)$ distribution is $E(z) = \frac{\alpha}{\alpha + \beta}$. Now in the solution to this exercise, they continue by just estimating \theta as follows:
$\hat{\theta} = \frac{Y+ \alpha}{(Y + \alpha) + (n-Y+\beta)}$
Why is that true? Don't we have to multiply this by the constant? So isn't it $\hat{\theta} = c \cdot (\frac{Y+ \alpha}{(Y + \alpha) + (n-Y+\beta)})$ (by the rule of extracting factors before the expected value)?