Posterior calculation on binomial distribution using quadratic loss function Que
Let x be a binomial variate with parameters n and p (0<p<1). using a quadratic error loss function and a priori distribution of p as $ \pi(p) $ = 1, obtain the bayes' estimate for p.
Hey lately I have been teaching myself  bayes estimator( in relation to statistical inference) ,
$ f(x| p ) = \ C^{n}_{x} \ p^x \ (1-p)^{n-x } $
Since prior distribution is 1
So joint distribution of x, p
f(x,p) = $ \ C^{n}_{x} \ p^x \ (1-p)^{n-x } $ only
Now posterior distribution is directly proportional to joint distribution of x and p
f(p|x) $  \propto \ C^{n}_{x} \ p^x \ (1-p)^{n-x } $
f(p|x) $  \propto  \ p^x \ (1-p)^{n-x } $
f(p|x) $  \propto  \ p^{x+1-1} \ (1-p)^{n-x+1-1 } $
f(p|x) $  \ ~  \beta({x+1, n-x+1 )} $
As we know Expected value of posterior distribution is
E(f(p|x)) $  \ =  \frac{x+1}{ n+2 } $
Now can someone help in calculating bayes risk using quadratic loss function  , because I have no idea on how to proceed .

The quadratic posterior Bayes Risk can be written as
$$\mathbb{E}_{\pi(p|x)}[L(\hat{p}-p)]=\int_{0}^{1}L(\hat{p}-p)\pi(p|x)dp$$
and the goal is to minimize this risk with respect to the estimator $\hat{p}$.
First, look that $\mathbb{E}_{\pi(p|x)}[L(\hat{p}-p)]= \int_{0}^{1}(\hat{p}-p)^{2}\frac{p^{x+1-1}(1-p)^{n-x+1-1}}{Beta(x+1,n-x+1}dp$
Som you take the derivative with respect to $\hat{p}$
$\frac{d\mathbb{E}_{\pi(p|x)}[L(\hat{p}-p)]}{d\hat{p}}=\int_{0}^{1}2(\hat{p}-p)\frac{p^{x+1-1}(1-p)^{n-x+1-1}}{Beta(x+1,n-x+1)}dp = \frac{2}{Beta(x+1,n-x+1)}\big[\hat{p}\int_{0}^{1}p^{x+1-1}(1-p)^{n-x+1-1}dp -\int_{0}^{1}p^{x+2-1}(1-p)^{n-x+1-1}dp\big]$
$=\frac{2}{Beta(x+1,n-x+1)} \big[\hat{p}Beta(x+1,n-x+1)-Beta(x+2,n-x+1)\big] =0 $
In order for this quantity to be zero, what's inside the brackets should be zero.
$\hat{p} = \frac{Beta(x+2,n-x+1)}{Beta(x+1,n-x+1)} = \frac{x+1}{n+2}$
