Solution (source code)

= Solution

This is the unit-rate <Erlang distribution>. For completeness, use convolution. The result is clear for $n=1$. If
$$
f_n(x)=\frac{x^{n-1}}{(n-1)!}e^{-x}\mathbf1_{\{x>0\}},
$$
then independence and the unit exponential density give, for $x>0$,
$$
\begin{aligned}
f_{n+1}(x)
&=\int_0^xf_n(y)e^{-(x-y)}\,dy\\
&=\frac{e^{-x}}{(n-1)!}\int_0^xy^{n-1}\,dy
=\frac{x^n}{n!}e^{-x}.
\end{aligned}
$$
Induction therefore proves
$$
\boxed{f_{X_n}(x)=\frac{x^{n-1}}{(n-1)!}e^{-x}},
\qquad x>0.
$$