## Graphs of Logarithmic Functions

### LEARNING Outcomes

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

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={b}^{x}$ for any real number x and constant $b>0$, $b\ne 1$, where

• The domain of is $\left(-\infty ,\infty \right)$.
• The range of is $\left(0,\infty \right)$.

In the last section we learned that the logarithmic function $y={\mathrm{log}}_{b}\left(x\right)$ is the inverse of the exponential function $y={b}^{x}$. So, as inverse functions:

• The domain of $y={\mathrm{log}}_{b}\left(x\right)$ is the range of $y={b}^{x}$: $\left(0,\infty \right)$.
• The range of $y={\mathrm{log}}_{b}\left(x\right)$ is the domain of $y={b}^{x}$: $\left(-\infty ,\infty \right)$.

### How To: Given a logarithmic function, identify the domain

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

In our first example, we will show how to identify the domain of a logarithmic function.

### Example

What is the domain of $f\left(x\right)={\mathrm{log}}_{2}\left(x+3\right)$?

Here is another example of how to identify the domain of a logarithmic function.

### Example

What is the domain of $f\left(x\right)=\mathrm{log}\left(5 - 2x\right)$?

## Graph Logarithmic Functions

Creating a graphical representation of most functions 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 \$2500 in an account that offers an annual interest rate of $5\%$, compounded continuously. We already know that the balance in our account for any year t can be found with the equation $A=2500{e}^{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 image below shows this point on the logarithmic graph.

A logarithmic graph showing how many years it will take for an account balance to double.

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={\mathrm{log}}_{b}\left(x\right)$ along with all its transformations: shifts, stretches, compressions, and reflections.

We begin with the parent function $y={\mathrm{log}}_{b}\left(x\right)$. Because every logarithmic function of this form is the inverse of an exponential function of the form $y={b}^{x}$, their graphs will be reflections of each other across the line $y=x$. To illustrate this, we can observe the relationship between the input and output values of $y={2}^{x}$ and its equivalent $x={\mathrm{log}}_{2}\left(y\right)$ in the table below.

 x $–3$ $–2$ $–1$ $0$ $1$ $2$ $3$ ${2}^{x}=y$ $\frac{1}{8}$ $\frac{1}{4}$ $\frac{1}{2}$ $1$ $2$ $4$ $8$ ${\mathrm{log}}_{2}\left(y\right)=x$ $–3$ $–2$ $–1$ $0$ $1$ $2$ $3$

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\left(x\right)={2}^{x}$ and $g\left(x\right)={\mathrm{log}}_{2}\left(x\right)$.

 $f\left(x\right)={2}^{x}$ $\left(-3,\frac{1}{8}\right)$ $\left(-2,\frac{1}{4}\right)$ $\left(-1,\frac{1}{2}\right)$ $\left(0,1\right)$ $\left(1,2\right)$ $\left(2,4\right)$ $\left(3,8\right)$ $g\left(x\right)={\mathrm{log}}_{2}\left(x\right)$ $\left(\frac{1}{8},-3\right)$ $\left(\frac{1}{4},-2\right)$ $\left(\frac{1}{2},-1\right)$ $\left(1,0\right)$ $\left(2,1\right)$ $\left(4,2\right)$ $\left(8,3\right)$

As we would expect, the x– and y-coordinates are reversed for the inverse functions. The figure below shows the graph of f and g.

Notice that the graphs of $f\left(x\right)={2}^{x}$ and $g\left(x\right)={\mathrm{log}}_{2}\left(x\right)$ are reflections about the line = x.

Observe the following from the graph:

• $f\left(x\right)={2}^{x}$ has a y-intercept at $\left(0,1\right)$ and $g\left(x\right)={\mathrm{log}}_{2}\left(x\right)$ has an x-intercept at $\left(1,0\right)$.
• The domain of $f\left(x\right)={2}^{x}$, $\left(-\infty ,\infty \right)$, is the same as the range of $g\left(x\right)={\mathrm{log}}_{2}\left(x\right)$.
• The range of $f\left(x\right)={2}^{x}$, $\left(0,\infty \right)$, is the same as the domain of $g\left(x\right)={\mathrm{log}}_{2}\left(x\right)$.

### A General Note: Characteristics of the Graph of the Parent Function, f(x) = logb(x)

For any real number x and constant > 0, $b\ne 1$, we can see the following characteristics in the graph of $f\left(x\right)={\mathrm{log}}_{b}\left(x\right)$:

• one-to-one function
• vertical asymptote: =$0$
• domain: $\left(0,\infty \right)$
• range: $\left(-\infty ,\infty \right)$
• x-intercept: $\left(1,0\right)$ and key point $\left(b,1\right)$
• y-intercept: none
• increasing if $b>1$
• decreasing if $0 \lt b \lt 1$

The figure below shows how changing the base b in $f\left(x\right)={\mathrm{log}}_{b}\left(x\right)$ can affect the graphs. Observe that the graphs compress vertically as the value of the base increases. (Note: recall that the function $\mathrm{ln}\left(x\right)$ has base $e\approx \text{2}.\text{718.)}$

The graphs of three logarithmic functions with different bases, all greater than 1.

In our next example, we will graph a logarithmic function of the form $f\left(x\right)={\mathrm{log}}_{b}\left(x\right)$.

### Example

Graph $f\left(x\right)={\mathrm{log}}_{5}\left(x\right)$. State the domain and range.

### How To: Given a logarithmic function of the form $f\left(x\right)={\mathrm{log}}_{b}\left(x\right)$, graph the function

1. Plot the x-intercept, $\left(1,0\right)$.
2. Plot the key point $\left(b,1\right)$.
3. Draw a smooth curve through the points.
4. State the domain, $\left(0,\infty \right)$, and the range, $\left(-\infty ,\infty \right)$.

## Summary

To define the domain of a logarithmic function algebraically, set the argument greater than zero and solve. To plot a logarithmic function, it is easiest to find and plot the x-intercept and the key point $\left(b,1\right)$.