Skip to content
EN - Language: English
MathematicsHigh school

Exponential functions and logarithms - explained step by step

· 14 min read

In short

An exponential function y = aˣ multiplies by the same number a each time x goes up by 1, so it grows (or shrinks) faster and faster. A logarithm answers the opposite question - logₐ b is the power you raise a to, to get b, so log₂ 8 = 3 because 2³ = 8. The graph of y = logₐ x is the mirror image of y = aˣ in the line y = x.

Words to know

Exponential function
A function f(x) = aˣ with a base a > 0, a ≠ 1. The variable sits in the exponent.
Base and exponent (index)
In aˣ, a is the base and x is the exponent, also called the power or the index.
Logarithm
logₐ b is the exponent you raise a to, to get b. logₐ b = c means the same as aᶜ = b.
Asymptote
A line that a graph gets closer and closer to without ever reaching it. For y = aˣ it is the x axis.
Inverse function
A function that undoes another one. logₐ x undoes aˣ, and their graphs are mirror images in the line y = x.
Natural logarithm
ln x, the logarithm to base e, where e ≈ 2.718.

What do you think?

Water lilies are spreading across a pond, and the area they cover doubles every day. On day 30 the whole pond is covered. On which day was half of it covered?

The idea: multiply instead of add

A linear function adds the same number at every step: y=2x+1y = 2x + 1 goes 1,3,5,71, 3, 5, 7. An exponential function multiplies by the same number: y=2xy = 2^x goes 1,2,4,81, 2, 4, 8. The number you multiply by is the base aa, and xx sits in the exponent:

f(x)=axf(x) = a^x

Each step of 1 to the right multiplies the value by aa, because ax+1=a⋅axa^{x + 1} = a \cdot a^x. With a>1a > 1 the function grows faster and faster, and with 0<a<10 < a < 1 it shrinks towards zero. That is why exponential functions describe anything that grows or shrinks by the same factor in equal times: bacteria that double every hour, money earning compound interest, a radioactive substance that decays.

A logarithm answers the opposite question. You know the base and the result, and you want the exponent: 2 to what power gives 8? The answer is written log⁡28=3\log_2 8 = 3, because 23=82^3 = 8. The two functions undo each other, and the animation shows what that does to their graphs: one is the mirror image of the other.

From 2ˣ to log₂ x, step by step

Go through the animation with the buttons or the arrow keys. The teal graph is y=2xy = 2^x, and the amber one appears when we turn it over.

-4-2246810-22468×2×2×2+1+1+1121 + 2y = 2ˣy = (1/2)ˣ2ˣ = 8y = xy = log₂ x

2⁰ = 1 · 2¹ = 2 · 2² = 4 · 2³ = 8

Step 1 of 7
Steps of the animation. Arrow keys move between steps.

Start at 1 and keep doubling: 2⁰ = 1, 2¹ = 2, 2² = 4, 2³ = 8. Each step of 1 to the right multiplies the height by 2. This is the exponential function f(x) = 2ˣ.

Every point (x,y)(x, y) of the graph of y=2xy = 2^x became the point (y,x)(y, x) of the graph of y=log⁡2xy = \log_2 x. That is what “the two functions undo each other” means: what 2x2^x does to a number, log⁡2x\log_2 x takes back.

log⁡2(2x)=x2log⁡2x=x\begin{aligned} \log_2 (2^x) &= x \\ 2^{\log_2 x} &= x \end{aligned}

The second line holds for x>0x > 0, because only positive numbers have a logarithm.

Try it yourself: change the base

Set the base aa and the point PP on the graph of y=axy = a^x. The amber graph is its mirror image in the line y=xy = x: the logarithm with the same base. The point P′P' has the coordinates of PP swapped, so its height is a logarithm.

-4-2246810-22468PP′
Show
a = 2
x = 1
Exponential function
f(x) = 2ˣ
Logarithmic function
g(x) = log₂ x
One step to the right
y × 2 - increasing
Point P on y = aˣ
P = (1, 2)
Its mirror image in y = x
P′ = (2, 1)
The logarithm P′ shows
log₂ 2 = 1

What to notice:

  • with a>1a > 1 the graph rises, and the larger aa is, the steeper it climbs. With 0<a<10 < a < 1 it falls,
  • set a=2a = 2 and then a=0.5a = 0.5: the two graphs are mirror images in the y axis,
  • every graph of y=axy = a^x goes through (0,1)(0, 1), and every graph of y=log⁡axy = \log_a x through (1,0)(1, 0),
  • the dashed segment from PP to P′P' meets the line y=xy = x at a right angle, halfway along,
  • with a=1a = 1 there is nothing to turn over: 1x=11^x = 1 for every xx.

The definitions

An exponential function is a function f(x)=axf(x) = a^x, where a>0a > 0 and a≠1a \neq 1. It is defined for every real number xx, and all its values are positive. Its graph goes through (0,1)(0, 1), and the x axis is its horizontal asymptote. With a>1a > 1 the function is increasing, and with 0<a<10 < a < 1 it is decreasing.

The logarithm of a positive number bb to the base aa (where a>0a > 0 and a≠1a \neq 1) is the exponent you raise aa to, to get bb:

log⁡ab=c  ⟺  ac=b\log_a b = c \iff a^c = b

For example, log⁡101000=3\log_{10} 1000 = 3 because 103=100010^3 = 1000, and log⁡5125=−2\log_5 \frac{1}{25} = -2 because 5−2=1255^{-2} = \frac{1}{25}. The logarithmic function g(x)=log⁡axg(x) = \log_a x is defined only for x>0x > 0. Its graph goes through (1,0)(1, 0), and the y axis is its vertical asymptote. It is the inverse of axa^x, so the two graphs are mirror images in the line y=xy = x.

The laws of logarithms. For x>0x > 0, y>0y > 0 and any number kk:

log⁡a(xy)=log⁡ax+log⁡aylog⁡axy=log⁡ax−log⁡aylog⁡axk=klog⁡ax\begin{aligned} \log_a (xy) &= \log_a x + \log_a y \\ \log_a \tfrac{x}{y} &= \log_a x - \log_a y \\ \log_a x^k &= k \log_a x \end{aligned}

They come from the laws of indices. A logarithm is an exponent, and multiplying powers adds their exponents: am⋅an=am+na^m \cdot a^n = a^{m + n}. The change of base rule turns a logarithm into a fraction of two logarithms with a base you like:

log⁡ab=log⁡cblog⁡ca\log_a b = \frac{\log_c b}{\log_c a}

For example, log⁡832=log⁡232log⁡28=53\log_8 32 = \frac{\log_2 32}{\log_2 8} = \frac{5}{3}. Two bases have their own symbols. Without a written base, log⁡x\log x at school usually means log⁡10x\log_{10} x. The natural logarithm ln⁡x\ln x is the logarithm to base ee, where e≈2.718e \approx 2.718.

Example 1: the laws of logarithms

Work out log⁡69+log⁡64\log_6 9 + \log_6 4 without a calculator.

Step 1. Use the product law

Two logarithms with the same base add up to the logarithm of the product.

log⁡69+log⁡64=log⁡6(9⋅4)\log_6 9 + \log_6 4 = \log_6 (9 \cdot 4)

Step 2. Multiply inside the logarithm

We work out the product.

log⁡6(9⋅4)=log⁡636\log_6 (9 \cdot 4) = \log_6 36

Step 3. Find the exponent

We ask: 6 to what power gives 36? Since 62=366^2 = 36, the answer is 2.

62=36log⁡636=2\begin{aligned} 6^2 &= 36 \\ \log_6 36 &= \boxed{2} \end{aligned}

Answer

log⁡69+log⁡64=2\log_6 9 + \log_6 4 = \boxed{2}. Neither log⁡69\log_6 9 nor log⁡64\log_6 4 is a whole number, but their sum is.

Example 2: when will there be 8000 bacteria?

A culture starts with 500 bacteria, and their number doubles every 3 hours. After how many hours will there be 8000?

Step 1. Write the formula

In tt hours the culture doubles t3\frac{t}{3} times, and each doubling multiplies the number by 2.

N(t)=500⋅2t/3N(t) = 500 \cdot 2^{t/3}

Step 2. Set it equal to 8000

We want N(t)=8000N(t) = 8000. Then we divide both sides by 500.

500⋅2t/3=80002t/3=16\begin{aligned} 500 \cdot 2^{t/3} &= 8000 \\ 2^{t/3} &= 16 \end{aligned}

Step 3. Find the exponent

The exponent is the logarithm of 16 to base 2, and 16=2416 = 2^4.

t3=log⁡216t3=4\begin{aligned} \tfrac{t}{3} &= \log_2 16 \\ \tfrac{t}{3} &= 4 \end{aligned}

Step 4. Solve for t

We multiply both sides by 3.

t=12t = \boxed{12}

Answer

After 12\boxed{12} hours there will be 8000 bacteria. That is four doublings: 500, 1000, 2000, 4000, 8000.

Your turn

Solve the equation 9x=279^x = 27.

Hintshow

Both 9 and 27 are powers of 3. Write both sides as powers of 3, and then compare the exponents.

Solutiontry it on your own first

Step 1. Write both sides as powers of 3

We use 9=329 = 3^2 and 27=3327 = 3^3.

(32)x=33(3^2)^x = 3^3

Step 2. Multiply the exponents

A power of a power multiplies the exponents.

32x=333^{2x} = 3^3

Step 3. Compare the exponents

The function 3x3^x is increasing, so two powers of 3 are equal only when their exponents are equal.

2x=3x=32\begin{aligned} 2x &= 3 \\ x &= \boxed{\tfrac{3}{2}} \end{aligned}

Step 4. Check the answer

We put x=32x = \frac{3}{2} back into the left-hand side. A power of 32\frac{3}{2} is the cube of the square root.

93/2=(9)3=33=27\begin{aligned} 9^{3/2} &= (\sqrt{9})^3 \\ &= 3^3 = 27 \end{aligned}

Answer

x=32=1.5x = \frac{3}{2} = 1.5. In the language of logarithms, log⁡927=32\log_9 27 = \frac{3}{2}.

Common mistakes

  • Splitting the logarithm of a sum. log⁡a(x+y)\log_a (x + y) is not log⁡ax+log⁡ay\log_a x + \log_a y. For example, log⁡2(4+4)=log⁡28=3\log_2 (4 + 4) = \log_2 8 = 3, but log⁡24+log⁡24=4\log_2 4 + \log_2 4 = 4. The product law is about multiplying: log⁡2(4⋅4)=log⁡216=4\log_2 (4 \cdot 4) = \log_2 16 = 4.
  • A negative exponent gives a negative number. 2−32^{-3} is 18\frac{1}{8}, not −8-8. A minus in the exponent means dividing, and 2x2^x is always positive.
  • The logarithm of 0 or of a negative number. 2x2^x is never 0 or negative, so log⁡20\log_2 0 and log⁡2(−4)\log_2 (-4) do not exist, and the equation 2x=−42^x = -4 has no solution.
  • Mixing up 2x2^x and x2x^2. In x2x^2 the variable is the base, and in 2x2^x it is the exponent. At x=3x = 3, 23=82^3 = 8 is still less than 32=93^2 = 9. But both are 16 at x=4x = 4, and from there on 2x2^x stays ahead: at x=10x = 10 it is 10241024 against 100100.

At GCSE and A-level

In England, GCSE Mathematics asks you to recognise, sketch and interpret graphs of exponential functions y=kxy = k^x for positive kk, and to solve growth and decay problems, including compound interest. Logarithms are not part of GCSE.

A-level Mathematics, and AS as well, covers the rest of this page: the function axa^x and its graph, exe^x, the definition of log⁡ax\log_a x as the inverse of axa^x, ln⁡x\ln x as the inverse of exe^x, the laws of logarithms and equations of the form ax=ba^x = b. You also use exponential growth and decay in models - continuous compound interest, radioactive decay or a growing population - and use logarithmic graphs to estimate the constants in relationships such as y=kbxy = kb^x.

Check yourself

Test yourself

What is log⁡381\log_3 81?

What is log⁡218\log_2 \frac{1}{8}?

Which point lies on the graph of every function y=axy = a^x?

What is log⁡240−log⁡25\log_2 40 - \log_2 5?

The graph of y=log⁡2xy = \log_2 x is the mirror image in the line y=xy = x of which graph?

Flashcards for review

Flip a card and say whether you knew the answer. The ones you did not know come back at the end of the deck. Why it pays to come back to them in a few days is explained in the guide Spaced repetition.

Flashcards

  1. What is an exponential function?

    A function f(x)=axf(x) = a^x, where the base a>0a > 0 and a≠1a \neq 1. The variable sits in the exponent.
  2. What happens to axa^x when xx goes up by 1?

    It is multiplied by aa, because ax+1=a⋅axa^{x + 1} = a \cdot a^x.
  3. Which point lies on the graph of every y=axy = a^x?

    (0,1)(0, 1), because a0=1a^0 = 1.
  4. When is axa^x increasing, and when is it decreasing?

    Increasing for a>1a > 1, decreasing for 0<a<10 < a < 1.
  5. What does log⁡ab=c\log_a b = c mean?

    ac=ba^c = b: cc is the exponent you raise aa to, to get bb.
  6. What is log⁡28\log_2 8?

    3, because 23=82^3 = 8.
  7. How are the graphs of y=axy = a^x and y=log⁡axy = \log_a x related?

    They are mirror images in the line y=xy = x: the point (x,y)(x, y) of one is the point (y,x)(y, x) of the other.
  8. For which xx does log⁡ax\log_a x exist?

    Only for x>0x > 0. The graph of y=log⁡axy = \log_a x goes through (1,0)(1, 0).
  9. What are the three laws of logarithms?

    log⁡a(xy)=log⁡ax+log⁡ay\log_a (xy) = \log_a x + \log_a y, log⁡axy=log⁡ax−log⁡ay\log_a \frac{x}{y} = \log_a x - \log_a y and log⁡axk=klog⁡ax\log_a x^k = k \log_a x.
  10. Is 2−32^{-3} a negative number?

    No: 2−3=182^{-3} = \frac{1}{8}. Every value of 2x2^x is positive.

Sources

We checked the facts on this page against these sources. All of them may be reused freely: they carry an open licence or are not covered by copyright.

  1. Illustrative Mathematics - Algebra 1, Unit 5, Lesson 2: Patterns of Growth (linear patterns add the same amount, exponential patterns multiply by the same factor) · CC BY 4.0
  2. Illustrative Mathematics - Algebra 2, Unit 4, Lesson 9: What is a Logarithm? (a logarithm as an exponent, base 10 and other bases, ln) · CC BY 4.0
  3. Active Preparation for Calculus (Matthew Boelkins) - 3.1 Exponential Growth and Decay (b > 0, b ≠ 1, the graph through (0, 1), values always positive, negative exponents) · CC BY-SA 4.0
  4. Active Preparation for Calculus (Matthew Boelkins) - 3.4 What a Logarithm Is (the logarithm as the inverse of a power, domain and range, ln) · CC BY-SA 4.0
  5. Active Preparation for Calculus (Matthew Boelkins) - 3.5 Properties and Applications of Logarithmic Functions (the product, quotient and power laws, solving exponential equations) · CC BY-SA 4.0
  6. Wikibooks - A-level Mathematics/OCR/C2/Logarithms and Exponentials (the logarithm as the inverse, swapping x and y, the laws of logarithms, change of base, base 10 when no base is written) · CC BY-SA 4.0
  7. Wikipedia - Exponential function (the graph through (0, 1), the x axis as an asymptote, positive values, e and ln) · CC BY-SA 4.0
  8. Wikipedia - Logarithm (definition, laws, change of base, the graph as the reflection of bˣ in the line y = x) · CC BY-SA 4.0
  9. Wikipedia - Exponential growth (a constant factor per step instead of a constant amount, the water lily puzzle) · CC BY-SA 4.0

More explainers