A periodic function can be described by a sum of monochromatic waves as follows:
$$ u(x)=\sum_{j=1}^n a_j e^{ik_jx} $$ However I am studying wave packets, and I understand that these have a 'continuous' range of wave numbers $k$. I also see that an integral is needed, but what is the derivation from the above sum to the next integral?
$$ u(x)=\int_{-\infty}^{+\infty} A(k) e^{ikx} dk $$
I tried with riemann sums but I could not make it work. Also the sum does not have a '$\Delta k$'-like term.
Preliminary note : you should write $k_i$ instead of $k$ in the sum, otherwise your signal contains a unique frequency.
Answer. The quickest way to go from discrete to continuous frequency spectrum (i.e. from series to integral representations), and vice versa, is taking $A(k) = \displaystyle\sum_{i=1}^na_i\delta(k-k_i)$ as a truncated Dirac comb.
Like that, the integral behaves / is recasted as a discrete sum, and vice versa. In measure theory, we would say that a counting measure is used for the integral; measure theory has been precisely developped to treat sums and integrals together, so that discrete and continuous quantities can be mixed up and described in the same way.