The probability p of an event is supposed to have a prior distribution

Beta(a,B) so that its prior density is

f(p) = [B(α, β)]^-1 p^(α-1) (1-p)^(β-1)

Show that for any constant d,

E[p(1-p)(p-d)2] is minimised wwhen d = (α+1) / (α+β+2)

_____

So far iv got

E[p(1-p)(p-d)2] = ∫ p(1-p)(p-d)2 f(p) dp

= ∫ [B(α, β)]^-1 p^α (1-p)^β (p-d)^2 dp

= [B(α, β)]^-1 ∫ p^α (1-p)^β (p-d)^2 dp

Any help will be appreciated

Thanks a lot