Skip to main content

Section 4.5 Graphs of Logarithmic Functions

Subsection 4.5.1 Introduction

Recall that the exponential function \(f(x)=2^{x}\) produces this table of values:
\(x\) \(-3\) \(-2\) \(-1\) \(0\) \(1\) \(2\) \(3\)
\(f(x)\) \(\dfrac{1}{8}\) \(\dfrac{1}{4}\) \(\dfrac{1}{2}\) \(1\) \(2\) \(4\) \(8\)
Since the logarithmic function is an inverse of the exponential, \(g(x)=\log_{2}(x)\) produces the table of values:
\(x\) \(\dfrac{1}{8}\) \(\dfrac{1}{4}\) \(\dfrac{1}{2}\) \(1\) \(2\) \(4\) \(8\)
\(g(x)\) \(-3\) \(-2\) \(-1\) \(0\) \(1\) \(2\) \(3\)
In this second table, notice that:
  1. As the input increases, the output increases.
  2. As the input increases, the output increases more slowly.
  3. Since the exponential function only outputs positive values, the logarithm can only accept positive values as inputs, so the domain of any logarithm function is \((0,\infty)\text{.}\)
  4. Since the exponential function can accept all real numbers as inputs, the logarithm can output any real number, so the range is all real numbers, or \((-\infty,\infty)\text{.}\)
Sketching the graph, notice that as the input approaches zero from the right, the output of the function grows very large in the negative direction, indicating a vertical asymptote at \(x = 0\text{.}\)
A graph that approaches negative infinity as x approaches 0 from the right, and increases curving downwards passing through 1 comma 0, 2 comma 1, 4 comma 2 and 8 comma 3
Figure 4.5.1. Graph of \(g(x)=\log_{2}(x)\)
In symbolic notation we write as \(x\to 0^{+}, f(x)\to -\infty\text{,}\) and as \(x\to \infty, f(x)\to \infty\text{.}\)

Definition 4.5.2. Graphical Features of the Logarithm.

Graphically, in the function \(g(x)=\log_{b}(x)\text{:}\)
When sketching a general logarithm with base \(b\text{,}\) it can be helpful to remember that the graph will pass through the points \((1, 0)\) and \((b, 1)\text{.}\) To get a feeling for how the base affects the shape of the graph, examine the graphs below.
Three log graphs on the same axes, all that approach negative infinity as x approaches 0 from the right, and that increase curving downwards, all passing through 1 comma 0.  The first, labeled log of x, increases most slowly and passes through 10 comma 1.  The second, labeled ln of x, increases more rapidly, and passes through a point around 2.818 comma 1.  The third, labeled log base 2 of x, increases most rapidly, and passes through 2 comma 1.
Notice that the larger the base, the slower the graph grows. For example, the common logarithm graph, while it grows without bound, it does so very slowly. For example, to reach an output of 8, the input must be 100,000,000.
Another important observation made was the domain of the logarithm. Like the reciprocal and square root functions, the logarithm has a restricted domain which must be considered when finding the domain of a composition involving a logarithms.

Example 4.5.3.

Find the domain of the function \(f(x)=\log(5-2x)\text{.}\)

Solution.

The logarithm is only defined with the input is positive, so this function will only be defined when \(5-2x>0\text{.}\) Solving this inequality, this is only true when \(-2x>-5\text{,}\) which is only true when \(x<\dfrac{5}{2}\text{.}\)
The domain of this function is \(x<\dfrac{5}{2}\text{,}\) or in interval notation, \((-\infty,\dfrac{5}{2})\text{.}\)

Checkpoint 4.5.4.

Find the domain of the function \(f(x)=\log(x-5)+2\text{.}\) Before solving this as an inequality, consider how the function has been transformed.

Subsection 4.5.2 Transformations of the Logarithmic Function

Transformations can be applied to a logarithmic function using the basic transformation techniques, but as with exponential functions, several transformations result in interesting relationships.
First recall the change of base property tells us that \(\log_{b}(x)=\dfrac{\log_c(x)}{\log_c(b)}=\dfrac{1}{\log_c(b)}\log_{c}(x)\text{.}\) From this, we can see that \(\log_{b}(x)\) is a vertical stretch or compression of the graph of the \(\log_{c}(x)\) graph. This tells us that a vertical stretch or compression is equivalent to a change of base. For this reason, we will often see graphs of logarithmic functions in terms of the common or natural logarithmic functions.
Next, consider the effect of a horizontal compression on the graph of a logarithmic function. Considering \(f(x)=\log(cx)\text{,}\) we can use the sum property to see \(f(x)=\log(cx)=\log(c)+\log(x)\text{.}\) Since \(\log(c)\) is a constant, the effect of a horizontal compression is the same as the effect of a vertical shift.

Example 4.5.5.

Sketch \(f(x)=\ln(x)\) and \(g(x)=\ln(x)+2\text{.}\)

Solution.

Graphing these,
Two log graphs on the same axes, both which approach negative infinity as x approaches 0 from the right, and that increase curving downwards. The first labeled ln of x passes through 1 comma 0 and 2.818 comma 1.  The second labeled ln of x plus 2 passes through 1 comma 2 and 2.818 comma 3
Note that this vertical shift could also be written as a horizontal compression, since \(g(x)=\ln(x)+2=\ln(x)+\ln(e^{2})=\ln(e^{2}x)\text{.}\)
While a horizontal stretch or compression can be written as a vertical shift, a horizontal reflection is unique and separate from vertical shifting.
Finally, we will consider the effect of a horizontal shift on the graph of a logarithm.

Example 4.5.6.

Sketch a graph of \(f(x)=\ln(x+2)\text{.}\)

Solution.

This is a horizontal shift to the left by 2 units. Notice that none of our logarithm rules allow us rewrite this in another form, so the effect of this transformation is unique. Shifting the graph of \(\ln(x)\) to the left by two units gives us the following graph:
Two log graphs on the same axes, both which approach negative infinity as x approaches 0 from the right, and that increase curving downwards. The first labeled ln of x passes through 1 comma 0 and 2.818 comma 1.  The second labeled ln of x plus 2 passes through 1 comma 2 and 2.818 comma 3
Figure 4.5.7. Graph of \(f(x)=\ln(x+2)\)
Notice that due to the horizontal shift, the vertical asymptote shifted to \(x = -2\text{,}\) and the domain shifted to \((-2,\infty)\text{.}\)
We now combine these transformations in the next example.

Example 4.5.8.

Sketch a graph of \(f(x)=5\log(-x+2)\text{.}\)

Solution.

Factoring the inside as \(f(x)=5\log(-(x-2))\) reveals that this graph is that of the common logarithm, horizontally reflected, vertically stretched by a factor of 5, and shifted to the right by 2 units.
So, we can tell that the vertical asymptote will be shifted to \(x = 2\text{,}\) and the graph will have domain \((-\infty,2)\) (due to the horizontal reflection). A rough sketch can be created by using the vertical asymptote along with a couple points on the graph, such as \(f(1)=5\log(-1+2)=5\log(1)=0\) and \(f(-8)=5\log(-(-8)+2)=5\log(10)=5\text{.}\)
A graph that decreases curving downwards, passing through negative 8 comma 5 and 1 comma 0 and approaches negative infinity as x approaches 2 from the left.
Figure 4.5.9. Graph of \(f(x)=5\log(-x+2)\)

Checkpoint 4.5.10.

Sketch a graph of the function \(f(x)=-3\log(x-2)+1\text{.}\)

Definition 4.5.11. Transformations of Logarithms.

Any transformed logarithmic function can be written in the form \(f(x)=a\log(x-b)+k\text{,}\) or \(f(x)=a\log(-(x-b))+k\) if horizontally reflected, where \(x = b\) is the vertical asymptote.

Example 4.5.12.

Find an equation for the logarithmic function graphed here.
A graph that approaches infinity as x approaches negative 2 from the right and decreases curving upwards, passing through negative 1 comma 1, 0 comma 0, and 2 comma negative 1

Solution.

This graph has a vertical asymptote at \(x =-2\) and has been vertically reflected. We do not know yet the vertical shift (equivalent to horizontal stretch) or the vertical stretch (equivalent to a change of base). We know so far that the equation will have form \(f(x)=-a\log(x+2)+k\text{.}\)
It appears the graph passes through the points \((-1, 1)\) and \((2,-1)\text{.}\) Substituting in \((-1, 1)\text{,}\) we can see: \(1=-a\log(-1+2)+k\text{,}\) so \(1=-a\log(1)+k\text{,}\) and since \(\log(1)=0\text{,}\) we know that \(1=k\text{.}\)
Next, substituting in \((2,-1)\text{,}\) we see that \(-1=-a\log(2+2)+1\text{.}\) Simplifying gives us \(-2=-a\log( 4)\text{,}\) and thus \(a=\dfrac{2}{\log(4)}\text{.}\)
This gives us the equation \(f(x)=\dfrac{-2}{\log(4)}\log(x+2)+1\text{.}\) This could also be written as \(f(x)=-2\log_{4}(x+2)+1\text{.}\)

Checkpoint 4.5.14.

Write the domain and range of the function \(f(x)=-2\log_{4}(x+2)+1\text{,}\) and describe its long run behavior.

Subsection 4.5.3 Answers

Checkpoint 4.5.15.

Answers to Checkpoint Exercises
Answer.
  1. Domain: \(x > 5\text{,}\) \((5,\infty)\text{.}\)
  2. A graph that approaches infinity as x approaches 2 from the right and decreases curving upwards, passing through 3 comma 1, 4 comma 0, and 12 comma negative 2
  3. The graph is horizontally reflected and has a vertical asymptote at \(x = 3\text{,}\) giving the form \(f(x)=a\log(-(x-3))+k\text{.}\) Substituting in the point \((2,0)\) gives \(0=a\log(-(2-3))+k\text{,}\) simplifying to \(k = 0\text{.}\) Substituting in \((-2,-2)\text{,}\) \(-2=a\log(-(-2-3))\text{,}\) so \(\dfrac{-2}{\log( 5)}=a\text{.}\) The equation is \(f(x)=\dfrac{-2}{\log( 5)}\log(-(x-3))\) or \(f(x)=-2\log_{5}(-(x-3))\text{.}\)
  4. Domain: \(x>-2\) or \((-2,\infty)\text{.}\) Range: all real numbers, or \((-\infty, \infty)\text{.}\) As \(x\to-2^{+}, f(x)\to \infty\) and as \(x\to\infty, f(x)\to-\infty\text{.}\)