Why is the integral of 1/x equal to the natural logarithm of x?

The title of this post asks a question that many calculus students find befuddling. Here I’ll give some geometric intuition behind it. I leave small logical gaps to avoid cheating the reader of the pleasure of their discovery.

One essential feature of logarithms is that they make a multiplication problem equivalent to an addition problem, by which I mean

\ln(ab) = \ln(a) + \ln(b)

Meanwhile, \int\frac{1}{x}\mathrm{d}x is usually thought of geometrically as the area underneath a curve. The problem, then, is to try to see visually what an area under a curve has to do with turning multiplication into addition.

Here’s a graph of 1/x, and we’re finding, as an example, the area under it from 1 to 2.

integral

Let’s say now that we multiply the limits of integration by two, so we’re now finding the area from 2 to 4. Here’s what that looks like.

second integral

The two portions are actually very similar to each other in their overall shape. The orange one is twice is wide as the green one, but also half as tall. Here they are overlaid.

overlaid integrals

If you take the green shape and first squash it down vertically by a factor of two then stretch it out horizontally by a factor of two, you get the orange shape exactly. (If you don’t believe this, convince yourself it works!) This means the areas of these shapes are exactly the same, even though we don’t know what that area is.

Show for yourself that this result is general. The area under 1/x from a to b is the same as that from ac to bc.

What, then, is the area from 1 to 6? We can break it into two parts – the area from 1 to 2 and the area from 2 to 6. But the area from 2 to 6 is the same as the area from 1 to 3, by the above reasoning.

Thus, the area from 1 to 6 is the same as the sum of the areas from 1 to 2 and from 1 to 3. Note that 6 = 3*2. Again, this is general. The area under 1/x from 1 to ab is the same as the sum of the areas from 1 to a and from 1 to b.

That’s pretty good motivation for the definition

\ln(x) = \int_1^x\frac{1}{t}\mathrm{d}t

Note that this is being taken as a definition of the natural logarithm, not a proof of the relationship. Our argument about the integral of 1/x now translates to the statement

\ln(ab) = \ln(a) + \ln(b)

Now, step by step, we will show that all the other properties you expect of the natural logarithm follow from this definition.

It is evident that

\ln(1) = 0

Our definition implies that the logarithm grows without bound because if we continually multiply the argument of the logarithm by two, we continually add \ln(2) to the value. (i.e. \ln(2x) = \ln(x) + \ln(2)). Since we can multiply any number by two over and over, we can add \ln(2) to the logarithm as many times as we want. That means we can make the logarithm arbitrarily big.

This also means that starting the integral from 1 rather than from zero was a good idea. If we start from zero, the integral is infinite. We can see this because 1/x is symmetric about the line y = x.

symmetric

This implies that the area to the left of the curve is the same as the area under the curve, like this.

areas

We just showed that the area under the curve diverges as we move the right hand side of the integral out to infinity, so the area to the left of the curve diverges, too. If we started the integral at zero, it would be infinite.

What about taking the logarithm of numbers less than one? A good check of whether everything makes sense so far is to work out that \ln(1/x) = - \ln(x).

Since the area under 1/x starts at zero when x=1 and goes up infinitely, it is clear that there must be some number x such that \ln(x) = 1. Let’s choose to call that number e. We don’t know what it is yet, but it certainly exists. Thus

\ln(e) = 1

Again, this is definition, not proof.

It is immediately apparent that, for example, \ln(e^5) = \ln(e*e*e*e*e) = 5\ln(e) = 5. That makes e a pretty handy number. It shows us that the logarithm of a number x is how many times you need to multiply e to itself in order to get x.

How about \ln(e^{3/2})? That is \ln\left([e^{1/2}]^3\right) = 3\ln(e^{1/2}). So in order to understand logarithms of rational numbers, we need to understand roots of e.

That’s not so hard, though.

\ln(e^{1/2}*e^{1/2}) = \ln(e) = 1.

On the other hand,

\ln(e^{1/2}*e^{1/2}) = \ln(e^{1/2}) + \ln(e^{1/2}) = 2 \ln(e^{1/2})

From this we deduce \ln(e^{1/2}) = 1/2. Returning to the unfinished example, \ln(e^{3/2}) = 3*(1/2) = 3/2. It is not great leap to say that for any rational number x, we have

\ln(e^x) = x

This is important result; it is probably the definition of \ln(x) that you’re used to. The pieces are falling into place. The main remaining hurdle is to find the value of e and show it comes to what we expect.

Before that, we should mention how the above relation works for irrational numbers. Irrational numbers are squeezed in between the rational ones, and since the definition of the logarithm as the area under a curve is evidently smooth, the logarithm of an irrational number is squeezed in tightly as well. Ultimately, the above relation holds for all positive numbers. However, the fine details of real numbers are more involved than I would like to address here. (The logarithm of a negative number or of zero isn’t defined, at least not in the real numbers. What is a difficulty with doing so?)

Finally, we would like some way of determining what e is. Here is one way to do it. For small values of x, we can see that

\ln(1+x) \approx x

This follows from the extremely simple approximation below.

approximation

The red box is an approximation to the area of the green integral. The red box clearly has area x while the green integral is \ln(1+x). Thus

\ln(1+x) \approx x

It’s crude, but it works better and better as x becomes tiny. Multiplying both sides of the approximation by 1/x, we get

\frac{1}{x}\ln(1+x) \approx 1

We know how to rewrite the left hand side. It gives

\ln\left([1+x]^{1/x}\right) \approx 1

Since we have defined e by \ln(e) = 1, we finally see

e = \lim_{x\to 0} (1+x)^{1/x}

This is the common definition of e. At last we see that the reason that the integral of 1/x is \ln(x) is that all the properties of the two functions are exactly the same, and so they must be the same function.

Tags: , ,

8 Responses to “Why is the integral of 1/x equal to the natural logarithm of x?”

  1. L Says:

    Hi, excellent blog post! I’m curious, what software do you use to make your graphs/graphics?

    Thanks,

    L

  2. Mark Eichenlaub Says:

    Hi, and thanks you! These graphics were made with Geogebra, which is free online via a google search. I also edit them sometimes with GIMP, which is also free online.

  3. Eugenio Benito, Jr. Says:

    Why can’t you use integration by parts to solve integral of 1/x?
    If you do it, ∫(1/x)dx = x.(1/x) + ∫(x/x^2)dx or ∫(1/x)dx = 1 + ∫(1/x)dx or 0 = 1. Where is the mistake?

  4. e^h Says:

    Nice illustrations. Showing that the first area relationships hold is trivial when you already know the calculus, but any hints on showing how they hold when you know nothing of ln(x) and integrating 1/x? Or do you just do messy work with Riemann Sums (if that’s possible)? I’m wondering if there’s something slick I’m missing.

  5. Mark Eichenlaub Says:

    I’m not sure I understand the question, sorry.

  6. Paige Says:

    This is a really cool post, Mark!

    I know it’s been quite a while, but I’m going to answer Eugenio’s question anyway. The mistake is in the x(1/x)=1 part: you forgot to evaluate this term at the integration limits. If the integral is from a to b, then this term becomes f(b) – f(a) = 1 – 1 = 0.

    So you’ve used integration by parts to show that ∫(1/x)dx = ∫(1/x)dx, which is something you hopefully already knew. :)

  7. mclaury Says:

    Eugenio: when you write integration by parts that way, you’re essentially using a shorthand for a version that includes bounds of integration. This is okay most of the time, but here you run into a bit of a problem. If you make both of those integrals you’ve written into integrals from a to b, you’ll see exactly what happens: you evaluate 1 at x=b and at x=a and subtract them, getting zero. So you wind up with the statement that the integral of dx/x from x=a to x=b is equal to itself, which is true but obviously not particularly enlightening.

  8. mclaury Says:

    e^h: He’s not using the fact that the integral of 1/x is ln(x) above. It’s easy to check that the green shape is exactly the same as the orange shape, except twice as tall and half as wide, just by pure algebra.

    Consider the orange region, which is the area under 1/x between x=2 and x=4. Make it half as wide by replacing x with 2x; now we’re looking at the area under 1/2x between x=1 and x=2. Then make it twice as tall by doubling it; now we’re looking at the area under 2/2x between x=1 and x=2. But 2/2x = 1/x. So if we make the green thing half as wide and twice as tall, we get exactly the orange thing, without using any calculus at all.

Leave a comment