Advanced Placement
Skip to the notes

AP Precalculus

Topic 2.12: Logarithmic Function Manipulation

Watch now21 min

Updated · For the May 2027 AP exam

The product, quotient and power properties of logarithms, and the change-of-base formula. Count every book in the Library of Babel, a number too big for any calculator, by adding logarithms.

Topic 2.12 key terms

logarithm as the length of a name
log⁡bN\log_b N is how many symbols you need to give NN things different names with an alphabet of bb symbols (exactly LL symbols name bLb^L things). In base 10, a number whose log is 3.…3.\ldots has 4 digits.
product property for logarithms
log⁡b(xy)=log⁡bx+log⁡by\log_b(xy)=\log_b x+\log_b y for x,y>0x,y>0: when the input multiplies, the log adds.
quotient property for logarithms
log⁡bxy=log⁡bx−log⁡by\log_b\frac{x}{y}=\log_b x-\log_b y for x,y>0x,y>0; it follows from the product property.
horizontal dilation = vertical translation
Every horizontal dilation of a log function, f(x)=log⁡b(kx)f(x)=\log_b(kx), is a vertical translation: f(x)=log⁡bk+log⁡bxf(x)=\log_b k+\log_b x.
power property for logarithms
log⁡b(xn)=nlog⁡bx\log_b(x^n)=n\log_b x for x>0x>0. Raising the input to a power nn is a vertical dilation by a factor of nn.
change of base property
log⁡bx=log⁡axlog⁡ab\log_b x=\dfrac{\log_a x}{\log_a b} for a>0a>0, a≠1a\ne1. So all logarithmic functions are vertical dilations of each other.
natural logarithm
ln⁡x=log⁡ex\ln x=\log_e x, the logarithm with the natural base e≈2.718e\approx2.718 (the LN key).

Transcript

2,631 words · 7 parts

Every book that could be written

In 1941 the writer Jorge Luis Borges imagined a library that goes on forever, gallery after gallery of identical six-sided rooms, and on its shelves sits every book that could possibly be written. Every book has four hundred and ten pages of the same twenty-five symbols, so almost every book you pull off a shelf looks like this one.

But since every arrangement is in here somewhere, so is every book ever written, and your next history essay is on one of these shelves, in lowercase and word for word, next to millions of copies with one typo each. And somewhere in here, there’s even a page about this lesson. It knows exactly what we’re about to do.

By the end of this lesson, you’ll count every different book in this library, a number so big that no pocket calculator on Earth can show it, using nothing but addition. Then you’ll find out why this library is useless. It holds every book ever written, and you could never find the one you’re looking for.

So before we count anything, I want your gut feeling. How many different books do you think are on these shelves? So let’s start with a blank page. We’ll add one character at a time.

Multiply by adding

For the very first character there are twenty-five choices, so a page can start in twenty-five different ways. Add a second character, and each of those starts can be followed by any of the twenty-five symbols, so now there are twenty-five times twenty-five, six hundred twenty-five. Every new character multiplies the count by twenty-five again, and just eight characters in we’re past a hundred fifty billion.

Now look at a second readout, the log of the count, base ten. Think of it as the number’s length, because a number whose log is three point something has four digits. Our count has twelve digits, and its log is eleven point one eight. And watch what the length does while the count multiplies by twenty-five. It just grows by the same one point four, every single time.

Let’s keep typing with a calculator next to the count. It keeps up for a while, but at the seventy-second character the count passes ten to the hundredth, and the calculator gives up. The length doesn’t even notice, and by the end of the first line, eighty characters, the number of possible lines is about a hundred twelve digits long. So multiplying the count turned into adding to its length, and that’s a pattern worth writing down.

Here are the first three counts, twenty-five, six hundred twenty-five and fifteen thousand six hundred twenty-five, with their logs. Going down, each count is the one above it times twenty-five, and each log is the one above it plus the same one point four. It’s even cleaner in the library’s own base, twenty-five, because then the log is just the number of characters, one, two and three.

Twenty-five times six hundred twenty-five is fifteen thousand six hundred twenty-five, and one plus two is three, so multiplying the counts added their logs, which makes sense, because one character followed by two more is three characters. It’s called the product property, and it says the log of a product is the sum of the logs, for any base and any positive x and y.

So why is it true? The proof takes two moves, using a rule we already know from exponents. Let’s give the two logs names, m for log base b of x and n for log base b of y, which means x is b to the m and y is b to the n. When we multiply them, multiplying powers of the same base adds the exponents, so x times y is b to the m plus n.

So the exponent that makes x times y is m plus n, which is exactly log of x plus log of y. Logarithms were first published in 1614 so astronomers could multiply huge numbers by adding, and when Henry Briggs finally met their inventor, John Napier, he reportedly said, I wonder nobody else found it out before, when, now known, it is so easy.

Division comes for free, because x over y, times y, is just x, so by the product property, the log of x over y, plus the log of y, gives back the log of x. That’s the quotient property. The log of a quotient is the log of the top minus the log of the bottom.

Let’s try one, and remember that a log with no base written means base ten. Which of these is the same as log of a thousand x?

Ten times the rooms

That answer has a picture hiding in it, so let’s number the library’s rooms, one, two, three, all the way up the shaft. Now let’s fly up the shaft, speeding up so that at every chime we’ve passed ten times as many rooms as before.

Ten rooms, a hundred, a thousand, a million, and every time the number of rooms multiplies by ten, the room numbers get exactly one digit longer. That’s the product property, because log of ten n is one plus log of n, and a library a hundred times bigger needs room numbers two digits longer. On a graph, that turns into something you might not expect, so let’s draw it.

Here’s y equals log base two of x, with points at one, two, four, eight and sixteen. Now let’s squeeze the graph toward the y-axis by a factor of four, so every point slides to a quarter of its input and keeps its height, and that’s the graph of log base two of four x. Compared with the original curve, it looks like the whole graph moved. Where did it end up?

Let’s measure the gap between the two curves at a few inputs, and it’s two, and two, and two again, the same everywhere. So instead of squeezing, let’s lift the original curve straight up by two, and look at that, it lands exactly on the squeezed one, because they’re the same curve. The product property says why, because log base two of four x is log base two of four plus log base two of x, and log base two of four is two.

Turn the squeeze up to eight and the lift is three, at sixteen it’s four, so the lift is always log base two of the squeeze. So on a log graph, every horizontal squeeze or stretch by a factor k is the same as a vertical shift, by log base b of k, and the exam likes to test exactly this picture.

A line, a page, a book

So, back to the library. Our first line is finished. A page is forty lines, and each of them can be any possible line, so the number of possible pages is forty copies of that line count multiplied together.

Multiplying turns into adding, so the length is forty line-lengths laid end to end, forty times about a hundred twelve, almost forty-five hundred digits. A book is four hundred ten pages, so its length is four hundred ten page-lengths laid end to end, and the number of possible books is one million, eight hundred thirty-four thousand and ninety-eight digits long.

That’s the answer to our bet. The number of different books has almost two million digits, so it isn’t infinite, but just printing that one number would take about one point four of these books. That was the same move three times. It deserves its own rule.

Take a hundred cubed, which is three copies of a hundred multiplied together, so by the product property its log is two plus two plus two, three times two. In general, the log of x to the n is n times the log of x. The exponent hops down in front, and that’s the power property. The proof is the same two moves. If x is b to the m, then x to the n is b to the m times n, so its log is n times m, which is n times log of x.

On the graph, here’s log base two of x, with its heights at two, four and eight. Square the input and every height doubles, so the whole graph stretches vertically by a factor of two. So raising the input to a power k stretches the graph vertically by k. But be careful, because log of x squared also works for negative x. At negative four it’s log base two of sixteen, which is four, while two log of negative four doesn’t exist, so the two only match when x is positive.

The power property lets us count something real. As I’m making this lesson, the largest prime number anyone has ever found is two to the power one hundred thirty-six million, two hundred seventy-nine thousand, eight hundred forty-one, minus one, found in October 2024. Use the power property and your calculator, and tell me how many digits this prime has.

Change the alphabet

Printed in books like Borges’s, those forty-one million digits fill thirty-one books and a bit, so this record prime fits on a single shelf, almost exactly. In binary, the same prime is a hundred thirty-six million ones in a row, and now it needs a hundred and four books, about three point three two times as many.

That three point three two is log base two of ten, how many binary digits it takes to do the work of one decimal digit, and it’s the same for every number. So let’s change the alphabet of the whole library. This dial sets how many symbols the books are written in, and right now it’s Borges’s twenty-five.

With only the ten digits, every book would need more characters to stay different from the others, so every book in the library swells, all by the same factor, about one point four. In binary, with only two symbols, every single book becomes four point six times as thick, about nineteen hundred pages each. No book swells more than any other. Changing the alphabet rescales every length by one number, and that’s a change of base.

Now it’s your turn with the dial. Find the alphabet that would make every book in the library exactly twice as thick as Borges’s.

Now watch the other direction, six hundred twenty-five symbols. Since that’s twenty-five squared, a lot of people expect every book to get twice as thick, but every book shrinks to exactly half, because each new symbol can stand for any pair of Borges’s symbols. So where does that factor come from? It’s the same formula your calculator needs.

Say y is log base b of x, which means b to the y is x. Now take the log of both sides in some other base a. The power property brings the y down in front. Divide by log base a of b, and there it is. Log base b of x is log base a of x over log base a of b, the change of base formula.

The bottom of that fraction doesn’t depend on x, so every log function is another log function times a constant, just as the dial swelled every book by one factor. The natural log, ln x, is log base e, where e is about two point seven one eight, and it’s the LN key on your calculator.

Here’s log base two beside it. At x equals eight, their heights divide to about one point four four. What happens to that ratio as I slide over to three, or out to eleven? It doesn’t budge. It’s always one over ln two, the constant in our formula, and that’s what it means for one log graph to be a vertical stretch of another.

So to find log base seven of twenty, put the natural log of twenty over the natural log of seven, which is about one point five four. That’s a sensible answer, because twenty sits between seven and forty-nine, so its log base seven has to be between one and two.

Now let’s do one about the library. To give a million books their own names in Borges’s symbols, the names need at least log base twenty-five of a million symbols. What is that, to two decimal places?

Rewrite it the AP way

On the AP exam these rules mostly show up as rewriting, pulling one log apart or packing several into one. Let’s pull apart log base three of nine x squared over y. It’s a product divided by y, so it splits into log of nine plus log of x squared, minus log of y.

Log base three of nine is two, and the power hops down in front, so it’s two plus two log x minus log y. Going the other way, three ln x minus one half ln x becomes ln of x cubed minus ln of the square root of x, which packs into one log, ln of x to the five halves, because three minus a half is five halves.

Now here’s a trap that catches a lot of students. The rules are about multiplying, never adding, so log of a plus b doesn’t split. Test it with numbers. Log base two of eight plus eight is log of sixteen, which is four, but adding the two logs would give six.

Funny enough, log of one plus two plus three really does equal log one plus log two plus log three, but only because one plus two plus three is also one times two times three. Here are two more look-alikes. Log of x, squared, isn’t two log x, and ln of eight over ln of two is a change of base, three, not ln of four.

On the 2025 AP exam, students had to rewrite log base two of x plus three log base two of two as a single logarithm. The power property turns three log of two into log of eight, and then the product property glues the two logs into log base two of eight x.

And that’s the picture we drew after the flight, because lifting the graph by three is the same as squeezing it by eight. So that exam question was really about this exact picture. Log base two of x, plus three, is true, but it wouldn’t earn full credit, because they asked for a single log, and it’s a good habit to write that x has to be positive.

Here’s one in the style of the exam. For x greater than zero, which of these is equivalent to ln of x to the fourth over e squared?

The address is the book

So let’s go back to the library for the last promise. Every book in here needs an address, a label that says exactly which book it is. The number of books has one million, eight hundred thirty-four thousand and ninety-eight digits, so to tell every book apart in our digits, the addresses need that many digits too.

Now change to the library’s own twenty-five symbols. Change of base divides the log of the count by log of twenty-five, and the address comes out exactly one million, three hundred twelve thousand symbols long, the length of one book. So the shortest addresses that can tell every book apart are as long as the books themselves, and to find the one you want, you’d already have to know it word for word.

In fact, if you number the books in alphabetical order, a book’s address in the library’s own symbols isn’t just as long as the book. It is the book. Every logarithm today was really the length of a name, and you counted every book that could ever be written, a number almost two million digits long, with nothing but addition.

Unit 2: Exponential and Logarithmic Functions

  1. 2.1Change in Arithmetic and Geometric Sequences
  2. 2.2Change in Linear and Exponential Functions
  3. 2.3Exponential Functions
  4. 2.4Exponential Function Manipulation
  5. 2.5Exponential Function Context and Data Modeling
  6. 2.6Competing Function Model Validation
  7. 2.7Composition of Functions
  8. 2.8Inverse Functions
  9. 2.9Logarithmic Expressions
  10. 2.10Inverses of Exponential Functions
  11. 2.11Logarithmic Functions
  12. 2.12Logarithmic Function Manipulation
  13. 2.13Exponential and Logarithmic Equations and Inequalities
  14. 2.14Logarithmic Function Context and Data Modeling
  15. 2.15Semi-log Plots