Skip to content

Graphs of Logarithmic Functions

By the end of this section, you will be able to:

  • Identify the domain of a logarithmic function
  • Graph logarithmic functions

In Graphs of Exponential Functions, we saw how creating a graphical representation of an exponential model gives us another layer of insight for predicting future events. How do logarithmic graphs give us insight into situations? Because every logarithmic function is the inverse function of an exponential function, we can think of every output on a logarithmic graph as the input for the corresponding inverse exponential equation. In other words, logarithms give the cause for an effect.

To illustrate, suppose we invest $2{,}500 in an account that offers an annual interest rate of 5%5\%, compounded continuously. We already know that the balance in our account for any year tt can be found with the equation A=2,500e0.05tA=2{,}500e^{0.05t}.

But what if we wanted to know the year for any balance? We would need to create a corresponding new function by interchanging the input and the output; thus we would need to create a logarithmic model for this situation. By graphing the model, we can see the output (year) for any input (account balance). For instance, what if we wanted to know how many years it would take for our initial investment to double? The graph below shows this point on the logarithmic graph.

In this section we will discuss the values for which a logarithmic function is defined, and then turn our attention to graphing the family of logarithmic functions.

Finding the domain of a logarithmic function

Before working with graphs, we will take a look at the domain (the set of input values) for which the logarithmic function is defined.

Recall that the exponential function is defined as y=bxy=b^x for any real number xx and constant b>0b>0, b1b\ne1, where

  • The domain of yy is (,)(-\infty,\infty).
  • The range of yy is (0,)(0,\infty).

In Logarithmic Functions, we learned that the logarithmic function y=logb(x)y=\log_b(x) is the inverse of the exponential function y=bxy=b^x. So, as inverse functions:

  • The domain of y=logb(x)y=\log_b(x) is the range of y=bxy=b^x: (0,)(0,\infty).
  • The range of y=logb(x)y=\log_b(x) is the domain of y=bxy=b^x: (,)(-\infty,\infty).

Transformations of the parent function y=logb(x)y=\log_b(x) behave similarly to those of other functions. Just as with other parent functions, we can apply the four types of transformations — shifts, stretches, compressions, and reflections.

In Graphs of Exponential Functions we saw that certain transformations can change the range of y=bxy=b^x. Similarly, applying transformations to the parent function y=logb(x)y=\log_b(x) can change the domain. When finding the domain of a logarithmic function, therefore, it is important to remember that the domain consists only of positive real numbers. That is, the argument of the logarithmic function must be greater than zero.

For example, consider f(x)=log4(2x3)f(x)=\log_4(2x-3). This function is defined for any values of xx such that the argument, in this case 2x32x-3, is greater than zero. To find the domain, we set up an inequality and solve for xx:

Show the argument greater than zero.2x3>0Add 3.2x>3Divide by 2.x>1.5 \begin{array}{lrcl} \text{Show the argument greater than zero.} & 2x-3 &>& 0 \\[4pt] \text{Add 3.} & 2x &>& 3 \\[4pt] \text{Divide by 2.} & x &>& 1.5 \end{array}

In interval notation, the domain of f(x)=log4(2x3)f(x)=\log_4(2x-3) is (1.5,)(1.5,\infty).

How to: given a logarithmic function, identify the domain.

  1. Set up an inequality showing the argument greater than zero.
  2. Solve for xx.
  3. Write the domain in interval notation.

Example. What is the domain of f(x)=log2(x+3)f(x)=\log_2(x+3)?

Solution. The logarithmic function is defined only when the input is positive, so this function is defined when x+3>0x+3>0. Solving this inequality,

The input must be positive.x+3>0Subtract 3.x>3 \begin{array}{lrcl} \text{The input must be positive.} & x+3 &>& 0 \\[4pt] \text{Subtract 3.} & x &>& -3 \end{array}

The domain of f(x)=log2(x+3)f(x)=\log_2(x+3) is (3,)(-3,\infty).

What is the domain off(x)=log5(x2)+1f(x)=\log_5(x-2)+1? Write your answer in interval notation.

Example. What is the domain of f(x)=log(52x)f(x)=\log(5-2x)?

Solution. The logarithmic function is defined only when the input is positive, so this function is defined when 52x>05-2x>0. Solving this inequality,

The input must be positive.52x>0Subtract 5.2x>5Divide by 2 and switch the inequality.x<52 \begin{array}{lrcl} \text{The input must be positive.} & 5-2x &>& 0 \\[4pt] \text{Subtract 5.} & -2x &>& -5 \\[4pt] \text{Divide by }-2\text{ and switch the inequality.} & x &<& \tfrac{5}{2} \end{array}

The domain of f(x)=log(52x)f(x)=\log(5-2x) is (,52)\left(-\infty,\tfrac{5}{2}\right).

What is the domain off(x)=log(x5)+2f(x)=\log(x-5)+2? Write your answer in interval notation.

Graphing logarithmic functions

Now that we have a feel for the set of values for which a logarithmic function is defined, we move on to graphing logarithmic functions. The family of logarithmic functions includes the parent function y=logb(x)y=\log_b(x) along with all its transformations: shifts, stretches, compressions, and reflections.

We begin with the parent function y=logb(x)y=\log_b(x). Because every logarithmic function of this form is the inverse of an exponential function with the form y=bxy=b^x, their graphs will be reflections of each other across the line y=xy=x. To illustrate this, we can observe the relationship between the input and output values of y=2xy=2^x and its equivalent x=log2(y)x=\log_2(y) in the table below.

xx3-32-21-100112233
2x=y2^x=y18\tfrac{1}{8}14\tfrac{1}{4}12\tfrac{1}{2}11224488
log2(y)=x\log_2(y)=x3-32-21-100112233

Using the inputs and outputs from the table above, we can build another table to observe the relationship between points on the graphs of the inverse functions f(x)=2xf(x)=2^x and g(x)=log2(x)g(x)=\log_2(x).

f(x)=2xf(x)=2^x(3,18)\left(-3,\tfrac{1}{8}\right)(2,14)\left(-2,\tfrac{1}{4}\right)(1,12)\left(-1,\tfrac{1}{2}\right)(0,1)(0,1)(1,2)(1,2)(2,4)(2,4)(3,8)(3,8)
g(x)=log2(x)g(x)=\log_2(x)(18,3)\left(\tfrac{1}{8},-3\right)(14,2)\left(\tfrac{1}{4},-2\right)(12,1)\left(\tfrac{1}{2},-1\right)(1,0)(1,0)(2,1)(2,1)(4,2)(4,2)(8,3)(8,3)

As we’d expect, the xx- and yy-coordinates are reversed for the inverse functions. The graph below shows the graph of ff and gg.

Observe the following from the graph:

  • f(x)=2xf(x)=2^x has a yy-intercept at (0,1)(0,1) and g(x)=log2(x)g(x)=\log_2(x) has an xx-intercept at (1,0)(1,0).
  • The domain of f(x)=2xf(x)=2^x, (,)(-\infty,\infty), is the same as the range of g(x)=log2(x)g(x)=\log_2(x).
  • The range of f(x)=2xf(x)=2^x, (0,)(0,\infty), is the same as the domain of g(x)=log2(x)g(x)=\log_2(x).

Characteristics of the graph of the parent function, f(x)=logb(x)f(x)=\log_b(x). For any real number xx and constant b>0b>0, b1b\ne1, we can see the following characteristics in the graph of f(x)=logb(x)f(x)=\log_b(x):

  • one-to-one function
  • vertical asymptote: x=0x=0
  • domain: (0,)(0,\infty)
  • range: (,)(-\infty,\infty)
  • xx-intercept: (1,0)(1,0) and key point (b,1)(b,1)
  • yy-intercept: none
  • increasing if b>1b>1
  • decreasing if 0<b<10<b<1

See the panels below.

The graph below shows how changing the base bb in f(x)=logb(x)f(x)=\log_b(x) can affect the graphs. Observe that the graphs compress vertically as the value of the base increases. (Note: recall that the function ln(x)\ln(x) has base e2.718e\approx2.718.)

How to: given a logarithmic function with the form f(x)=logb(x)f(x)=\log_b(x), graph the function.

  1. Draw and label the vertical asymptote, x=0x=0.
  2. Plot the xx-intercept, (1,0)(1,0).
  3. Plot the key point (b,1)(b,1).
  4. Draw a smooth curve through the points.
  5. State the domain, (0,)(0,\infty), the range, (,)(-\infty,\infty), and the vertical asymptote, x=0x=0.

Example. Graph f(x)=log5(x)f(x)=\log_5(x). State the domain, range, and asymptote.

Solution. Before graphing, identify the behavior and key points for the graph.

  • Since b=5b=5 is greater than one, we know the function is increasing. The left tail of the graph will approach the vertical asymptote x=0x=0, and the right tail will increase slowly without bound.
  • The xx-intercept is (1,0)(1,0).
  • The key point (5,1)(5,1) is on the graph.
  • We draw and label the asymptote, plot and label the points, and draw a smooth curve through the points (see the graph below).

The domain is (0,)(0,\infty), the range is (,)(-\infty,\infty), and the vertical asymptote is x=0x=0.

Graphf(x)=log1/5(x)f(x)=\log_{1/5}(x). What is the domain? Write your answer in interval notation.

Graphing transformations of logarithmic functions

As we mentioned in the beginning of the section, transformations of logarithmic graphs behave similarly to those of other parent functions. We can shift, stretch, compress, and reflect the parent function y=logb(x)y=\log_b(x) without loss of shape.

Graphing a horizontal shift of f(x)=logb(x)f(x) = \log_b(x)

When a constant cc is added to the input of the parent function f(x)=logb(x)f(x)=\log_b(x), the result is a horizontal shift cc units in the opposite direction of the sign on cc. To visualize horizontal shifts, we can observe the general graph of the parent function f(x)=logb(x)f(x)=\log_b(x) for c>0c>0 alongside the shift left, g(x)=logb(x+c)g(x)=\log_b(x+c), and the shift right, h(x)=logb(xc)h(x)=\log_b(x-c). See the panels below, drawn with b=2b=2 and c=2c=2.

Horizontal shifts of the parent function f(x)=logb(x)f(x)=\log_b(x). For any constant cc, the function f(x)=logb(x+c)f(x)=\log_b(x+c)

  • shifts the parent function y=logb(x)y=\log_b(x) left cc units if c>0c>0.
  • shifts the parent function y=logb(x)y=\log_b(x) right cc units if c<0c<0.
  • has the vertical asymptote x=cx=-c.
  • has domain (c,)(-c,\infty).
  • has range (,)(-\infty,\infty).

How to: given a logarithmic function with the form f(x)=logb(x+c)f(x)=\log_b(x+c), graph the translation.

  1. Identify the horizontal shift:
    • If c>0c>0, shift the graph of f(x)=logb(x)f(x)=\log_b(x) left cc units.
    • If c<0c<0, shift the graph of f(x)=logb(x)f(x)=\log_b(x) right cc units.
  2. Draw the vertical asymptote x=cx=-c.
  3. Identify three key points from the parent function. Find new coordinates for the shifted functions by subtracting cc from the xx coordinate.
  4. Label the three points.
  5. The domain is (c,)(-c,\infty), the range is (,)(-\infty,\infty), and the vertical asymptote is x=cx=-c.

Example. Sketch the horizontal shift f(x)=log3(x2)f(x)=\log_3(x-2) alongside its parent function. Include the key points and asymptotes on the graph. State the domain, range, and asymptote.

Solution. Since the function is f(x)=log3(x2)f(x)=\log_3(x-2), we notice x+(2)=x2x+(-2)=x-2.

Thus c=2c=-2, so c<0c<0. This means we will shift the function f(x)=log3(x)f(x)=\log_3(x) right 2 units.

The vertical asymptote is x=(2)x=-(-2) or x=2x=2.

Consider the three key points from the parent function, (13,1)\left(\tfrac{1}{3},-1\right), (1,0)(1,0), and (3,1)(3,1).

The new coordinates are found by adding 2 to the xx coordinates.

Label the points (73,1)\left(\tfrac{7}{3},-1\right), (3,0)(3,0), and (5,1)(5,1).

The domain is (2,)(2,\infty), the range is (,)(-\infty,\infty), and the vertical asymptote is x=2x=2.

Sketch a graph off(x)=log3(x+4)f(x)=\log_3(x+4)alongside its parent function. What is the vertical asymptote?

What is the domain of that same function,f(x)=log3(x+4)f(x)=\log_3(x+4)? Write your answer in interval notation.

Graphing a vertical shift of f(x)=logb(x)f(x) = \log_b(x)

When a constant dd is added to the parent function f(x)=logb(x)f(x)=\log_b(x), the result is a vertical shift dd units in the direction of the sign on dd. To visualize vertical shifts, we can observe the general graph of the parent function f(x)=logb(x)f(x)=\log_b(x) alongside the shift up, g(x)=logb(x)+dg(x)=\log_b(x)+d, and the shift down, h(x)=logb(x)dh(x)=\log_b(x)-d. See the panels below, drawn with b=2b=2 and d=2d=2.

Vertical shifts of the parent function y=logb(x)y=\log_b(x). For any constant dd, the function f(x)=logb(x)+df(x)=\log_b(x)+d

  • shifts the parent function y=logb(x)y=\log_b(x) up dd units if d>0d>0.
  • shifts the parent function y=logb(x)y=\log_b(x) down dd units if d<0d<0.
  • has the vertical asymptote x=0x=0.
  • has domain (0,)(0,\infty).
  • has range (,)(-\infty,\infty).

How to: given a logarithmic function with the form f(x)=logb(x)+df(x)=\log_b(x)+d, graph the translation.

  1. Identify the vertical shift:
    • If d>0d>0, shift the graph of f(x)=logb(x)f(x)=\log_b(x) up dd units.
    • If d<0d<0, shift the graph of f(x)=logb(x)f(x)=\log_b(x) down dd units.
  2. Draw the vertical asymptote x=0x=0.
  3. Identify three key points from the parent function. Find new coordinates for the shifted functions by adding dd to the yy coordinate.
  4. Label the three points.
  5. The domain is (0,)(0,\infty), the range is (,)(-\infty,\infty), and the vertical asymptote is x=0x=0.

Example. Sketch a graph of f(x)=log3(x)2f(x)=\log_3(x)-2 alongside its parent function. Include the key points and asymptote on the graph. State the domain, range, and asymptote.

Solution. Since the function is f(x)=log3(x)2f(x)=\log_3(x)-2, we will notice d=2d=-2. Thus d<0d<0.

This means we will shift the function f(x)=log3(x)f(x)=\log_3(x) down 2 units.

The vertical asymptote is x=0x=0.

Consider the three key points from the parent function, (13,1)\left(\tfrac{1}{3},-1\right), (1,0)(1,0), and (3,1)(3,1).

The new coordinates are found by subtracting 2 from the yy coordinates.

Label the points (13,3)\left(\tfrac{1}{3},-3\right), (1,2)(1,-2), and (3,1)(3,-1).

The domain is (0,)(0,\infty), the range is (,)(-\infty,\infty), and the vertical asymptote is x=0x=0.

Sketch a graph off(x)=log2(x)+2f(x)=\log_2(x)+2by plotting the points withx=12x=\tfrac{1}{2},11,22,44, and88.

What is the domain off(x)=log2(x)+2f(x)=\log_2(x)+2? Write your answer in interval notation.

Graphing stretches and compressions of f(x)=logb(x)f(x) = \log_b(x)

When the parent function f(x)=logb(x)f(x)=\log_b(x) is multiplied by a constant a>0a>0, the result is a vertical stretch or compression of the original graph. To visualize stretches and compressions, we set a>1a>1 and observe the general graph of the parent function f(x)=logb(x)f(x)=\log_b(x) alongside the vertical stretch, g(x)=alogb(x)g(x)=a\log_b(x), and the vertical compression, h(x)=1alogb(x)h(x)=\tfrac{1}{a}\log_b(x). See the panels below, drawn with b=2b=2 and a=2a=2.

Vertical stretches and compressions of the parent function y=logb(x)y=\log_b(x). For any constant a>1a>1, the function f(x)=alogb(x)f(x)=a\log_b(x)

  • stretches the parent function y=logb(x)y=\log_b(x) vertically by a factor of aa if a>1a>1.
  • compresses the parent function y=logb(x)y=\log_b(x) vertically by a factor of aa if 0<a<10<a<1.
  • has the vertical asymptote x=0x=0.
  • has the xx-intercept (1,0)(1,0).
  • has domain (0,)(0,\infty).
  • has range (,)(-\infty,\infty).

How to: given a logarithmic function with the form f(x)=alogb(x)f(x)=a\log_b(x), a>0a>0, graph the translation.

  1. Identify the vertical stretch or compression:
    • If a>1|a|>1, the graph of f(x)=logb(x)f(x)=\log_b(x) is stretched by a factor of aa units.
    • If a<1|a|<1, the graph of f(x)=logb(x)f(x)=\log_b(x) is compressed by a factor of aa units.
  2. Draw the vertical asymptote x=0x=0.
  3. Identify three key points from the parent function. Find new coordinates for the shifted functions by multiplying the yy coordinates by aa.
  4. Label the three points.
  5. The domain is (0,)(0,\infty), the range is (,)(-\infty,\infty), and the vertical asymptote is x=0x=0.

Example. Sketch a graph of f(x)=2log4(x)f(x)=2\log_4(x) alongside its parent function. Include the key points and asymptote on the graph. State the domain, range, and asymptote.

Solution. Since the function is f(x)=2log4(x)f(x)=2\log_4(x), we will notice a=2a=2.

This means we will stretch the function f(x)=log4(x)f(x)=\log_4(x) by a factor of 2.

The vertical asymptote is x=0x=0.

Consider the three key points from the parent function, (14,1)\left(\tfrac{1}{4},-1\right), (1,0)(1,0), and (4,1)(4,1).

The new coordinates are found by multiplying the yy coordinates by 2.

Label the points (14,2)\left(\tfrac{1}{4},-2\right), (1,0)(1,0), and (4,2)(4,2).

The domain is (0,)(0,\infty), the range is (,)(-\infty,\infty), and the vertical asymptote is x=0x=0.

Sketch a graph off(x)=12log4(x)f(x)=\tfrac{1}{2}\log_4(x)alongside its parent function. Besides the x-intercept, the parent function has key point(4,1)(4,1). What is the corresponding key point on the graph offf? Enter your answer as an ordered pair.

Example. Sketch a graph of f(x)=5log(x+2)f(x)=5\log(x+2). State the domain, range, and asymptote.

Solution. Remember: what happens inside parentheses happens first. First, we move the graph left 2 units, then stretch the function vertically by a factor of 5, as in the graph below. The vertical asymptote will be shifted to x=2x=-2. The xx-intercept will be (1,0)(-1,0). The domain will be (2,)(-2,\infty). Two points will help give the shape of the graph: (1,0)(-1,0) and (8,5)(8,5). We chose x=8x=8 as the xx-coordinate of one point to graph because when x=8x=8, x+2=10x+2=10, the base of the common logarithm.

The domain is (2,)(-2,\infty), the range is (,)(-\infty,\infty), and the vertical asymptote is x=2x=-2.

Sketch a graph of the functionf(x)=3log(x2)+1f(x)=3\log(x-2)+1. What is the vertical asymptote?

What is the domain of that same function,f(x)=3log(x2)+1f(x)=3\log(x-2)+1? Write your answer in interval notation.

Graphing reflections of f(x)=logb(x)f(x) = \log_b(x)

When the parent function f(x)=logb(x)f(x)=\log_b(x) is multiplied by 1-1, the result is a reflection about the xx-axis. When the input is multiplied by 1-1, the result is a reflection about the yy-axis. To visualize reflections, we restrict b>1b>1, and observe the general graph of the parent function f(x)=logb(x)f(x)=\log_b(x) alongside the reflection about the xx-axis, g(x)=logb(x)g(x)=-\log_b(x), and the reflection about the yy-axis, h(x)=logb(x)h(x)=\log_b(-x). Both are drawn below with b=2b=2.

Reflections of the parent function y=logb(x)y=\log_b(x). The function f(x)=logb(x)f(x)=-\log_b(x)

  • reflects the parent function y=logb(x)y=\log_b(x) about the xx-axis.
  • has domain (0,)(0,\infty), range (,)(-\infty,\infty), and vertical asymptote x=0x=0, which are unchanged from the parent function.

The function f(x)=logb(x)f(x)=\log_b(-x)

  • reflects the parent function y=logb(x)y=\log_b(x) about the yy-axis.
  • has domain (,0)(-\infty,0).
  • has range (,)(-\infty,\infty), and vertical asymptote x=0x=0, which are unchanged from the parent function.

How to: given a logarithmic function with the parent function f(x)=logb(x)f(x)=\log_b(x), graph a reflection about the xx-axis.

  1. Draw the vertical asymptote, x=0x=0.
  2. Plot the xx-intercept, (1,0)(1,0).
  3. Reflect the graph of the parent function f(x)=logb(x)f(x)=\log_b(x) about the xx-axis.
  4. Draw a smooth curve through the points.
  5. State the domain, (0,)(0,\infty), the range, (,)(-\infty,\infty), and the vertical asymptote x=0x=0.

How to: given a logarithmic function with the parent function f(x)=logb(x)f(x)=\log_b(x), graph a reflection about the yy-axis.

  1. Draw the vertical asymptote, x=0x=0.
  2. Plot the xx-intercept, (1,0)(-1,0).
  3. Reflect the graph of the parent function f(x)=logb(x)f(x)=\log_b(x) about the yy-axis.
  4. Draw a smooth curve through the points.
  5. State the domain, (,0)(-\infty,0), the range, (,)(-\infty,\infty), and the vertical asymptote x=0x=0.

Example. Sketch a graph of f(x)=log(x)f(x)=\log(-x) alongside its parent function. Include the key points and asymptote on the graph. State the domain, range, and asymptote.

Solution. Before graphing f(x)=log(x)f(x)=\log(-x), identify the behavior and key points for the graph.

  • Since b=10b=10 is greater than one, we know that the parent function is increasing. Since the input value is multiplied by 1-1, ff is a reflection of the parent graph about the yy-axis. Thus, f(x)=log(x)f(x)=\log(-x) will be decreasing as xx moves from negative infinity to zero, and the right tail of the graph will approach the vertical asymptote x=0x=0.
  • The xx-intercept is (1,0)(-1,0).
  • We draw and label the asymptote, plot and label the points, and draw a smooth curve through the points.

The domain is (,0)(-\infty,0), the range is (,)(-\infty,\infty), and the vertical asymptote is x=0x=0.

Graphf(x)=log(x)f(x)=-\log(-x). What is the domain? Write your answer in interval notation.

How to: given a logarithmic equation, use a graphing calculator to approximate solutions.

  1. Press [Y=]. Enter the given logarithm equation or equations as Y1= and, if needed, Y2=.
  2. Press [GRAPH] to observe the graphs of the curves and use [WINDOW] to find an appropriate view of the graphs, including their point(s) of intersection.
  3. To find the value of xx, we compute the point of intersection. Press [2ND] then [CALC]. Select “intersect” and press [ENTER] three times. The point of intersection gives the value of xx for the point(s) of intersection.

Example. Solve 4ln(x)+1=2ln(x1)4\ln(x)+1=-2\ln(x-1) graphically. Round to the nearest thousandth.

Solution. Press [Y=] and enter 4ln(x)+14\ln(x)+1 next to Y1=. Then enter 2ln(x1)-2\ln(x-1) next to Y2=. For a window, use the values 0 to 5 for xx and 10-10 to 1010 for yy. Press [GRAPH]. The graphs should intersect somewhere a little to right of x=1x=1.

For a better approximation, press [2ND] then [CALC]. Select [5: intersect] and press [ENTER] three times. The xx-coordinate of the point of intersection is displayed as 1.3385297. (Your answer may be different if you use a different window or use a different value for Guess?.) So, to the nearest thousandth, x1.339x\approx1.339.

Solve5log(x+2)=4log(x)5\log(x+2)=4-\log(x)graphically. Round to the nearest thousandth.

Summarizing translations of the logarithmic function

Now that we have worked with each type of translation for the logarithmic function, we can summarize each in the table below to arrive at the general equation for translating logarithmic functions.

TransformationForm
Shift horizontally cc units to the left, vertically dd units upy=logb(x+c)+dy=\log_b(x+c)+d
Stretch if a>1\lvert a\rvert>1; compression if a<1\lvert a\rvert<1y=alogb(x)y=a\log_b(x)
Reflect about the xx-axisy=logb(x)y=-\log_b(x)
Reflect about the yy-axisy=logb(x)y=\log_b(-x)
General equation for all translationsy=alogb(x+c)+dy=a\log_b(x+c)+d

Transformations of logarithmic functions. All transformations of the parent logarithmic function, y=logb(x)y=\log_b(x), have the form

f(x)=alogb(x+c)+df(x)=a\log_b(x+c)+d

where the parent function, y=logb(x)y=\log_b(x), b>1b>1, is

  • shifted vertically up dd units.
  • shifted horizontally to the left cc units.
  • stretched vertically by a factor of a|a| if a>0|a|>0.
  • compressed vertically by a factor of a|a| if 0<a<10<|a|<1.
  • reflected about the xx-axis when a<0a<0.

For f(x)=log(x)f(x)=\log(-x), the graph of the parent function is reflected about the yy-axis.

Example. What is the vertical asymptote of f(x)=2log3(x+4)+5f(x)=-2\log_3(x+4)+5?

Solution. The vertical asymptote is at x=4x=-4.

Analysis. The coefficient, the base, and the upward translation do not affect the asymptote. The shift of the curve 4 units to the left shifts the vertical asymptote to x=4x=-4.

What is the vertical asymptote off(x)=3+ln(x1)f(x)=3+\ln(x-1)?

Example. Find a possible equation for the common logarithmic function graphed below.

Solution. This graph has a vertical asymptote at x=2x=-2 and has been vertically reflected. We do not know yet the vertical shift or the vertical stretch. We know so far that the equation will have form:

f(x)=alog(x+2)+kf(x)=-a\log(x+2)+k

It appears the graph passes through the points (1,1)(-1,1) and (2,1)(2,-1). Substituting (1,1)(-1,1),

Substitute (1,1).1=alog(1+2)+kArithmetic.1=alog(1)+klog(1)=0.1=k \begin{array}{lrcl} \text{Substitute }(-1,1). & 1 &=& -a\log(-1+2)+k \\[4pt] \text{Arithmetic.} & 1 &=& -a\log(1)+k \\[4pt] \log(1)=0. & 1 &=& k \end{array}

Next, substituting in (2,1)(2,-1),

Plug in (2,1).1=alog(2+2)+1Arithmetic.2=alog(4)Solve for a.a=2log(4) \begin{array}{lrcl} \text{Plug in }(2,-1). & -1 &=& -a\log(2+2)+1 \\[4pt] \text{Arithmetic.} & -2 &=& -a\log(4) \\[4pt] \text{Solve for }a. & a &=& \tfrac{2}{\log(4)} \end{array}

This gives us the equation f(x)=2log(4)log(x+2)+1f(x)=-\tfrac{2}{\log(4)}\log(x+2)+1.

Analysis. We can verify this answer by comparing the function values in the table below with the points on the graph above.

xx1-1001122334455667788
f(x)f(x)11000.58496-0.584961-11.3219-1.32191.5850-1.58501.8074-1.80742-22.1699-2.16992.3219-2.3219

Give the equation of the natural logarithm graphed below.

Q&A. Is it possible to tell the domain and range and describe the end behavior of a function just by looking at the graph?

Yes, if we know the function is a general logarithmic function. For example, look at the graph above. The graph approaches x=3x=-3 (or thereabouts) more and more closely, so x=3x=-3 is, or is very close to, the vertical asymptote. It approaches from the right, so the domain is all points to the right, {xx>3}\{x\mid x>-3\}. The range, as with all general logarithmic functions, is all real numbers. And we can see the end behavior because the graph goes down as it goes left and up as it goes right. The end behavior is that as x3+x\to-3^+, f(x)f(x)\to-\infty and as xx\to\infty, f(x)f(x)\to\infty.

Key equations

General form for the translation of the parent logarithmic function f(x)=logb(x)f(x)=\log_b(x)f(x)=alogb(x+c)+df(x)=a\log_b(x+c)+d

Key concepts

  • To find the domain of a logarithmic function, set up an inequality showing the argument greater than zero, and solve for xx.
  • The graph of the parent function f(x)=logb(x)f(x)=\log_b(x) has an xx-intercept at (1,0)(1,0), domain (0,)(0,\infty), range (,)(-\infty,\infty), vertical asymptote x=0x=0, and
    • if b>1b>1, the function is increasing.
    • if 0<b<10<b<1, the function is decreasing.
  • The equation f(x)=logb(x+c)f(x)=\log_b(x+c) shifts the parent function y=logb(x)y=\log_b(x) horizontally
    • left cc units if c>0c>0.
    • right cc units if c<0c<0.
  • The equation f(x)=logb(x)+df(x)=\log_b(x)+d shifts the parent function y=logb(x)y=\log_b(x) vertically
    • up dd units if d>0d>0.
    • down dd units if d<0d<0.
  • For any constant a>0a>0, the equation f(x)=alogb(x)f(x)=a\log_b(x)
    • stretches the parent function y=logb(x)y=\log_b(x) vertically by a factor of aa if a>1|a|>1.
    • compresses the parent function y=logb(x)y=\log_b(x) vertically by a factor of aa if a<1|a|<1.
  • When the parent function y=logb(x)y=\log_b(x) is multiplied by 1-1, the result is a reflection about the xx-axis. When the input is multiplied by 1-1, the result is a reflection about the yy-axis.
    • The equation f(x)=logb(x)f(x)=-\log_b(x) represents a reflection of the parent function about the xx-axis.
    • The equation f(x)=logb(x)f(x)=\log_b(-x) represents a reflection of the parent function about the yy-axis.
  • A graphing calculator may be used to approximate solutions to some logarithmic equations.
  • All translations of the logarithmic function can be summarized by the general equation f(x)=alogb(x+c)+df(x)=a\log_b(x+c)+d.
  • Given an equation with the general form f(x)=alogb(x+c)+df(x)=a\log_b(x+c)+d, we can identify the vertical asymptote x=cx=-c for the transformation.
  • Using the general equation f(x)=alogb(x+c)+df(x)=a\log_b(x+c)+d, we can write the equation of a logarithmic function given its graph.

Practice

Identify the domain of a logarithmic function

Find the domain ofh(x)=ln(12x)h(x)=\ln\left(\tfrac{1}{2}-x\right). Write your answer in interval notation.

Find the vertical asymptote off(x)=log(3x+1)f(x)=\log(3x+1).

Find the domain ofh(x)=ln(4x+17)5h(x)=\ln(4x+17)-5. Write your answer in interval notation.

Graph logarithmic functions

The five curves below all share the point (1,0)(1,0) and are labeled A through E.

Which labeled curve above is the graph off(x)=ln(x)f(x)=\ln(x)?

Which labeled curve above is the graph ofh(x)=log5(x)h(x)=\log_5(x)?

Write a logarithmic equation, usingy=log2(x)y=\log_2(x)as the parent function, for the graph shown below.


This section is adapted from Precalculus 2e, Section 4.4: Graphs of Logarithmic Functions by Jay Abramson and OpenStax, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recreated every graph as an accessible spec-first SVG built from its exact equation — the investment logarithmic model t=20ln(A)20ln(2,500)t=20\ln(A)-20\ln(2{,}500) with its labeled “balance reaches $5{,}000 near year 14” point; the f(x)=2xf(x)=2^x/g(x)=log2(x)g(x)=\log_2(x) reflection pair about y=xy=x; the two-panel parent-function characteristics schematic; the three-curve base-comparison graph log2(x)\log_2(x), ln(x)\ln(x), and log(x)\log(x); the f(x)=log5(x)f(x)=\log_5(x) worked example; the two-panel horizontal-shift, vertical-shift, stretch/compression, and reflection schematics (recreated with concrete representative values b=2b=2 and c=2c=2, d=2d=2, or a=2a=2 in place of the source’s symbolic point labels, since the figure engine draws real analytic curves rather than schematic ones); the horizontal-shift, vertical-shift, stretch, and combined shift-and-stretch worked examples; the reflection-about-the-yy-axis panel and the f(x)=log(x)f(x)=\log(-x) worked example, both of which need x<hx<h on their reflected branch — outside the analytic log primitive’s domain — and so are rendered as a dense reflected log curve primitive (added to graph-core.mjs in this pass, which previously could only open rightward from a vertical asymptote); the vertical-asymptote and equation-from-a-graph worked examples; and the five-curve base-comparison figure and the equation-from-a-graph item used in the closing Practice block. Converted the two-column “graph a reflection” How To table into two separate How To callouts, one per reflection axis, matching this book’s callout convention. Presented the four data tables (the 2x2^x/log2(y)\log_2(y) correspondence, the ff/gg ordered-pair correspondence, and the two-part function-value check table, the latter combined into a single ten-column table since its source split was only print pagination) as Markdown tables. Omitted the “Access these online resources” media links. Omitted the corequisite-skills “Objective 1”/“Objective 2” review appendix that precedes this section’s actual content in the pinned CNXML module, since it does not appear in the printed textbook (confirmed against the source PDF) and duplicates material this section itself develops. Converted the ten retained “Try It” checks into interactive fill-ins with instant feedback, several split into a domain question and a vertical-asymptote or key-point question when the original asked for multiple facts at once; every exponential and logarithmic curve in this section is graded through a static figure plus a fill-in or multiple-choice question, except the vertical-shift Try It f(x)=log2(x)+2f(x)=\log_2(x)+2, which is additionally graded as a plot-the-points graph exercise at five named inputs (x=12x=\tfrac{1}{2} through 88, whose outputs land on a half-unit grid) — the plotted points are graded, never the curve through them. And adapted five selected end-of-section exercises — two domain evaluations, one vertical-asymptote evaluation, a graph-matching pair converted to graph-mode multiple choice, and one equation-from-a-graph item — into interactive components in a closing Practice block, one group per objective.