Suppose $\displaystyle X$ ~ $\displaystyle Binomial(n,p)$ and the prior distribution for $\displaystyle p$ is $\displaystyle Beta(a,b).$
Find the mean and Variance of the marginal distribution.
I assume you want the marginal of X since the marginal of P is given (nice pun)
$\displaystyle E(X)=E(E(X|P))=E(nP)=nE(P)={na\over a+b}$
Next use....
$\displaystyle V(X)=E(V(X|P))+V(E(X|P))$
$\displaystyle =E(nP(1-P))+V(nP)=nE(P-P^2)+n^2V(P)$