Exponentials and Logarithms

C2: Exponentials & Logarithms


Graphs of y = ax

Functions such as f (x) = 2x and f (x) = 8x are called exponential functions.

The word exponential has come to be used to describe anything that grows very quickly and soon gets out of control. One look at the graphs of y = ax will let you see why.

This graph starts with the graph of y = 4x. You can drag the point along the axis to change the value of the base from 4.

You should notice some things about the curve.

That's all for now. Let's move on to the inverse of this function: the logarithm


Logarithms

Most functions have an inverse function (more about this in C3). The inverse of "add 3" is "subtract 3", the inverse of "square" is "square-root", the inverse of "sine" is "arcsine" or "sin-1".

Exponential functions like those above also have an inverse. It's called logarithm.

Confused? Have a look at this table where each row says the same thing in two different ways.

y = x + 3 x = y - 3
y = sin x x = arcsin y
y = x2 x = √y
y = 4x x = log4 y
y = 8x x = log8 y

So, you see that logarithms are just another way of writing powers.

We read the last line as "log to base 8 of y"

So, logarithms are just the inverse of "to the power". But we could look at it the other way and say that powers are the inverse of logarithms. Logarithms certainly came before index notation.

Logarithms were invented in the late 1500s by Scottish mathematician John Napier.

The time was ripe for the sort of invention that would simplify the (often tedious) long multiplication that was becoming more and more necessary in science. Indeed Johannes Kepler was one of the first physicists to popularise the use of logarithms with his work on Planetary Motion.

Napier was a great inventer, but his greatest of all inventions was logarithms. He transformed long multiplication into addition and his invention would be used by all scientists and engineers up until the popularisation of electronic calculating machines in the latter part of the 20th century.

How do they work? Look at this table.

n 1 2 3 4 5 6 7 8 9 10
2n 2 4 8 16 32 64 128 256 512 1024

We can use the table to quickly calculate 16 × 32. How? By reading the logarithm (to base 2) of 16 (it's 4) and adding this to the logarithm of 32 (it's 5). This gives 9. Then we just read off which number has a logarithm of 9 (it's 512).

So without doing any multiplication we have calculated 16 × 32 = 512.

Big deal. Now use the table to work out 17 × 39. Not so easy now is it?

Napier realised that there was nothing particularly special about the number 2 other than it was simple to make the table. The problem is that most numbers aren't even in it. He quickly realised that a better base for his logarithms would be one that ended up with all numbers in the table.

Here's the table for base 1.1 (to 3 dp):

n 1 2 3 4 5 6
1.1n 1.1 1.21 1.331 1.464 1.611 1.772

If we continued this table for ages, at least more numbers would be in it than the base 2 one. We can now see that 1.949 × 1.21 = 2.358.

Roughly. But there are still too many gaps.

Napier decided that he needed a number marginally greater than 1. He chose 1.0000001. You can hopefully imagine how difficult it was to come up with the table for 1.0000001n but it was done over a number of years and science has never looked back.

Napier's idea led to an even faster way of multiplying. Logarithms work (as we have seen) by converting a multiplication problem into addition. Rather than have the numbers in a huge table, why not have them on a handy ruler. Then instead of adding numbers, all we need to do was add lenths on a ruler.

I have a slide rule that occasionally gets dusted off to show students. Of course nobody uses them nowadays, what with electronic machines and so on, but 40 years ago they were still a big part of an engineers life and they simplified many calculations.

I have just noticed that HP claim Napier invented logarithms in 1614. Oh well, I'll get me facts right in future.

Laws of Logarithms

Once you are happy with what logarithms are, it becomes easy to figure out the rules that go with them.

From our example above, if we want to calculate 16 × 32 we add the logarithms of the numbers and then that answer is the logarithm of 16 × 32.

n 1 2 3 4 5 6 7 8 9 10
2n 2 4 8 16 32 64 128 256 512 1024

log2 16 + log2 32 = log2 512

In general: loga n + loga m = loga mn

We can also see the equivalent rule for division. If I want to use the base 2 table to calculate 512 ÷ 32, I find the logarithms (9 and 5) and subtract to get the logarithm of the answer (4 so the answer is 16)

In general: loga m - loga n = loga m/n

Finally, to find 83, we find the logarithm of 8 (3) and multiply it by 3 to get the logarithm of the answer (9, so 83 = 512)

In general: nloga m = loga mn

All of these results could be derived from the laws of indices discussed in C1. I won't bother to do this here because it's easy to see the rules once you understand what logarithms are.

Change of Base

And now a big problem. What if we don't have that table for powers of 2? What if we want logarithms to base 3? Or 10?

All scientific machines have 2 log buttons. One says "log" the other, which is next to it, says "ln". For now, we'll only use the "log" button.

To change the base to the one on our machine we need a simple adjustment. Let's see where this comes from...

eg. Use a machine to find log5 30.

I know that 52 = 25 and 53 = 125, so the logarithm of 30 is between 2 and 3. Call this number y

Then 5y = 30. Take logarithms of both sides to base 10 (because that's the base on the machine)

log10 5y = log10 30. Use one of our rules for logarithms...

y log10 5 = log10 30. Now make y the subject.

y = log10 30 / log10 5

In other words: to change the base to a nice number (usually 10)...

  1. Replace the old base with the new
  2. Divide by the log of the old base

Using Logarithms To Solve Equations

Logarithms are used in many areas. Listed below are a few off the top of my head...

They crop up in many areas of pure mathematics as well. In C3 you will come across more logarithmic delights.

I'll now make a clip of exam questions. I bet I will only use the three rules for logarithms that we established in the last section. Have a go at the logarithm questions from Jan 2009, May 2006 and Jan 2005.