A Life Before And After the Dirac Delta Function

Physics Nobel laureate Paul Dirac; © Nobel Foundation, Public domain, via Wikimedia Commons

W hen I was a young physics student at university, one of my professors told us that there is a dividing line in his life. One that separates his life into before and after meeting the Dirac Delta function. He was exaggerating, of course, but only mildly. Indeed, the Dirac delta function is one of the most important items in the toolbox of theoretical physicists. Actually, it’s not really a function. It’s a more generalized “function”, or distribution . But for most practical matters, one can treat it as a function. In this article, I will show you its bizarre properties, and how you can use it in Python’s computer algebra package sympy .

The Delta Function

Here is one funny property of the 𝛿-function. We have 𝛿(𝑥)=0 for all 𝑥≠0, but 𝛿(𝑥)≠0 for 𝑥=0. So it is nonzero for all but one point. However, the integral

is not zero!

This can only be true if 𝛿(0) is in some sense infinite! You can imagine 𝛿(𝑥) as the result of a limiting process. Consider the function

Obviously, the harmless integral

is one, no matter what integer 𝑛n we take. Now image the sequence of functions

With increasing 𝑛, the functions get thinner and higher:

As the integral is the same for each 𝑛, it’s plausible that the integral over the limit function, 𝛿(𝑥) is also 1.

sympy has an implementation of the delta function. It is aptly called DiracDelta . Let's check the integral above:

Another important feature of the Dirac function is that it can select points from a function by integrating over it:

It is also symmetric:

It even has derivatives:

and sympy can handle that in integration as well:

Here is one more property:

What about 𝛿((𝑥−𝑎)(𝑥−𝑏))? Well, one might guess that it will give two contributions, one for each zero of the argument. Indeed, we have

The migration to several dimensions is straightforward. For example, in 3D, we can write

where we interpret 𝛿(𝑟⃗)δ(r→) as 𝛿(𝑥)𝛿(𝑦)𝛿(𝑧) or whatever the coordinates are. That can be used to derive one more amazing identity: Consider this simple function in spherical coordinates: 1/𝑟. Do you know what the Laplacian of this function is? It’s

I don’t want to take away from you the joy of deriving this identity yourself with sympy , so I stop here for today. Thanks for reading!