Suppose random variable $X_p$ has geometric distribution $G(p)$ for each $0<p<1$. And $Y$ is a random variable with beta distribution $B(1/2,1/2)$. I need to find the compounded distribution of random variable $X$ defined by $X(s)=X_{Y(s)}(s), s\in S$.
I think here I should evaluate $f_X (x)= \int_0^1 f_{X|Y}(x|y)f_Y(y)dy$, but I'm stuck at $\frac{p \Gamma(1)}{\Gamma(1/2)\Gamma(1/2)} \int_0^1 \frac{(1-p)^{y-1}}{y^{1/2}(1-y)^{1/2}}dy$.
If we use the parametrization $$\Pr[X = x \mid P = p] = (1-p)^x p, \quad x = 0, 1, \ldots,$$ then $$\Pr[X = x] = \int_{p=0}^1 \Pr[X = x \mid P = p] f_P(p) \, dp = \int_{p=0}^1 (1-p)^x p \frac{\Gamma(1)}{\Gamma(1/2)^2} p^{-1/2} (1-p)^{-1/2} \, dp.$$ You can't pull out a $p$ from your integral because you are integrating with respect to $p$. Continuing, we find $$\Pr[X = x] = \frac{1}{\pi} \int_{p=0}^1 p^{1/2} (1-p)^{x-1/2} \, dp.$$ Next, exploit the fact that the integral of a beta density with general parameters $a$, $b$, equals $1$ over its support; i.e., $$\int_{p=0}^1 \frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)} p^{a-1} (1-p)^{b-1} \, dp = 1.$$ So with the choice $a = 3/2$, $b = x+1/2$, we find $$\int_{p=0}^1 p^{1/2} (1-p)^{x-1/2} \, dp = \frac{\Gamma(3/2) \Gamma(x+1/2)}{\Gamma(x+2)},$$ and $$\Pr[X = x] = \frac{\Gamma(3/2)\Gamma(x+1/2)}{\Gamma(x+2) \Gamma(1/2)^2} = \begin{cases} \frac{(2x-1)!}{4^x (x-1)! (x+1)!}, & x > 0 \\ \frac{1}{2}, & x = 0. \end{cases}$$