We want to calculate
$ \int_0^\pi \sin x\ dx $
three days before we learn the Fundamental Theorem of Calculus, so our only tool is the limit of a Riemann sum.
So
$ \int_0^\pi \sin x\ dx\approx \sum_{n=1}^N \sin(n\pi/N)(\pi/N) $
when $ N $ is large.
Recall Euler's identity,
$ e^{i\theta}=\cos\theta + i\sin\theta. $
Hence, that Riemann sum is the imaginary part of
$ (\pi/N)\sum_{n=1}^N e^{n\pi/N}. $
But $ e^{n\pi/N}=\left(e^{\pi/N}\right)^n. $