NebulaNumerica

Logarithms with another base

A calculator usually has two logarithm keys: log for base 10, which we write lg, and ln for base e. But what if you need log₂ of a number, say to find how many times something must double? And how are lg and ln related? Both answers come from one short argument.

lg from ln

Take any positive number x. By the meaning of lg, from What a logarithm is, x is 10 to the power lg x:

x equals 10 to the power lg of x

Now take ln of both sides. On the right, the power comes down in front as a factor, by the third law in The laws of logarithms:

ln of x equals lg of x times ln of 10

Divide both sides by the number ln 10, and

lg of x equals ln of x over ln of 10

So lg is simply ln divided by a fixed number, ln 10, which is about 2.30. The two logarithms are the same curve, squeezed by different amounts.

lg x is ln x divided by the number ln 10.

Any base

The argument works for any base a, not just 10. Start from x equals a to the power log base a of x and take ln of both sides, and

log base a of x equals ln of x over ln of a

lg works just as well as ln on the right, as long as the same one is used on top and below. So a calculator with only lg can still find

log base 2 of 8 equals lg of 8 over lg of 2

which is 3, as it should be, since 2 cubed equals 8. And for how many doublings it takes to grow a thousandfold, log base 2 of 1000 is lg 1000 divided by lg 2, which is 3 divided by about 0.30: just under 10.

Where this is used

The derivative of lg comes from this. Since lg x is ln x divided by ln 10, its derivative is 1 over x divided by ln 10, as in The derivatives to know by heart:

the derivative with respect to x of lg of x equals 1 over x times ln of 10

To change the base, divide by the logarithm of the base: logₐ x is ln x divided by ln a, and lg or ln both work.

Practise Exponentials and logarithms

How was this article?

0 of 2000