# How to let Mathematica return impulse or Dirac delta functions when computing integrals?

For example, let's say I want to compute the (continuous-time) Fourier transform of the signal/function $$\cos{(3t)}$$, which is given by the following improper integral:

$$\displaystyle\int_{-\infty}^{\infty} \cos{(3t)} e^{-j\omega t} \, \mathrm{dt} \tag 1$$

whose value is:

$$\pi \, \delta{(\omega - 3)} + \pi \, \delta{(\omega + 3)} \tag 2$$

The corresponding Mathematica code to compute the integral of (1) would be Integrate[Cos[3*t]*Exp[-I*w*t], {t, -Infinity, Infinity}, Assumptions -> {w \[Element] Reals}]. However, after executing such code Mathematica returns the message "Integrate: Integral of $$e^{-i t w} \text{Cos}{[3 t]}$$ does not converge on {$$-\infty$$,$$\infty$$}." How can I tell Mathematica to use the impulse/Dirac delta function during the computation of the integral, in order to return (2) or something similar?

• Use FourierTransform instead, e.g., FourierTransform[Cos[3 t], t, w, FourierParameters -> {1, 1}]. Jan 27 at 17:48
• It should be noticed that FourierTransform[Cos[3 t], t, w, FourierParameters -> {1, 1}] is not an proper divergent integral, but uses another definition (e.g. see Fourier transform or/and Encyclopedia of Mathematics). I think this is impemented in Mathematica as a table value. Jan 27 at 18:05
• Workaround: InverseFourierTransform[ Integrate[ FourierTransform[Cos[3*t] Exp[-I \[Omega] t], \[Omega], s], {t, -Infinity, Infinity}, Assumptions -> s \[Element] Reals], s, \[Omega]] Jan 28 at 17:17

## 1 Answer

If you use Dirac or Heaviside functions explicitly in your expression, Mathematica figures out that you're working with generalized functions. Unfortunately, it doesn't always work the other way: Mathematica won't volunteer to use generalized functions unless you're explicitly using Fourier/Laplace transforms. So, if you're working with Fourier integrals, and want results in terms of generalized functions, you need to use FourierTransform rather than Integrate.

• Hi John (remember me?) This is a nice example of an integral the type you were describing in our recent conversation. One can integrate over a large symmetric range and get a pair of sincs. Taking the limit as the range ->infinity gives deltas. That said, Limit will not recognize this (Limit has its limits). But this manner of integration does involve a regularization insofar as we in effect take a principle value integral. PS I upvoted this. Jan 27 at 19:26
• @DanielLichtblau ツ Jan 27 at 19:29