# How to derive this pdf?

I understand how to find the pdf for the sum of $N$ exponentially distributed random variables, but how do I find the pdf when $N$ is also an independent random variable.

Here is the problem:

Let $N,X_1,X_2,...$ be independent, where $P[N=n]=q^{n-1}p, n \ge 1$ and each $X_k$ has the exponential density $f(x;\alpha;1)$. Show that $X_1+..+X_N$ has density $f(x;\alpha p,1)$. This is problem 20.18 in Billingsley.

where

$f(x;\alpha,u)={\alpha^u\over\Gamma(u)} x^{u-1}e^{- \alpha x}$

I don't know where to start. I think this relates to the Erlang pdf, but I am not sure how to connect the two. Any help would be greatly appreciated.

For each $n\geqslant1$, let $g_n$ denote the PDF of $X_1+\cdots+X_n$, then, by independence of $N$ and the sequence $(X_n)$, the density $g$ of the random variable $X_1+\cdots+X_N$ is $$g=\sum_{n\geqslant 1}P(N=n)g_n=\sum_{n\geqslant 1}pq^{n-1}g_n,$$ hence, if every $g_n$ is known, one can compute $g$.