My question is fundamentally a matter of mathematics, but it is based in physics. My textbook, Solid-State Physics, Fluidics, and Analytical Techniques in Micro- and Nanotechnology, by Madou, says the following in a section on X-Ray Intensity and Structure Factor $F(hkl)$:
Assume now a crystal with base vectors $\mathbf{a}_1$, $\mathbf{a}_2$, and $\mathbf{a}_3$ and a total number of atoms along each axis of $M$, $N$, and $P$, respectively, and also accept that there is only a single atom at each lattice point (i.e., $f_j = 1$), then the amplitude of the total wave will be proportional to:
$$\begin{align} \Psi(x, t) \propto F(h, k, l) &= \sum_{\text{all atoms}} e^{i(r_j \cdot \Delta \mathbf{k})} \\ &= \sum_{m = 0}^{M - 1} \sum_{n = 0}^{N - 1} \sum_{p = 0}^{P - 1} e^{i[(m \mathbf{a}_1 + n \mathbf{a}_2 + p \mathbf{a}_3) \cdot \Delta \mathbf{k}]} \end{align}$$
after rearrangement we obtain:
$$\Psi(x, t) \propto F(h, k, l) = \sum_{m = 0}^{M - 1} e^{im \mathbf{a}_1 \cdot \Delta \mathbf{k}} \sum_{n = 0}^{N - 1} e^{in \mathbf{a}_2 \cdot \Delta \mathbf{k}} \sum_{p = 0}^{P - 1} e^{ip \mathbf{a}_3 \cdot \Delta \mathbf{k}} \tag{2.38}$$
The intensity of the scattered wave is the square of the wave amplitude, and taking the value of one of the sums in Equation 2.38 for a crystal of dimension $M\mathbf{a}_1$ in the direction $\mathbf{a}_1$, we obtain:
$$\sum_{m = 0}^{M - 1}e^{i m \mathbf{a}_1 \cdot \Delta \mathbf{k}} = \dfrac{1 - e^{iM(\mathbf{a}_1 \cdot \Delta \mathbf{k})}}{1 - e^{i(\mathbf{a}_1 \cdot \Delta \mathbf{k})}}$$
I would greatly appreciate it if people would please take the time to explain how we deduce that $\sum_{m = 0}^{M - 1}e^{i m \mathbf{a}_1 \cdot \Delta \mathbf{k}} = \dfrac{1 - e^{iM(\mathbf{a}_1 \cdot \Delta \mathbf{k})}}{1 - e^{i(\mathbf{a}_1 \cdot \Delta \mathbf{k})}}$.