Why Do Logarithms Work That Way?

Last time, we introduced logarithms by way of their history. Here, we’ll look at their properties.

Deriving the properties informally

Our first question, from 1997, asks about natural logarithms in particular, but gets a full, though informal, explanation of how logs work:

Natural Logs

Hello, 

I have tried for the past two weeks to find what I could on logs, and mostly natural logs, but have found nothing that I could understand.  I need to understand natural logs. Could you please explain them in the simplest terms possible? I don't understand what they are used for.  Are they used for other subjects in Math?

Doctor Steven answered:

Logarithms can be pretty tricky.  The thing to remember is that a logarithm is just another way to write an equation that looks like this:

   x = a^y.

You see, normally we like to write functions like y = something, but here we can't do that since the y is in the exponent. So what we do is create some notation that will let us write this like y = something.  This notation is the logarithm. 

We say log_a(b) is the log base a of b.
                             
And so we have y = log_a(x), which means the same thing as x = a^y .

In the usual notation, we say $$y=\log_a(x)\;\;\Leftrightarrow\;\;x=a^y$$

In other words, the (base a) logarithm is the inverse of the (base a) exponential function; it exists in order to solve exponential equations for a variable in the exponent, by “undoing” the exponentation.

This implies the inverse property, which can be expressed in two ways: $$\log_a(a^x)=x$$ $$a^{\log_a(x)}=x$$

It also leads to several special cases: $$\log_a(1)=\log(a^0)=0$$ $$\log_a(a)=\log(a^1)=1$$ $$\log_a\left(\frac{1}{a}\right)=\log(a^{-1})=-1$$

Let's do some examples:
          
 1. x = 10^4 is the same thing as log_10(x) = 4.
 
 2. x = 10^y is the same thing as log_10(x) = y

 3. x = e^y is the same as log_e(x) = ln(x) = y.

In the third example we see that the natural log is just log base e.

We saw last time that \(e\approx2.71828\) is a special number that makes a log with the special property that its slope at its y-intercept is 1.

What follows are largely proofs-by-example; we’ll see more precise derivations below.

Multiplication property

Now let's get into some properties of logarithms.  Say we have log_a(x) = 3. This is the same as a^3 = x. Say also we have log_a(y) = 4 - this means a^4 = y. What is log_a(x*y)?  Well multiply x and y and we get x*y = a^3*a^4.

When multiplying powers we add the exponent so x*y = a^(3 + 4).  So log_a(x*y) = 3 + 4 = log_a(x) + log_a(y).

So we have our first property of logs:

    log_a(x*y) = log_a(x) + log_a(y).

This property works for any numbers so

    log_4(20) = log_4(4*5) = log_4(4) + log_4(5) = 1 + log_4(5).

So the product property of exponents $$a^xa^y=a^{x+y}$$ becomes the product property of logarithms: $$\log_a(xy)=\log_a(x)+\log_a(y)$$ When we multiply numbers, we add the corresponding exponents, which are the logarithms.

Division property and power property

The second property is closely related to the first.  It states that:

    log_a(x/y) = log_a(x) - log_a(y).

The third property is also related to first property.  It states that:

    log_a(x^n) = n*log_a(x).

We can see this property by seeing that x^n = x*x*x*x.... (n times). So we get log_a(x^n) = log_a(x) + log_a(x) + . . . (n times) = n* log_a(x).

The quotient property of exponents $$\frac{a^x}{a^y}=a^{x-y}$$ becomes the quotient property of logarithms: $$\log_a\left(\frac{x}{y}\right)=\log_a(x)-\log_a(y)$$

When we divide numbers, we subtract the corresponding exponents, which are the logarithms.

As an example, since $$\frac{100,000}{100}=\frac{10^5}{10^2}=10^{5-2}=10^3=1000$$ we know that $$\log_{10}\left(\frac{100,000}{100}\right)=\log_{10}(100,000)-\log_{10}(100)=5-3=2$$

The power property of exponents $$\left(a^x\right)^n=a^{nx}$$ becomes the power property of logarithms: $$\log_a(x^n)=n\log_a(x)$$

When we raise a number to a power, we multiply the exponent, which is the logarithm.

As an example, since $$100^3=\left(10^2\right)^3=10^{2\cdot3}=10^6=1,000,000$$ we know that $$\log_{10}\left(100^3\right)=3\log_{10}(100)=3(2)=6$$

Summary

So we have 3 properties for logs:

 1. log_a(x*y) = log_a(x) + log_a(y)
 2. log_a(x/y) = log_a(x) - log_a(y)
 3. log_a(x^n) = n*log_a(x).

We use these properties to change an equation into the form we wish, to make it easier to work with.

I like to point out that taking logs turns multiplication, division, and exponentiation into addition, subtraction, and multiplication, respectively. We can diagram this:

PEMDAS, anyone? Applying logs moves us down one rung on the hierarchy of operations.

If you’re wondering about the missing companion of exponents on the top line, we can think of roots as the opposite of exponents, as division is the opposite of multiplication, giving a rule $$\log_a(\sqrt[n]{x})=\log_a(x^{1/n})=\frac{\log_a(x)}{n}$$ showing that when we take a root of a number, we divide the exponent, which is the logarithm. So we can fill out the diagram:

But we don’t need to learn this as a separate property, since we usually just rewrite a root as a fractional power.

This also reminds us that there is no property of logs that applies to the log of a sum or difference; there is no lower operation.

Changing the base

Another thing to worry about with logs is the change of base formula.  The reason we have a change of base formula is because your calculator probably only has buttons for log base 10 or the natural log of a number.  Unfortunately not many problems will have logs that are in base 10 or base e, so in order to find out the exact value for these problems we need to change the base of the logarithm to either 10 or e so we can plug them into our calculator.  The change of base formula goes like this:

                  log_10(b)
      log_a(b) = -----------
                  log_10(a)

or
                  ln(b)
      log_a(b) = -------
                  ln(a).

An easy way to remember which number goes on top is to note the b is above the a on the left side of the equation and on the right side it is still above the a.

Today, many calculators have a \(\require{AMSsymbols}\text{LOG}_\square\) button that lets you choose the base. But there are also other reasons to change bases. He forgot to show the reason for this formula; we’ll get to that soon. In general, the formula says $$\log_a(b)=\frac{\log_\square(b)}{\log_\square(a)}$$ where the box could be any base you want.

We’ll derive this formula below.

Let's do some examples of the change of base formula:

                 log_10(100)
 1. log_7(100) = -----------
                  log_10(7)


                  log_10(34)
 2. log_5.6(34) = -----------
                  log_10(5.6)


                   ln(1.7)
 3. log_2.3(1.7) = -------
                   ln(2.3)


You can plug these into your calculator to find the actual decimal value for these logarithms.

Sometimes, you don’t need a calculator to find a log to a different base; for example, since \(25^{1/2}=\sqrt{25}=5\). we know that \(\log_{25}(5)=\frac{1}{2}\). In such a case, the change of base formula provides a long way (useful as a check): $$\log_{25}(5)=\frac{\log_{10}(5)}{\log_{10}(25)}=\frac{0.69897}{1.39794}=0.5$$

Proving the rules more formally

Here’s a similar question, from 2001:

Logarithms' Relation to Exponents

I have a bunch of rules for logs, properties and suchlike, but I find it hard to remember them without a proof. My precalculus book has no proof of why logs work or even what they are, nor does my calculus book. I understand what logs are, and their relation to Euler's constant, but I don't understand why they are what they are. Please help me.

Doctor Fenton answered:

Hi Vid,

Thanks for writing to Dr. Math. The way I like to think about logarithms is that they are just another language for describing exponentials. In exponential language, we emphasize the base; logarithms emphasize the exponent. Each property of logarithms is just a property of exponentials, expressed from a new point of view in the logarithmic language.

I assume that you know the fundamental exponential properties: if a > 0, then

    (1)  a^m*a^n = a^(m+n)
    (2)  a^m/a^n = a^(m-n) 
and (3)  (a^m)^n = a^(m*n)   .

We’ll translate these three rules into log terms:

If a^x = X (note the capital and lower case letters: x is the exponent, and X is a raised to that exponent), then we can rephrase this as

   log_a (X) = x ,

where log_a denotes the logarithm to the base a.

This logarithmic statement is exactly a restatement of the exponential relation a^x = X .

For any variable in upper case, we’ll use lower case for the corresponding exponent (that is, log). This makes the relationships easy to keep track of.

Logarithmic properties are likewise just restatements of the exponential properties above. To translate, suppose

(*)    a^x = X    and  a^y = Y .

Restating these relations as logarithms gives

(**)    log_a (X) = x   and log_a (Y) = y.

Now we make those substitutions in the exponent properties.

Product rule

Then exponent rule (1), which says that a^x * a^y = a^(x+y) can be written as

   X * Y = a^x * a^y = a^(x+y) , which can be restated as

   log_a (X*Y) = x + y . 

Substituting for x and y using (**) gives the first rule for logarithms,

 (1')  log_a (X*Y) = log_a (X) + log_a (Y) .

$$a^xa^y=a^{x+y}$$ becomes $$\log_a(XY)=\log_a(X)+\log_a(Y)$$

In exponent form, we can say that product of powers is the power of the sum; in log form, we say that the log of a product is the sum of the logs. Or you might say, multiplying powers adds the exponents, and multiplying numbers adds the logs.

Quotient rule

Exponent rule (2)  becomes

   X/Y = a^x / a^y = a^(x-y)

so

   log_a (X/Y) = x - y , or

 (2') log_a (X/Y) = log_a (X) - log_a (Y) .

$$\frac{a^x}{a^y}=a^{x-y}$$ becomes $$\log_a\left(\frac{X}{Y}\right)=\log_a(X)-\log_a(Y)$$

Dividing numbers subtracts the logs.

Power rule

Finally, exponent rule (3) becomes

   X^n = (a^x)^n

       = a^(x*n) , which can be restated as

   log_a (X^n) = x*n , or

 (3') log_a (X^n) = n * log_a (X) .

Those are the basic properties of logarithms. Any additional properties you need can be derived from these.

$$\left(a^x\right)^n=a^{nx}$$ becomes $$\log_a(X^n)=n\log_a(X)$$

Deriving the change of base formula

A 2007 question gets to the formula we mentioned, but didn’t prove, above:

Deriving the Change of Base Formula for Logarithms

In my Pre-Calculus class we have been learning about the properties of logarithms.  Since calculators have only two bases--base 10 and base e, we have learned how to change the base of a logarithm using this formula:

           log x
              b
log x =  ----------
   a       log a
              b

I know how to use this formula, but I have no idea why it works.  Can someone give me a proof explaining why this works?  Thanks a lot.

I answered:

Hi, Joe.

It's not too hard to prove, though the notation can get messy!  I often accidentally derive the formula in the course of solving logarithmic equations.

Let's start by calling the log we're looking for y:

  log_a(x) = y

Now we write that in exponential form:

  x = a^y

(That is, I raised the base a to the exponent on each side of the original equation.)

This relationship expresses the fact that the logarithm is the inverse of the exponential function.

Now we want to solve this equation for y, using only base b logs, not base a logs.  To do this, we take the log of each side:

  log_b(x) = log_b(a^y)

Now we simplify the right side:

  log_b(x) = y log_b(a)

Here we have used the power rule.

To get y by itself, we just have to divide both sides by log_b(a):

  log_b(x) / log_b(a) = y

Substituting log_a(x) back in for y we have:

  log_a(x) = log_b(x) / log_b(a)

And we're done!

$$\log_a(x)=\frac{\log_b(x)}{\log_b(a)}$$

As you can see, the formula is just the natural result of solving using an available log; that's why I so often get a result looking like this, and then slap myself on the head and say, "I coulda used the base-change formula!".

For example, suppose I were solving the equation $$4^x=5$$

I could solve that by taking the base-4 log of both sides, $$\log_4(4^x)=\log_4(5)\\x=\log_4(5)$$

But then I realize I want a decimal value, and my calculator lacks a general log button. So I try again, using base 10: $$\log_{10}(4^x)=\log_{10}(5)\\x\log_{10}(4)=\log_{10}(5)\\x=\frac{\log_{10}(5)}{\log_{10}(4)}\approx\frac{0.69897}{0.60206}\approx1.16096$$

But the work I did is identical to the change of base formula.

There are a couple special cases worth observing. If we take x itself as the new base, we get what we might call the “base exchange formula”: $$log_a(x)=\frac{1}{log_x(a)}$$

If we raise the base to a power, we get $$\log_{a^n}(x)=\frac{\log_{a}(x)}{\log_{a}(a^n)}=\frac{\log_{a}(x)}{n}$$

And if we raise both base and argument to the same power, we leave the result unchanged: $$\log_{a^n}(x^n)=\frac{\log_{a}(x^n)}{\log_{a}(a^n)}=\frac{n\log_{a}(x)}{n}=\log_{a}(x)$$

And what if we take the reciprocal of the base? $$\log_{1/a}(x)=\frac{\log_{a}(x)}{\log_{a}(1/a)}=\frac{\log_{a}(x)}{-1}=-\log_{a}(x)$$

It’s not quite so simple

We’ve stated the properties briefly, as we often do; but that misses some subtleties brought out by this 2002 question:

Error in One of the Laws of Logarithms?

We were discussing a problem in precalculus today and seemed to discover a basic flaw in one of the exponent laws.  Recall:

   log(x^2) = 2log(x)

It is also a fact that the log functions have a domain restriction on all values less than or equal to zero.

However:

For log(x^2), the only value that is restricted (less than or equal to zero) is zero itself (log(0^2) = log(0)).

For 2log(x), which should supposedly be the same function by the law stated above, there are restrictions on all values of X less than or equal to zero.

Basically, what it comes down to is that negative numbers are an acceptable input for the function before you apply the law, and negative numbers are no longer an acceptable input after you apply the law. This means that the two functions are not the same, and inherently disproves that law of logarithms. Doesn't it?

We're thoroughly perplexed, and resorted to the Internet for assistance.

Two functions are considered the same only if they have the same values for all inputs, which implies that they have the same domain (the same “all inputs”). But when we apply this rule, we change the domain!

Here, for example, if we take \(x=-1\), then $$\log\left(x^2\right)=\log\left((-1)^2\right)=\log(1)=0$$ but $$2\log(x)=2\log(-1)\text{ is not defined}$$ Is the rule wrong?

I answered:

Hi, Charles.

You haven't shown that the law is wrong, but only that it has an implicit restriction:

    log(a^b) = b log(a)
    for all a and b for which both logarithms are defined

If a is negative and b even, then the left side is defined but the right side is not. You are taking the property to mean that the function on the left is identical to the function on the right, including having the same domain; but that's not what it means. It is only a pointwise identity (true for one pair of values at a time), not a statement about the two functions as a whole.

One effect of this is that in solving equations involving logs, we can inadvertently change the domain, so that a value that is valid in the original equation is no longer valid in the new equation, or (more often) vice versa.

The same can be said of the other logarithm identities, such as

    log(ab) = log(a) + log(b)

where, if a and b are both negative, the left side is defined but the right is not.

For example, if we take \(a=-2\) and \(b=-5\), then $$\log(ab)=\log((-2)(-5))=\log(10)=1$$ but $$\log(a)+\log(b)=\log(-2)+\log(-2)\text{ is not defined}$$

We even face the same problem with simpler facts:

    (sqrt(x))^2 = x

is true whenever sqrt(x) is defined; it is not wrong just because there are values of x for which only the right side is defined. We just have to clearly state the restriction: "for all x >= 0" .

Domain issues in solving equations

This issue is mentioned in the context of solving equations (where it can cause either missed solutions or extraneous solutions) in Extraneous Solutions: Causes and Cures. Here is a 2005 question that was linked there:

Are Properties of Logarithms Missing Something?

I have a question about using the properties of logs to solve equations.  For example, I can solve this equation in two ways:

  ln x^2 = -7
  e^(ln x^2) = e^(-7)
  x^2 = e^(-7)
  x = plus or minus (e^(-7/2))

or

  ln x^2 = -7
  2 ln x = -7
  ln x = -7/2
  x = e^(-7/2)

Using the second method, you only get the positive answer.  Where did I lose the negative answer?  Why is this not taken into account when using properties like this are discussed?

The first time, Sara raised e to the power on each side of the equation, then took the square root(s) to find both solutions, \(\pm e^{-7/2}\). The second time, she applied the power rule first, and didn’t need to take a root, but only got the positive solution. What happened?

I answered:

Hi, Sara.

Good question!  This is a fact that is sometimes swept under the rug: when you apply some of these properties, the domain of the expression changes.  In particular, although

  log(a^n) = n log(a)

for any a and n for which both sides are defined, the left side is defined when a < 0 and n is even, but the right side is not.  So in applying the property, you lose negative values of a.

Sometimes books mention this, but then avoid it by specifying that the variable is positive when giving equations to solve.  Some books may not mention it at all, which is not a good idea.

In applying the property, she reduced the domain of the problem, implicitly assuming x is positive.

Another way it could be dealt with would be to use the following when n is even:

  log(a^n) = n log|a|

Authors probably don't want to subject their students to a mix of absolute values and logs, which would be too much for many of us!  But this would retain all solutions in your problem:

  ln x^2 = -7
  2 ln |x| = -7
  ln |x| = -7/2
  |x| = e^(-7/2)
  x +- e^(-7/2)

I’m quite sure I’ve never seen the property stated this way, which is similar to the fact that \(\sqrt[n]{x^n}=|x|\) for even index n.

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.