Transformations of Graphs of Logarithmic Functions

Finally, we will transform the graph of logarithmic functions using vertical and horizontal shifts, reflections, and compressions and stretches. Given the graph of a logarithmic function, we will practice defining the equation.

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=log_b(x) without loss of shape.


Graphing a Horizontal Shift of f(x) = log_b(x)

When a constant c is added to the input of the parent function f(x)=log_b(x), the result is a horizontal shift c units in the opposite direction of the sign on c. To visualize horizontal shifts, we can observe the general graph of the parent function f(x)=log_b(x) and for c > 0 alongside the shift left, g(x)=log_b(x+c), and the shift right, h(x)=log_b(x−c). See Figure 6.


Figure 6


HORIZONTAL SHIFTS OF THE PARENT FUNCTION f(x)=log_b(x)

For any constant c,  the function f(x)=log_b(x+c)

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


HOW TO

Given a logarithmic function with the form f(x)=log_b(x+c), graph the translation.

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


EXAMPLE 4

Graphing a Horizontal Shift of the Parent Function y = log_b(x)

Sketch the horizontal shift 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)=log_3(x−2), we notice x+(−2)=x–2.

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

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

Consider the three key points from the parent function, (\frac{1}{3}, −1), (1, 0), and (3, 1).

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

Label the points (\frac{7}{3}, −1), (3,0), and (5,1).

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


Figure 7


TRY IT #4

Sketch a graph of f(x)=log_3(x+4) alongside its parent function. Include the key points and asymptotes on the graph. State the domain, range, and asymptote.


Graphing a Vertical Shift of y = log_b(x)

When a constant d is added to the parent function f(x)=log_b(x), the result is a vertical shift d units in the direction of the sign on d. To visualize vertical shifts, we can observe the general graph of the parent function f(x)=log_b(x) alongside the shift up, g(x)=log_b(x)+d and the shift down, h(x)=log_b(x)−d. See Figure 8.


Figure 8


VERTICAL SHIFTS OF THE PARENT FUNCTION y=log_b(x)

For any constant d, the function f(x)=log_b(x)+d

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


HOW TO

Given a logarithmic function with the form f(x)=log_b(x)+d, graph the translation.

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


EXAMPLE 5

Graphing a Vertical Shift of the Parent Function y = log_b(x)

Sketch a graph of f(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)=log_3(x)−2, we will notice d=–2. Thus d < 0.

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

The vertical asymptote is x=0.

Consider the three key points from the parent function, (\frac{1}{3},−1), (1,0), and (3,1).

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

Label the points (\frac{1}{3},−3), (1,−2), and (3,−1).

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


Figure 9

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


TRY IT #5

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


Graphing Stretches and Compressions of y = log_b(x)

When the parent function f(x)=log_b(x) is multiplied by a constant a > 0, the result is a vertical stretch or compression of the original graph. To visualize stretches and compressions, we set a > 1 and observe the general graph of the parent function f(x)=log_b(x) alongside the vertical stretch, g(x)=alog_b(x) and the vertical compression, h(x)=\frac{1}{a}log_b(x). See Figure 10.


Figure 10


VERTICAL STRETCHES AND COMPRESSIONS OF THE PARENT FUNCTION y=log_b(x)

For any constant a > 1, the function f(x)=alog_b(x)

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


HOW TO

Given a logarithmic function with the form f(x)=alog_b(x), a > 0, graph the translation.

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


EXAMPLE 6

Graphing a Stretch or Compression of the Parent Function y = log_b(x)

Sketch a graph of f(x)=2log_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)=2log_4(x), we will notice a=2.

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

The vertical asymptote is x=0.

Consider the three key points from the parent function, (\frac{1}{4},−1), (1,0), and (4,1).

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

Label the points (\frac{1}{4},−2), (1,0)\), and (4,2).

The domain is (0, \infty), the range is (−\infty, \infty), and the vertical asymptote is x=0. See Figure 11.


Figure 11

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


TRY IT #6

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


EXAMPLE 7

Combining a Shift and a Stretch

Sketch a graph of f(x)=5log(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 Figure 12. The vertical asymptote will be shifted to x=−2. The x-intercept will be (−1,0). The domain will be (−2, \infty). Two points will help give the shape of the graph: (−1,0) and (8,5). We chose x=8 as the x-coordinate of one point to graph because when x=8, x+2=10, the base of the common logarithm.


Figure 12

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


TRY IT #7

Sketch a graph of the function f(x)=3log(x−2)+1. State the domain, range, and asymptote.


Graphing Reflections of f(x) = log_b(x)

When the parent function f(x)=log_b(x) is multiplied by −1, the result is a reflection about the x-axis. When the input is multiplied by −1, the result is a reflection about the y-axis. To visualize reflections, we restrict b > 1, and observe the general graph of the parent function f(x)=log_b(x) alongside the reflection about the x-axis, g(x)=−log_b(x) and the reflection about the y-axis, h(x)=log_b(−x).


Figure 13


REFLECTIONS OF THE PARENT FUNCTION y=log_b(x)

The function f(x)=−log_b(x)

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

The function f(x)=log_b(−x)

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


HOW TO

Given a logarithmic function with the parent function f(x)=log_b(x), graph a translation.

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

Table 3


EXAMPLE 8

Graphing a Reflection of a Logarithmic Function

Sketch a graph of 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), identify the behavior and key points for the graph.

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


Figure 14

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


TRY IT #8

Graph f(x)=−log(−x).  State the domain, range, and asymptote.



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 x, 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 x, for the point(s) of intersection.


EXAMPLE 9

Approximating the Solution of a Logarithmic Equation

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


Solution

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

For a better approximation, press [2ND] then [CALC]. Select [5: intersect] and press [ENTER] three times. The x-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, x \approx 1.339.


TRY IT #9

Solve 5log(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 Table 4 to arrive at the general equation for translating exponential functions.

Translations of the Parent Function y=log_b(x)
Translation Form

Shift

  • Horizontally c units to the left
  • Vertically d units up
y=log_b(x+c)+d

Stretch and Compress

  • Stretch if |a| > 1
  • Compression if |a| < 1
y=alog_b(x)
Reflect about the x-axis y=−log_b(x)
Reflect about the y-axis y=log_b(−x)
General equation for all translations y=alog_b(x+c)+d

Table 4


TRANSLATIONS OF LOGARITHMIC FUNCTIONS

All translations of the parent logarithmic function,  y=log_b(x),  have the form

f(x)=alog_b(x+c)+d

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

  • shifted vertically up d units.
  • shifted horizontally to the left c units.
  • stretched vertically by a factor of |a| if |a| > 0.
  • compressed vertically by a factor of |a| if 0 < |a| < 1.
  • reflected about the x-axis when a < 0.

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


EXAMPLE 10

Finding the Vertical Asymptote of a Logarithm Graph

What is the vertical asymptote of f(x)=−2log_3(x+4)+5?


Solution

The vertical asymptote is at x=−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=−4.


TRY IT #10

What is the vertical asymptote of f(x)=3+ \ln(x−1)?


EXAMPLE 11

Finding the Equation from a Graph

Find a possible equation for the common logarithmic function graphed in Figure 15.


Figure 15


Solution

This graph has a vertical asymptote at x=–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)+k

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

\begin{array}{ll}
1=-a \log (-1+2)+k & \text { Substitute }(-1,1) \\
1=-a \log (1)+k & \text { Arithmetic. } \\
1=k & \log (1)=0
\end{array}

Next, substituting in (2,–1),

\begin{aligned}
-1 &=-a \log (2+2)+1 & & \text { Plug in }(2,-1) \\
-2 &=-a \log (4) & & \text { Arithmetic. } \\
a &=\frac{2}{\log (4)} & & \text { Solve for } a
\end{aligned}

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


Analysis

We can verify this answer by comparing the function values in Table 5 with the points on the graph in Figure 15.

x -1 0 1 2 3
f(x) 1 0 −0.58496 -1 −1.3219
x 4 5 6 7 8
f(x) −1.5850 −1.8074 -2 −2.1699 −2.3219

Table 5


TRY IT #11

Give the equation of the natural logarithm graphed in Figure 16.


Figure 16


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 in Figure 16. The graph approaches x=−3 (or thereabouts) more and more closely, so x=−3 is, or is very close to, the vertical asymptote. It approaches from the right, so the domain is all points to the right,  \{ x|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 x→−3+,f(x)→− \infty and as x→ \infty,f(x)→ \infty.


Source: Rice University, https://openstax.org/books/college-algebra/pages/6-4-graphs-of-logarithmic-functions
Creative Commons License This work is licensed under a Creative Commons Attribution 4.0 License.