1

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?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
alejnavab
  • 453
  • 2
  • 10
  • 5
    Use FourierTransform instead, e.g., FourierTransform[Cos[3 t], t, w, FourierParameters -> {1, 1}]. – Carl Woll Jan 27 '22 at 17:48
  • 2
    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. – user64494 Jan 27 '22 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]] – Mariusz Iwaniuk Jan 28 '22 at 17:17

1 Answers1

8

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.

John Doty
  • 13,712
  • 1
  • 22
  • 42
  • 2
    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. – Daniel Lichtblau Jan 27 '22 at 19:26
  • @DanielLichtblau ツ – John Doty Jan 27 '22 at 19:29