The following has been a rather interesting journey – from a test question which seemed fine, to a subtlety which seemed easy, to a discussion with a number of different mathematicians about the nature of distributions, measure theory and regularisation. I will try and make it as clear as possible in the post below. Note, as mentioned in the comments, we have actually only found the solution to this problem for a constrained range of x, and not x . I didn’t want to complicate things any more than necessary here for first year students, but the comments are very important too.

In a recent class test, there was a question, written by me, which was not quite the question that I wanted to ask. It turns out that it does have an answer, but it’s not an answer that can yet be found by the means at the class’s disposal. That being said, full marks are going to be given to those who took the known route, even though it actually leads to an incorrect answer. Bonus marks will be given for anyone who found the inconsistency.

So, the question was, given:

Find f(x).

The path that I expected the students to take was:

- Notice that to use the fundamental theorem of calculus, we want the upper limit of our integral to have x, and not the lower limit, so we can rewrite the equation as:

2. Now take a derivative of both sides with respect to x. We expect to be able to use the FTC (though actually this is where the problem lies) and this will give us:

We can then swap things around to get:

And everybody is happy, right? Wrong!

As was pointed out, there is a fatal error here. We can see this in at least two ways. The first is just to plug this back into the original equation, and you will find that it’s not correct. There is an extra term that somehow appears. Try it for yourself and see what happens.

In fact we can take a much simpler example and find out precisely what is going on. What if the original question had been:

Well, you would use the FTC and this would give you:

Right? Wrong again!! Simply plug this into the left hand side of the original equation and you get:

OK, so something strange is going on, but we can do something even more obvious to see that something odd is happening.

Given:

What if we take . Well, if the function is nice and continuous, then the left hand side is going to vanish. We would be looking at the area under a graph between 1 and 1, whose area is obviously 0, and on the right, we have 1, so it looks like we have:

0=1.

This is clearly problematic. Somehow, our integral is giving us 0, when we want it to give us 1.

Is there any way to have a function which, when we integrate it over an infinitesimal distance gives us a finite value? Well, it turns out that there are certain things, a bit like functions, called distributions which do have precisely this property. They are, in hand-wavey terms, infinitely thin, and infinitely high, where the width and height are taken to these extremes in such a way that the area underneath them is 1. Imagine having a function which is zero everywhere, except between x=-a/2 and x=a/2, where it is equal to 1/a. Clearly its area then is 1. Now take and you have a function which has the properties that we want. Again, one has to be careful that these things aren’t really functions, but for now we will be a bit sloppy.

The function that we can use to solve our problems here is called the Dirac Delta function, and it’s written . This is basically a function which is zero everywhere, except at the point x=0, where its value is infinite, but in such a way that if you calculate the ‘area under the curve’, it gives 1. If you want to put the spike anywhere else, you just write, for instance which would be an infinite spike at x=2, and zero everywhere else. We can write:

In fact, we could also write:

or indeed any other values. In fact we can write:

Because the function is zero everywhere except at the point x=0, where it is infinite.

Now comes the extra level of subtlety. The delta function can be thought of as the limit of a distribution – the Gaussian distribution. In fact even this isn’t quite correct, but we often think of the delta function like this. Really it is defined by its properties, but you will often find it defined as this limit.

We can write:

We can certainly think about integrating this and (with some very clever trickery) you can show that its integral gives 1 if you integrate about a finite range centred at the point x=0 and then take the limits. For instance:

This would surely then mean that:

However, we have to be very careful because in doing this we are really thinking about two different limits: One is the lower part of the integral going to 0 from below, and the other is the value a going to zero. The order of limits is very important. In general, when you have multiple infinities you can ‘regularise’ in a number of different ways. We are here going to define:

This is a matter of taking the limits in a slightly different way. In fact, we are going to take another limit and say:

Again, we are having to be very careful that we are simply defining the order of the limits such that this is true. You can get other solutions if you take the limits in other ways. Infinities are weird like that! Right, so in general we are defining:

We can also multiply the Dirac delta by a constant and we will get, for instance:

Note, we have to be really careful here! We are actually taking a specific (and not a particularly usual) choice about the properties of our delta function. So long as we keep track of the consistency of our claims however, we can define things as we so desire.

OK, back to our original problem:

So, while it looks, from using the FTC naively that the solution is f(x)=1, in fact the answer is:

ie. 1 almost everywhere, except at the point 1, where it is infinite. Basically, unless you look at the point 1, the function just looks constant. Now, when we integrate this:

So this function does indeed solve the problem. Notice however that we have to be careful, the answer that we get in the end is something discontinuous, and this is why the FTC didn’t capture everything, because the FTC needs the function to be continuous.

So, we can solve our original problem the same way, we just need to add a little something to the mix:

The solution to our original problem is actually:

Let’s check:

Which was what we wanted. This extra little (read: infinite) jump at x=3 is enough to solve all of our woes about the naive solution that you get from the FTC not actually solving our equation.

Aidan HornMay 28, 2016 at 10:25 pm[latex]e^{-x}\left(\frac 2 {x^3} – \cos x \right)[/latex] doesn’t work because that function is defined on [latex]3<x<b[/latex] where _b_ is the maximum value of the interval that [latex]f(t)e^t[/latex] is continuous on. Because [latex]3 \not\in (3,b)[/latex], we cannot have it as a lower bound of the integral and expect the answer to come out as [latex]\sin x + \frac 1 {x^2}[/latex].

Please delete my last comment.

Jonathan ShockMay 28, 2016 at 10:29 pmThe function you quote at the top seems to be defined in R, no?

Aidan HornMay 31, 2016 at 6:26 amWhen using the FTC, the derivative of the antiderivative is only defined on an open interval (a, b), where a is the lower bound of the integral and b>=x. That is why, I think, the derivative you got could not be integrated.

MMay 30, 2016 at 10:01 amFor the toy example to work also for negative x, I think you want

\[

f(x) = 1 + 2 sign(x-1) \delta(x-1)

\]

where the delta function has $ \int_0^\infty \delta(x) dx = 1/2 $ as usual, not the =1 used above. Then the limits from left and right will agree, no?

MMay 30, 2016 at 10:30 amWell, that assumes that the sign(x) function is infinitely sharp.

More realistically we should define $ sign(x) = -1 + 2\Theta(x) = -1 + 2 \int_0^x \delta(x) dx $ so that this will have the same width as the delta function. Then you have $ \int_0^\infty sign(x) \delta(x) dx = 1/4 $ instead, so you need to replace the 2 with a 4 in my f(x).

Of course one should be able to write this in some formal way as distributions. But the universe has a UV regulator so any sensible theory of distributions must agree.

MMay 30, 2016 at 10:31 amsorry there’s a typo, that should of course define the step function with an integral from minus infinity, like this: $ \Theta(x) = \int_{-\infty}^x \delta(x) dx $.

MikeJuly 28, 2016 at 11:50 amThe short version of the story is: You are giving what the value of the integral should be from 3 to x (with negative sign) but the answer for the area is exactly what you would get in total for an integration from 0 to x. So you are missing the 0 to 3 part. Your function needs to somehow chuck that area into the integral, no matter the value the x. The only place to do that is where x = 3 and it dumps the whole area onto that point in one go.