ThAt oNe wEirD tRicK

Andrew Stacey

2025-02-06

Creative Commons License

Contents

  1. Home

  2. 1. Integrating Logs

  3. 2. Inverses?

  4. 3. Wait!? What was integration again?

  5. 4. Back to Logs

  6. 5. Sign of the Times

  7. 6. Afterword

1 Integrating Logs

There's a sneaky technique for integrating the natural logarithm function which involves writing ln(x) as 1×ln(x) and invoking the product rule:

ln(x)dx=1×ln(x)dx=xln(x)-x×1xdx=xln(x)-1dx=xln(x)-x+c

There are a variety of ways of explaining this, but the ones that I know don't tend to be all that enlightening on how to come up with something like this in the first place. For example, I usually say that we try it because we know how to differentiate ln(x) and its derivative is considerably nicer than ln(x). But that's a bit unsatisfactory, since the reason the second integral is so nice is because of the interaction between the derivative of ln(x) and the integral of 1 rather than just the niceness of the derivative of ln(x) by itself.

Also, it still feels like a justification after the fact. Without seeing it work for ln(x) then I wouldn't think to try it for anything else. To put that another way, knowing it works for ln(x) means I might try it for, say, sin-1(x), but I still can't envision coming up with it out of a vacuum.

By the way, did you know that it also works for sin-1(x)? Just in case not, here it is:

sin-1(x)dx=1×sin-1(x)dx=xsin-1(x)-x×11-x2dx=xsin-1(x)+1-x2+c

2 Inverses?

Both ln(x) and sin-1(x) can be thought of as inverses of more well-known functions1. So maybe this trick is about inverses?

1Though they can be defined in their own right.

f-1(x)dx=1×f-1(x)dx=xf-1(x)-x×1f'(f-1(x))dx

This doesn't seem all that enlightening, but let's do a cunning substitution2 and see what happens.

2Where's that turnip emoji?

Let y=f-1(x), so x=f(y) and "dx=f'(y)dy". Then:

x×1f'(f-1(x))dx=f(y)1f'(y)f'(y)dy=f(y)dy

Integrating this relies on being able to integrate f(y), but with inverse functions this might well be a more possible prospect.

This substitution, though, has more to it than is apparent at first. Let's do the substitution throughout but also being a little choosy about when to substitute.

We have y=f-1(x) so we can write the initial integral as just:

ydx

The integrated term is xf-1(x)=xy. Then the last term is:

f(y)dy=xdy

So the whole equation reads:

ydx=xy-xdy

Or, a bit more symmetrically,

ydx+xdy=xy

3 Wait!? What was integration again?

Integration calculates (signed) area. Given a function y=g(x) then abydx calculates the area between g(x) and the x–axis over the interval [a,b].

Also given a function x=h(y) then cdxdy calculates the area between h(y) and the y–axis "over" the interval [c,d]. These are illustrated in the two graphs in Figure 1.

Figure 1: An integral with respect to x and an integral with respect to y

Now, what would happen if those two curves happened to be the same, as in Figure 2?

Figure 2: An intriguing pair of integrals

Well, then we would have:

abydx+cdxdy=bd-ac

This looks nice! When does this happen?

It happens precisely when the two functions are inverse to each other. That is, x=f(y) and y=f-1(x).

Which is where we came in.

The product rule is definitely lurking there in the background, but I find that this does neatly explain the connection between the two integrations. There is a clear connection between the integral of an inverse function and the integral of the original.

The final piece is to relate the limits, but that is straightforward. Since our focus is on f-1, it is most natural to write them as:

c=f-1(a)d=f-1(b)

4 Back to Logs

Let's work it through with ln(x). We'll do the definite integral, from which we can recover the indefinite by appropriate substitution of variables, but the definite helps keep the various letters in their correct roles.

Our relationship states that:

abydx+cdxdy=bd-ac

Substituting in y=ln(x) with limits d=ln(b) and c=ln(a), we get:

abln(x)dx+ln(a)ln(b)eydy=bln(b)-aln(a)abln(x)dx+[ey]ln(a)ln(b)=bln(b)-aln(a)abln(x)dx+eln(b)-eln(a)=bln(b)-aln(a)abln(x)dx=bln(b)-b-aln(a)+a

Switching to indefinite integrals, we get:

ln(x)dx=xln(x)-x+c

as expected.

5 Sign of the Times

One should always be a bit sceptical of a "proof by pictures". Here, the underlying assumptions in my pictures were that everything was positive: my limits a, b, c, d were all positive and my function was increasing3. What if it weren't so?

3positive derivative

One thing we must have is that the function be monotonic since it has an inverse. But all bets are off on everything else.

I shan't cover all possible cases, but here's an extreme to show that this still works. Consider the diagram in Figure 3.

Figure 3: Everything's just a bit negative

With Ai being the positive area of its region, we have:

abydx=A1+A3-A5cdxdy=A2-A3-A4

Note that since d<c then the second integral is the negative of what one might expect.

Adding these gives:

abydx+cdxdy=(A1+A2)-(A4+A5)

Since, in this example, a<0 and c>0, the positive area A1+A2 is equal to -ac. Similarly, the positive area A4+A5 is equal to -bd. Putting those together yields:

abydx+cdxdy=-ac-(-bd)=bd-ac

exactly as before.

6 Afterword

This came about from a conversation with a student about integration and sin-1. In fact, it was a misunderstanding on my part in that they meant the integration that has answer sin-1 whereas I thought they were asking about integrating sin-1 and it got me thinking as to how to actually do it. I'd just been teaching about inverse functions (to a different set of students) so the relationship between the graphs was at the forefront of my mind and the connection became very clear.

I'll need to think it through carefully, but this does feel like something quite teachable and might make that oNe wEiRd tRicK perhaps a little less mystifying.

Finally, everything I write on this website comes with the disclaimer that I make no claims to originality – all I require is that it catch my eye for some reason and that there be something for me to work through to make it worth recording.

I guess I'm keeping a record of the times when I was one of today's ten thousand and I publish them in case there's someone else out there in the same position.