Grade 12 IB Math is live, AA and AI · see the IB course

Grade 12 · MHF4U · Advanced Functions

MHF4U: Graphing Logarithmic Functions

The graph of y=log⁡bxy = \log_b x is the graph of y=bxy = b^x reflected in the line y=xy = x, because the two functions are inverses. Everything about the log graph comes from that: swap the coordinates of the exponential's points and you have the log's.

How It Works

Key points. y=bxy = b^x passes through (−1,1b)\left(-1, \frac{1}{b}\right), (0,1)(0, 1) and (1,b)(1, b), so y=log⁡bxy = \log_b x passes through (1b,−1)\left(\frac{1}{b}, -1\right), (1,0)(1, 0) and (b,1)(b, 1). Those three points and the asymptote are enough to sketch it.

Asymptote, domain and range. The exponential's horizontal asymptote y=0y = 0 becomes a vertical asymptote x=0x = 0. You can only take the log of a positive number, so the domain is x>0x > 0; the range is all real numbers. For b>1b > 1 the graph rises slowly to the right and drops toward −∞-\infty as xx approaches 00.

Transformations. For y=alog⁡b(k(x−d))+cy = a \log_b(k(x - d)) + c, each point (x,y)(x, y) of y=log⁡bxy = \log_b x maps to (xk+d,ay+c)\left(\frac{x}{k} + d, ay + c\right). The asymptote moves with the horizontal shift to x=dx = d, and for k>0k > 0 the domain is x>dx > d. A vertical shift or stretch leaves the asymptote alone. A negative aa reflects the graph in the xx-axis, so it falls instead of rising.

Intercepts. For the xx-intercept set y=0y = 0 and rewrite in exponential form. For the yy-intercept put x=0x = 0, which only exists when 00 is in the domain.

The inverse. To find the inverse of a log function, swap xx and yy, isolate the log, and rewrite in exponential form. The inverse of a log is an exponential and the other way around.

5 Worked Examples

Easy first, test level last. Try each one on paper, then open the solution.

  1. Easy

    For y=log⁡2xy = \log_2 x, state the domain, range and asymptote, and give four points on the graph.
    Show solution
    1. Domain x>0x > 0, range all real numbers, vertical asymptote x=0x = 0.
    2. log⁡212=−1\log_2 \frac{1}{2} = -1, log⁡21=0\log_2 1 = 0, log⁡22=1\log_2 2 = 1, log⁡24=2\log_2 4 = 2.

    Answer: Domain x>0x > 0, range all reals, asymptote x=0x = 0; points (12,−1)\left(\frac{1}{2}, -1\right), (1,0)(1, 0), (2,1)(2, 1), (4,2)(4, 2)

  2. Easy

    f(x)=3xf(x) = 3^x passes through (2,9)(2, 9). Write the inverse of ff and give the matching point on its graph.
    Show solution
    1. The inverse of y=3xy = 3^x is y=log⁡3xy = \log_3 x.
    2. Swap the coordinates: (9,2)(9, 2), and indeed log⁡39=2\log_3 9 = 2.

    Answer: f−1(x)=log⁡3xf^{-1}(x) = \log_3 x, through (9,2)(9, 2)

  3. Medium

    Graph y=log⁡3(x−2)+1y = \log_3(x - 2) + 1: give the asymptote, domain, xx-intercept and three key points.
    Show solution
    1. Shift right 22 and up 11. The asymptote moves to x=2x = 2, so the domain is x>2x > 2.
    2. Key points of y=log⁡3xy = \log_3 x are (13,−1)\left(\frac{1}{3}, -1\right), (1,0)(1, 0), (3,1)(3, 1). Map (x,y)→(x+2,y+1)(x, y) \to (x + 2, y + 1): (73,0)\left(\frac{7}{3}, 0\right), (3,1)(3, 1), (5,2)(5, 2).
    3. xx-intercept: log⁡3(x−2)=−1\log_3(x - 2) = -1, so x−2=13x - 2 = \frac{1}{3} and x=73x = \frac{7}{3}, which is the first key point.

    Answer: Asymptote x=2x = 2, domain x>2x > 2, xx-intercept 73\frac{7}{3}; points (73,0)\left(\frac{7}{3}, 0\right), (3,1)(3, 1), (5,2)(5, 2)

  4. Medium

    For y=−2log⁡(x+4)y = -2 \log(x + 4), find the asymptote, domain, range, both intercepts, and say whether it rises or falls.
    Show solution
    1. Shift left 44: asymptote x=−4x = -4, domain x>−4x > -4. The range stays all real numbers.
    2. xx-intercept: log⁡(x+4)=0\log(x + 4) = 0, so x+4=1x + 4 = 1 and x=−3x = -3.
    3. yy-intercept: y=−2log⁡4≈−1.204y = -2 \log 4 \approx -1.204.
    4. a=−2a = -2 reflects the graph in the xx-axis, so it falls from left to right. Check with a point: (10,1)(10, 1) on y=log⁡xy = \log x maps to (6,−2)(6, -2).

    Answer: Asymptote x=−4x = -4, domain x>−4x > -4, range all reals; xx-intercept −3-3, yy-intercept −2log⁡4≈−1.204-2 \log 4 \approx -1.204; it falls

  5. Test level

    For f(x)=2log⁡2(x+3)−4f(x) = 2 \log_2(x + 3) - 4, find the domain, range, asymptote, both intercepts, and the equation of f−1(x)f^{-1}(x).
    Show solution
    1. Shift left 33: asymptote x=−3x = -3, domain x>−3x > -3, range all real numbers.
    2. xx-intercept: 2log⁡2(x+3)=42 \log_2(x + 3) = 4, so log⁡2(x+3)=2\log_2(x + 3) = 2, x+3=4x + 3 = 4, x=1x = 1.
    3. yy-intercept: f(0)=2log⁡23−4≈−0.830f(0) = 2 \log_2 3 - 4 \approx -0.830.
    4. Inverse: swap, x=2log⁡2(y+3)−4x = 2 \log_2(y + 3) - 4. Then x+42=log⁡2(y+3)\frac{x + 4}{2} = \log_2(y + 3), so y+3=2(x+4)/2y + 3 = 2^{(x + 4)/2}.
    5. Check: f(1)=0f(1) = 0, and f−1(0)=22−3=1f^{-1}(0) = 2^2 - 3 = 1.

    Answer: Domain x>−3x > -3, range all reals, asymptote x=−3x = -3; xx-intercept 11, yy-intercept 2log⁡23−4≈−0.8302 \log_2 3 - 4 \approx -0.830; f−1(x)=2(x+4)/2−3f^{-1}(x) = 2^{(x + 4)/2} - 3

Learn It on Martian Lab

Martian Lab teaches this in the Graphing Exponential & Logarithmic Functions lesson of its MHF4U Exponential & Logarithmic Functions unit. Watch it, then take the Exponential & Logarithmic Functions practice tests to see if it stuck.

Watch the Graphing Exponential & Logarithmic Functions lesson free

Start Practicing

No credit card required to start.

Get started