# How to integrate an imaginary exponential to give a Delta function?

Is there a way to get Mathematica to integrate imaginary exponential functions to give delta functions? Analytically, we obtain:

$$\int_{-\infty}^{\infty} e^{i kx} dk = 2 \pi \delta(x)$$

Code:

Integrate[E^(I k x), {k, -\[Infinity], \[Infinity]}]


However, an error saying that the integral does not converge in these limits stops the integral from being evaluated.

For Fourier integrals like this one, use FourierTransform.
FourierTransform[1, k, x, FourierParameters -> {1, 1}]

FourierTransform understands that it can use generalized functions like DiracDelta to represent some integrals that don't converge. Integrate can't do that.