When I read the derivation for finding the density function of the gamma distribution, I encountered this differentiation:
$$\frac{d}{dt}\Big(1-\sum_{k=0}^{r-1}\frac{(\alpha t)^k}{k!}e^{-\alpha t}\Big)$$ $$=\sum_{k=0}^{r-1}\Big(\frac{-\alpha^{k}t^{k-1}}{(k-1)!}e^{-\alpha t}+\frac{\alpha^{k+1}t^k}{k!}e^{-\alpha t}\Big)$$ $$=\frac{\alpha^{r}t^{r-1}}{(r-1)!}e^{-\alpha t}$$
The first step is just the product rule, what I don't quite get is the final step.
What I could do best is:
$$\sum_{k=0}^{r-1}\Big(\frac{-\alpha^{k}t^{k-1}}{(k-1)!}e^{-\alpha t}+\frac{\alpha^{k+1}t^k}{k!}e^{-\alpha t}\Big)$$ $$=\sum_{k=0}^{r-1}\frac{-\alpha^{k}t^{k-1}}{(k-1)!}e^{-\alpha t}+\sum_{k=0}^{r-1}\frac{\alpha^{k+1}t^k}{k!}e^{-\alpha t}$$ $$=e^{-\alpha t}\Big(\sum_{k=0}^{r-1}\frac{-\alpha^{k}t^{k-1}}{(k-1)!}+\sum_{k=0}^{r-1}\frac{\alpha^{k+1}t^k}{k!}\Big)$$
Could anyone please provide some explanation on how to compute the sum and get the final result? Thanks.
This does not look completely right due to the index. In any case you can use the fact that you can write your series
$$ \sum_{k=0}^{r-1} a_{k}\mathrm{e}^{-\alpha t}-a_{k-1}\mathrm{e}^{-\alpha t} = \mathrm{e}^{-\alpha t}\sum_{k=0}^{r-1} a_{k}-a_{k-1} $$ this is an example of a telescoping sum so only the boundaries survive i.e. $$ \mathrm{e}^{-\alpha t}\sum_{k=0}^{r-1} a_{k}-a_{k-1} = \left(a_{r-1} - a_{-1} \right)\mathrm{e}^{-\alpha t} $$ where $$ a_{k} = \frac{\alpha ^{k+1}t^{k}}{k!} $$
$\textbf{appendix}$
$$ \sum_{k=0}^{r-1} a_{k}-a_{k-1} = a_0 - a_{-1} + (a_1- a_0) + (a_2 - a_1) +\cdots (a_{r-1}-a_{r-2}) $$ Re-arranging we can obtain $$ -a_{-1} + (a_0-a_0) + (a_1-a_1) + \cdots + (a_{r-2} -a_{r-2}) + a_{r-1} = a_{r-1} - a_{-1} $$ As above.