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=log_bxy = \\log\_b x. Equivalently:

y=log_bxiffby=x.y = \\log\_b x \\iff b^y = x.

Examples: log_28=3\\log\_2 8 = 3 because 23=82^3 = 8; log_101000=3\\log\_{10} 1000 = 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: log_b(xy)=log_bx+log_by\\log\_b(xy) = \\log\_b x + \\log\_b y.
  • Quotient rule: log_b(x/y)=log_bxlog_by\\log\_b(x/y) = \\log\_b x - \\log\_b y.
  • Power rule: log_b(xn)=nlog_bx\\log\_b(x^n) = n \\log\_b x.

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=log_bx+log_by\\alpha + \\beta = \\log\_b x + \\log\_b y. 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=log_ex\\ln x = \\log\_e x. The common logarithm uses base 1010: in many engineering contexts logx\\log x means log_10x\\log\_{10} x 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:

log_bx=dfraclog_cxlog_cb.\\log\_b x = \\dfrac{\\log\_c x}{\\log\_c b}.

This is how a calculator that only knows ln\\ln and log_10\\log\_{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=sump_ilog_2p_iH = -\\sum p\_i \\log\_2 p\_i 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 log_b(a)\\log\_b(a) and log_b(c)\\log\_b(c) as separate heights on the logarithm curve, then shows that their sum equals log_b(ac)\\log\_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 log_2(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, log_10(6)\\log\_{10}(6) equals log_10(2)+log_10(?)\\log\_{10}(2) + \\log\_{10}(?)? Switch to Product rule mode, set a=2,c=3,b=10a = 2, c = 3, b = 10, and confirm by hand that log_10(6)=log_10(2)+log_10(3)\\log\_{10}(6) = \\log\_{10}(2) + \\log\_{10}(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 log_b1=0\\log\_b 1 = 0 for every base? Why is log_bb=1\\log\_b b = 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: log_10(1+1)=log_10(2)approx0.301\\log\_{10}(1 + 1) = \\log\_{10}(2) \\approx 0.301, while log_10(1)+log_10(1)=0+0=0\\log\_{10}(1) + \\log\_{10}(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 Section 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.