Suppose we have the random variable $L= \sum_{i=1}^N X_i$, with $N\sim\mathrm{Pois}(p_1)$ and $X_i\sim\mathrm{Exp}(p_2)$.
Does that mean that $L\sim\mathrm{Gamma}(n,p_2)$ as the sum of exponential random variables? What would be the distribution of $L^2$?
Many thanks
Conditioned on $\{N=n\}$, $n\in\mathbb Z\cap[1,\infty)$ we have that $$ L = \sum_{i=1}^n X_i \sim\Gamma(n,p_2). $$ So the distribution of $L$ is given by \begin{align} f_L(t) &= \mathsf 1_{\{0\}}(t)\mathbb P(N=0) +\sum_{n=1}^\infty f_{L\mid N=n}(t\mid n) f_N(n)\\ &= e^{-p_1}\mathsf 1_{\{0\}}(t)+\sum_{n=1}^\infty \frac{p_2(p_2t)^{n-1}e^{-p_2t}}{(n-1)!} e^{-p_1}\frac{p_1^n}{n!}\\ &= e^{-p_1}\mathsf 1_{\{0\}}(t) + \frac{\sqrt{p_1} \sqrt{p_2} e^{-p_2 t-p_1} I_1\left(2 \sqrt{t} \sqrt{p_1} \sqrt{p_2}\right)}{\sqrt{t}}, \end{align} where $I_1(t)$ is the modified Bessel function of the first kind satisfying the differential equation $t^2y'' + ty' - (t^2+1)y = 0$. In principle we could compute $$ \mathbb P(L^2\leqslant t) = \mathbb P(L\leqslant \sqrt t) = e^{-p_1}\mathsf 1_{[0,\infty)}(t) + \int_0^{\sqrt t} f_L(s)\ \mathsf ds $$ to find the distribution of $L^2$, but this integral is unlikely to have a nice closed form.