Logarithmic Functions

Part 14, Chapter 14: Functions and Their Graphs

Learning objectives

  • Define the logarithm as the inverse of the exponential
  • Evaluate logarithms of perfect powers
  • Apply the three laws of logarithms
  • Solve equations involving logarithms

A logarithm answers the question "what exponent?" Multiplication is repeated addition; exponentiation is repeated multiplication; and the logarithm undoes that repeated multiplication by counting how many times you had to multiply. Once you internalise that, the three laws of logarithms read like obvious arithmetic facts about exponents in disguise.

Definition by inversion

For b>0b > 0, bneq1b \neq 1, the logarithm base bb of xx is the unique number yy satisfying by=xb^y = x. We write y=logbxy = \log_b xbx. Equivalently:

y=logbxiffby=x.y = \log_b x \iff b^y = x.bxiffby=x.

Examples: log28=3\log_2 8 = 3 because 23=82^3 = 8; log101000=3\log_{10} 1000 = 3101000=3 because 103=100010^3 = 1000; log_51=0\log_5 1 = 0 because 50=15^0 = 1.

The three laws

For positive xx and yy:

  • Product rule: logb(xy)=logbx+logby\log_b(xy) = \log_b x + \log_b yb(xy)=logbx+logby.
  • Quotient rule: logb(x/y)=logbxlogby\log_b(x/y) = \log_b x - \log_b yb(x/y)=logbxlogby.
  • Power rule: logb(xn)=nlogbx\log_b(x^n) = n \log_b xbx.
  • Why do these hold? Write x=balphax = b^{\alpha} and y=bbetay = b^{\beta}; then xy=balpha+betaxy = b^{\alpha + \beta}, so its logarithm is alpha+beta=logbx+logby\alpha + \beta = \log_b x + \log_b yby. Each rule is just a restatement of an exponent rule, viewed through the logarithm lens.

    Two special bases

    The natural logarithm uses base ee: lnx=logex\ln x = \log_e xex. The common logarithm uses base 1010: in many engineering contexts logx\log x means log10x\log_{10} x10x by convention. (Pure-math texts often use logx\log x for lnx\ln x instead. Check the convention of the book you are reading.)

    Change of base

    To convert from base bb to base cc:

    logbx=dfraclogcxlogcb.\log_b x = \dfrac{\log_c x}{\log_c b}.bx=dfraclogcxlogcb.

    This is how a calculator that only knows ln\ln and log10\log_{10}10 can compute log_213\log_2 13: as dfracln13ln2\dfrac{\ln 13}{\ln 2}.

    Where this shows up
    • Information Theory: The Shannon entropy H=sumpilog2piH = -\sum p_i \log_2 p_iilog2pi measures information content in bits; the logarithm here is the same one you are learning, and it shows up in every compression algorithm (gzip, zstd, mp3).
    • Chemistry: The pH scale is -\log_{10}[H^+]; pH 4 is ten times more acidic than pH 5 because of the logarithm. Same trick on the Richter scale (earthquakes), decibel scale (sound), and apparent magnitude (stars).
    • Algorithms: Binary search is O(logn)O(\log n) because doubling the input adds one step; the same logarithm explains why a sorted array of one trillion items can be searched in under 40 comparisons.
    • (Switch the widget to Product rule mode and slide aa and cc. The widget draws logb(a)\log_b(a)b(a) and logb(c)\log_b(c)b(c) as separate heights on the logarithm curve, then shows that their sum equals logb(ac)\log_b(ac)b(ac). The product rule is the law made geometric.)

      Solving logarithmic equations

      To solve log_5x=3\log_5 x = 3, convert to exponential form: x=53=125x = 5^3 = 125. To solve log2(x+1)=5\log_2(x + 1) = 5, the same trick gives x+1=25=32x + 1 = 2^5 = 32, so x=31x = 31. The general technique: exponential-and-logarithm undo each other, so to remove a logarithm, exponentiate; to remove an exponential, take a logarithm.

      Try it

      • Predict first: by the product rule, log10(6)\log_{10}(6)10(6) equals log10(2)+log10(?)\log_{10}(2) + \log_{10}(?)10(?)? Switch to Product rule mode, set a=2,c=3,b=10a = 2, c = 3, b = 10, and confirm by hand that log10(6)=log10(2)+log10(3)\log_{10}(6) = \log_{10}(2) + \log_{10}(3)10(6)=log10(2)+log10(3).
      • Switch the base to b=eb = e (slide bb to about 2.722.72). Pick a value xx on the log curve and verify elnx=xe^{\ln x} = x.
      • Compute log_927\log_9 27 by hand using the change-of-base formula in two different ways (base 3, then natural log), you should get 3/23/2.
      • Pause: why is logb1=0\log_b 1 = 0b1=0 for every base? Why is logbb=1\log_b b = 1bb=1? Tie both to the exponential definition.

        Try it in code

        A trap to watch for

        The single most common error in pre-calculus: writing log(a+b)=loga+logb\log(a + b) = \log a + \log b. This is wrong. The product rule says log(acdotb)=loga+logb\log(a \cdot b) = \log a + \log b, the inside is a product, not a sum. Test: log10(1+1)=log10(2)approx0.301\log_{10}(1 + 1) = \log_{10}(2) \approx 0.30110(2)approx0.301, while log10(1)+log10(1)=0+0=0\log_{10}(1) + \log_{10}(1) = 0 + 0 = 010(1)=0+0=0. These are not equal. There is no nice identity for the logarithm of a sum; if a problem hands you log(a+b)\log(a + b), leave it. The trap exists because log\log looks like a linear operator (it is written before an argument, like a function), but its action on multiplication, not addition, is what produces the nice identity.

        What you now know

        You can convert between logarithmic and exponential form, apply the three laws to simplify expressions, change base when needed, and solve simple logarithmic equations by exponentiating. The next chapter generalises functions to mappings between abstract sets, the same definition you learnt in 13.1, but stripped of any reliance on numbers, ready for the rest of mathematics.

        Quick check

        Mark section complete →

        References

        • Lang, S. (1971). Basic Mathematics. Springer. Chapter 13 §5, logarithms defined as inverses of exponentials.
        • Stewart, J. (2015). Calculus: Early Transcendentals, 8th ed. Cengage. Section 6.3: the three laws and change of base.
        • Apostol, T. M. (1967). Calculus, Volume I, 2nd ed. Wiley. Chapter 6: rigorous construction of lnx\ln x as an integral and the resulting identities.

        This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.