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 \in \mathbb{R}. 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:


\int_x^3 f(t)e^t dt=\sin x+\frac{1}{x^2}


Find f(x).


The path that I expected the students to take was:


  1. 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:


-\int_3^x f(t)e^t dt=\sin x+\frac{1}{x^2}


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:


-f(x)e^x=\cos x-\frac{2}{x^3}


We can then swap things around to get:


f(x)=e^{-x}\left(\frac{2}{x^3}-\cos x\right)


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:


\int_1^x f(t) dt=x


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:


\int_1^x f(t) dt=\int_1^x 1 dt=x-1\ne x


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




\int_1^x f(t) dt=x


What if we take x\rightarrow 1. 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:




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 a\rightarrow 0 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 \delta(x). 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 \delta(x-2) which would be an infinite spike at x=2, and zero everywhere else. We can write:


\int_{-\infty}^\infty \delta(x) dx=1


In fact, we could also write:


\int_{-3}^3 \delta(x) dx=1


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


\lim_{\epsilon\rightarrow 0}\int_{-\epsilon}^\epsilon \delta(x) dx=1


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:


\delta(x)=\lim_{a\rightarrow 0}\frac{e^\frac{-x^2}{a^2}}{a\sqrt{\pi}}


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:


\int_{-2}^2\delta(x)dx=\lim_{a\rightarrow 0}\int_{-2}^2\frac{e^\frac{-x^2}{a^2}}{a\sqrt{\pi}}dx=1


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:


\int_1^x 1+\delta(1-t) dt=\int_1^x dt+\int_1^x\delta(t-1)dt=(x-1)+1=x


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:


f(x)=e^{-x}\left(\frac{2}{x^3}-\cos x+\delta(x-3)\left(\frac{1}{3^2}+\sin 3\right)\right)


Let’s check:


\int_x^3 f(t)e^t dt=\int_x^3 \left(\frac{2}{t^3}-\cos t+\delta(t-3)\left(\frac{1}{3^2}+\sin 3\right)\right)dt

=\int_x^3 \frac{2}{t^3}-\cos t+\int_x^3\delta(t-3)\left(\frac{1}{3^2}+\sin 3\right)dt

=\int_x^3 \frac{2}{t^3}-\cos t+\left(\frac{1}{3^2}+\sin 3\right)\int_x^3\delta(t-3)dt

=\left. -\frac{1}{t^2}-\sin t\right|_x^3+\left(\frac{1}{3^2}+\sin 3\right)=\frac{1}{x^2}+\sin x



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.

How clear is this post?