How to Graph Logarithmic Functions
Learn how to graph logarithmic functions step by step. Covers the relationship to exponentials, domain restrictions, vertical asymptotes, and key properties.
What Is a Logarithmic Function?
A logarithmic function is the inverse of an exponential function. If y = b^x defines an exponential function, then x = log_b(y) defines the corresponding logarithm. Written in function notation, y = log_b(x) answers the question: "To what power must b be raised to produce x?" The two most common logarithmic functions are the common logarithm (base 10, written log(x)) and the natural logarithm (base e, written ln(x)). Logarithms appear throughout science and engineering, from the Richter scale for earthquake magnitudes to the decibel scale for sound intensity, because they compress large ranges of values into manageable numbers.
Relationship to Exponential Functions
The graph of y = log_b(x) is the reflection of y = b^x across the line y = x. Every property of exponential functions has a corresponding logarithmic property with the roles of x and y swapped. The exponential function has a horizontal asymptote at y = 0; the logarithmic function has a vertical asymptote at x = 0. The exponential passes through (0, 1); the logarithm passes through (1, 0). The exponential has domain all real numbers and range (0, infinity); the logarithm has domain (0, infinity) and range all real numbers. Understanding this mirror relationship makes it easy to derive the shape of any logarithmic graph from its exponential counterpart.
Domain Restrictions
The most important feature of logarithmic functions is their restricted domain. You cannot take the logarithm of zero or a negative number (in the real number system). Therefore, the domain of y = log_b(x) is x > 0. For a transformed logarithm y = log_b(x - h), the domain shifts to x > h. This means the graph only exists to the right of the vertical asymptote. When graphing, always determine the domain first by setting the argument of the logarithm greater than zero and solving for x. Any portion of the x-axis to the left of this boundary is not part of the graph.
The Vertical Asymptote
Every logarithmic function has a vertical asymptote where the argument of the logarithm equals zero. For y = log_b(x), the asymptote is the y-axis (x = 0). As x approaches 0 from the right, y goes to negative infinity. The graph gets infinitely close to this vertical line but never touches it. For y = log_b(x - h), the asymptote shifts to x = h. Draw the asymptote as a dashed vertical line on your graph before plotting any points. This is the most distinctive feature that separates logarithmic graphs from other function types.
Key Properties and Points
Every logarithmic function y = log_b(x) passes through three key points that are easy to remember. First, (1, 0) because log_b(1) = 0 for any base (any number raised to the power 0 is 1). Second, (b, 1) because log_b(b) = 1. Third, (1/b, -1) because log_b(1/b) = -1. The function is increasing when b > 1 (the most common case) and decreasing when 0 < b < 1. The rate of increase slows down as x gets larger: logarithmic growth is extremely slow. Going from x = 1 to x = 10 increases ln(x) by about 2.3, but going from x = 10 to x = 100 only increases it by another 2.3.
Transformations of Logarithmic Functions
The general form y = a * log_b(x - h) + k involves four transformations. The horizontal shift h moves the vertical asymptote to x = h and shifts the entire graph left or right. The vertical stretch a multiplies all y-values, making the graph steeper (|a| > 1) or flatter (|a| < 1). If a is negative, the graph is reflected across the x-axis. The vertical shift k moves the entire graph up or down without changing the asymptote position. The base b affects the shape: larger bases produce flatter curves (because they grow more slowly), while bases closer to 1 produce steeper curves near the asymptote.
Step-by-Step Graphing Process
To graph a logarithmic function, follow these steps. First, identify the base b and any transformations (h, k, a). Second, determine the domain by solving the inequality: the argument of the logarithm must be positive. Third, draw the vertical asymptote as a dashed line at x = h (or x = 0 for the basic function). Fourth, find key points by substituting convenient x-values. Start with the three standard points: set the argument equal to 1 (gives y = k), equal to b (gives y = a + k), and equal to 1/b (gives y = -a + k). Fifth, plot additional points if needed for accuracy. Sixth, draw a smooth curve through the points that approaches the asymptote and extends to the right. The curve should be smooth, always on one side of the asymptote, and showing the characteristic slow-growth shape.
Common Logarithmic Equations
Several logarithmic functions appear frequently in mathematics and science. The natural logarithm y = ln(x) uses base e and is essential in calculus because its derivative is 1/x. The common logarithm y = log(x) uses base 10 and is convenient for order-of-magnitude calculations. The binary logarithm y = log_2(x) appears in computer science, where it describes the number of bits needed to represent a number or the number of steps in a binary search. When graphing any of these, the shape is the same characteristic curve; only the horizontal stretching differs. For example, ln(10) is about 2.3, log(10) is 1, and log_2(10) is about 3.32, meaning the natural log curve is the flattest of the three and the binary log is the steepest.
Try These Calculators
Put what you learned into practice with these free calculators.
Try It Yourself
Put what you learned into practice with our free graphing calculator.
Related Graphs
Related Guides
How to Graph Exponential Functions
Learn how to graph exponential functions step by step. Covers exponential growth, decay, asymptotes, transformations, and key properties with examples.
How to Graph Quadratic Equations
Learn how to graph quadratic equations step by step. Covers standard form, vertex form, finding the vertex, axis of symmetry, x-intercepts, and plotting parabolas.
Graphing Calculator Tutorial - Complete Guide
Learn how to use the free online graphing calculator at ThePrimeCalculator. Enter equations, pan, zoom, add multiple graphs, pin points, and use 3D mode.