# 4.5: Graphs of Logarithmic Functions

- Page ID
- 13854

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

Recall that the exponential function \(f(x)=2^{x}\) produces this table of values

x |
-3 | -2 | -1 | 0 | 1 | 2 | 3 |
---|---|---|---|---|---|---|---|

f(x) |
\(\frac{1}{8}\) | \(\frac{1}{4}\) | \(\frac{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 |
\(\frac{1}{8}\) | \(\frac{1}{4}\) | \(\frac{1}{2}\) | 1 | 2 | 4 | 8 |
---|---|---|---|---|---|---|---|

g(x) |
-3 | -2 | -1 | 0 | 1 | 2 | 3 |

In this second table, notice that

- As the input increases, the output increases.
- As input increases, the output increases more slowly.
- Since the exponential function only outputs positive values, the logarithm can only accept positive values as inputs, so the domain of the log function is \((0,\infty )\).
- 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 )\).

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.

In symbolic notation we write

as \(x\to 0^{+} ,f(x)\to -\infty\), and as\(x\to \infty ,f(x)\to \infty\)

### Graphical Features of the Logarithm

Graphically, in the function \(g(x)=\log _{b} (x)\)

The graph has a horizontal intercept at (1, 0)

The graph has a vertical asymptote at *x* = 0

The graph is increasing and concave down

The domain of the function is *x* \(\mathrm{>}\) 0, or \((0,\infty )\)

The range of the function is all real numbers, or \((-\infty ,\infty )\)

When sketching a general logarithm with base *b*, it can be helpful to remember that the graph will pass through the points (1, 0) and (*b*, 1).

To get a feeling for how the base affects the shape of the graph, examine the graphs below.

Notice that the larger the base, the slower the graph grows. For example, the common log 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 log.

Example \(\PageIndex{1}\):

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

**Solution**

The logarithm is only defined with the input is positive, so this function will only be defined when \(5-2x>0\). Solving this inequality, \[\begin{array}{l} {-2x>-5} \\ {x<\frac{5}{2} } \end{array}\]

The domain of this function is \(x<\frac{5}{2}\), or in interval notation, \(\left(-\infty ,\frac{5}{2} \right)\)

Exercise \(\PageIndex{1}\)

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

**Answer**-
Add answer text here and it will automatically be hidden if you have a "AutoNum" template active on the page.

**Transformations of the Logarithmic ****Function**Logarithmic Functions: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=\frac{\log _{c} x}{\log _{c} b} =\frac{1}{\log _{c} b} \log _{c} x\)

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 typically represent all graphs of logarithmic functions in terms of the common or natural log functions.

Next, consider the effect of a horizontal compression on the graph of a logarithmic function. Considering \(f(x)=\log (cx)\), we can use the sum property to see \[f(x)=\log (cx)=\log (c)+\log (x)\]

Since log(*c*) is a constant, the effect of a horizontal compression is the same as the effect of a vertical shift.

Example \(\PageIndex{2}\)

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

Graphing these,

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).\]

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 \(\PageIndex{3}\):

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

**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,

Notice that due to the horizontal shift, the vertical asymptote shifted to *x* = -2, and the domain shifted to \((-2,\infty )\).

Combining these transformations,

Example \(\PageIndex{4}\):

Add text here. For the automatic number to work, you need to add the "AutoNum" template (preferably at the end) to the page.

Exercise \(\PageIndex{2}\)

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

**Answer**-
Add answer text here and it will automatically be hidden if you have a "AutoNum" template active on the page.

### Transformations of Logs

Any transformed logarithmic function can be written in the form

\(f(x)=a\log (x-b)+k\), or \(f(x)=a\log \left(-\left(x-b\right)\right)+k\) if horizontally reflected,

where *x = b* is the vertical asymptote.

Example \(\PageIndex{5}\)

Find an equation for the logarithmic function graphed.

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\]

It appears the graph passes through the points (–1, 1) and (2, –1). Substituting in (–1, 1), \[\begin{array}{l} {1=-a\log (-1+2)+k} \\ {1=-a\log (1)+k} \\ {1=k} \end{array}\]

Next, substituting in (2, –1), \[\begin{array}{l} {-1=-a\log (2+2)+1} \\ {-2=-a\log (4)} \\ {a=\frac{2}{\log (4)} } \end{array}\]

This gives us the equation \(f(x)=-\frac{2}{\log \eqref{GrindEQ__4_}} \log (x+2)+1\).

This could also be written as \(f(x)=-2\log _{4} (x+2)+1\).

Exercise \(\PageIndex{3}\)

Write an equation for the function graphed here.

**Answer**-
Add answer text here and it will automatically be hidden if you have a "AutoNum" template active on the page.

Flashback

4. Write the domain and range of the function graphed in Example 5, and describe its long run behavior.

### Important Topics of this Section

- Graph of the logarithmic function (domain and range)
- Transformation of logarithmic functions
- Creating graphs from equations
- Creating equations from graphs

Try it Now and Flashback Answers

1. Domain: \(\mathrm{\{}\)*x* *x* \(\mathrm{>}\) 5\(\mathrm{\}}\)

2.

3. The graph is horizontally reflected and has a vertical asymptote at *x* = 3, giving form \(f(x)=a\log \left(-\left(x-3\right)\right)+k\). Substituting in the point (2,0) gives \(0=a\log \left(-\left(2-3\right)\right)+k\), simplifying to *k* = 0. Substituting in (-2,-2), \(-2=a\log \left(-\left(-2-3\right)\right)\), so \(\frac{-2}{\log \eqref{GrindEQ__5_}} =a\).The equation is \(f(x)=\frac{-2}{\log \eqref{GrindEQ__5_}} \log \left(-\left(x-3\right)\right)\) or \(f(x)=-2\log _{5} \left(-\left(x-3\right)\right)\).

4. Domain: \(\mathrm{\{}\)*x* *x*\(\mathrm{>}\)-2\(\mathrm{\}}\), Range: all real numbers; As \(x\to -2^{+} ,f(x)\to \infty\)and as \(x\to \infty ,f(x)\to -\infty\). \[309\]

Section 4.5 Graphs of Logarithmic Functions

Section 4.6 Exponential and Logarithmic Models

Notice that on the log scale above Example 8, the visual distance on the scale between points *A* and *B* and between *C* and *D* is the same. When looking at the values these points correspond to, notice *B* is ten times the value of *A*, and *D* is ten times the value of *C*. A visual *linear* difference between points corresponds to a *relative* (ratio) change between the corresponding values.

Logarithms are useful for showing these relative changes. For example, comparing $1,000,000 to $10,000, the first is 100 times larger than the second. \[\frac{1,000,000}{10,000} =100=10^{2}\]

Likewise, comparing $1000 to $10, the first is 100 times larger than the second. \[\frac{1,000}{10} =100=10^{2}\]

When one quantity is roughly ten times larger than another, we say it is one **order of magnitude** larger. In both cases described above, the first number was two orders of magnitude larger than the second.

Notice that the order of magnitude can be found as the common logarithm of the ratio of the quantities. On the log scale above, *B* is one order of magnitude larger than *A*, and *D* is one order of magnitude larger than *C*.

**Orders of Magnitude**

Given two values *A* and *B*, to determine how many **orders of magnitudeOrders of ****Magnitude**Logarithmic Functions:Orders of Magnitude *A* is greater than *B*,

Difference in orders of magnitude = \(\log \left(\frac{A}{B} \right)\)

Example \(\PageIndex{1}\):

Add text here. For the automatic number to work, you need to add the "AutoNum" template (preferably at the end) to the page.

10

On the log scale above Example 8, how many orders of magnitude larger is *C* than *B*?

The value *B* corresponds to \(10^{2} =100\)

The value *C* corresponds to \(10^{5} =100,000\)

The relative change is \(\frac{100,000}{100} =1000=\frac{10^{5} }{10^{2} } =10^{3}\). The log of this value is 3.

*C* is three orders of magnitude greater than *B*, which can be seen on the log scale by the visual difference between the points on the scale.

Exercise \(\PageIndex{1}\)

Add exercises text here. For the automatic number to work, you need to add the "AutoNum" template (preferably at the end) to the page.

**Answer**-

6. Using the table from Try it Now #5, what is the difference of order of magnitude between the softest sound a human can hear and the launching of the space shuttle?

**Earthquakes**

An example of a logarithmic scale is the Moment Magnitude Scale (MMS) used for earthquakes. This scale is commonly and mistakenly called the Richter Scale, which was a very similar scale succeeded by the MMS.

**Moment Magnitude Scale**

**Moment Magnitude ****Scale**Logarithmic Functions:Moment Magnitude ScaleFor an earthquake with seismic moment *S*, a measurement of earth movement, the MMS value, or magnitude of the earthquake, is \[M=\frac{2}{3} \log \left(\frac{S}{S_{0} } \right)\] Where \(S_{0} =10^{16}\) is a baseline measure for the seismic moment.

Example \(\PageIndex{1}\):

Add text here. For the automatic number to work, you need to add the "AutoNum" template (preferably at the end) to the page.

11

If one earthquake has a MMS magnitude of 6.0, and another has a magnitude of 8.0, how much more powerful (in terms of earth movement) is the second earthquake?

Since the first earthquake has magnitude 6.0, we can find the amount of earth movement for that quake, which we’ll denote *S*\({}_{1}\). The value of *S*\({}_{0}\) is not particularly relevant, so we will not replace it with its value. \[6.0=\frac{2}{3} \log \left(\frac{S_{1} }{S_{0} } \right)\] \[6.0\left(\frac{3}{2} \right)=\log \left(\frac{S_{1} }{S_{0} } \right)\] \[9=\log \left(\frac{S_{1} }{S_{0} } \right)\] \[\frac{S_{1} }{S_{0} } =10^{9}\] \[S_{1} =10^{9} S_{0}\]

This tells us the first earthquake has about 10\({}^{9}\) times more earth movement than the baseline measure.

Doing the same with the second earthquake, *S*\({}_{2}\), with a magnitude of 8.0, \[8.0=\frac{2}{3} \log \left(\frac{S_{2} }{S_{0} } \right)\] \[S_{2} =10^{12} S_{0}\]

Comparing the earth movement of the second earthquake to the first, \[\frac{S_{2} }{S_{1} } =\frac{10^{12} S_{0} }{10^{9} S_{0} } =10^{3} =1000\]

The second value’s earth movement is 1000 times as large as the first earthquake.

Example \(\PageIndex{1}\):

12

One earthquake has magnitude of 3.0. If a second earthquake has twice as much earth movement as the first earthquake, find the magnitude of the second quake.

Since the first quake has magnitude 3.0, \[3.0=\frac{2}{3} \log \left(\frac{S}{S_{0} } \right)\]

Solving for *S*, \[\begin{array}{l} {3.0\left(\frac{3}{2} \right)=\log \left(\frac{S}{S_{0} } \right)} \\ {4.5=\log \left(\frac{S}{S_{0} } \right)} \\ {10^{4.5} =\frac{S}{S_{0} } } \\ {S=10^{4.5} S_{0} } \end{array}\]

Since the second earthquake has twice as much earth movement, for the second quake, \[S=2\cdot 10^{4.5} S_{0}\]

Finding the magnitude, \[M=\frac{2}{3} \log \left(\frac{2\cdot 10^{4.5} S_{0} }{S_{0} } \right)\] \[M=\frac{2}{3} \log \left(2\cdot 10^{4.5} \right)\approx 3.201\]

The second earthquake with twice as much earth movement will have a magnitude of about 3.2.

In fact, using log properties, we could show that whenever the earth movement doubles, the magnitude will increase by about 0.201: \[M=\frac{2}{3} \log \left(\frac{2S}{S_{0} } \right)=\frac{2}{3} \log \left(2\cdot \frac{S}{S_{0} } \right)\] \[M=\frac{2}{3} \left(\log (2)+\log \left(\frac{S}{S_{0} } \right)\right)\] \[M=\frac{2}{3} \log (2)+\frac{2}{3} \log \left(\frac{S}{S_{0} } \right)\] \[M=0.201+\frac{2}{3} \log \left(\frac{S}{S_{0} } \right)\]

This illustrates the most important feature of a log scale: that *multiplying* the quantity being considered will *add* to the scale value, and vice versa.

**Important Topics of this Section**

Radioactive decay

Half life

Doubling time

Newton’s law of cooling

Logarithmic Scales

Orders of Magnitude

Moment Magnitude scale

Try it Now Answers

1. \(r=\sqrt[{10}]{\frac{1}{2} } -1\approx -0.067\) or 6.7% is the daily rate of decay.

2. Less than 230 years, 229.3157 to be exact

3. Solving \(a(1+0.066)^{t} =2a\), it will take \(t=\frac{\log \eqref{GrindEQ__2_}}{\log \eqref{GrindEQ__1_066_}} \approx\)10.845 years, or approximately 11 years, for tuition to double.

4. \(T(t)=ae^{kt} +70\). Substituting (0, 40), we find *a* = -30. Substituting (1, 45), we solve\(45=-30e^{k\eqref{GrindEQ__1_}} +70\) to get \(k=\ln \left(\frac{25}{30} \right)=-0.1823\).Solving \(60=-30e^{-0.1823t} +70\) gives\(t=\frac{\ln (1/3)}{-0.1823} =6.026\) hours

5. \[321\]

Section 4.6 Exponential and Logarithmic Models

6. \(\frac{2x10^{9} }{2x10^{1} } =10^{8}\). The sound pressure in µPa created by launching the space shuttle is 8 orders of magnitude greater than the sound pressure in µPa created by the softest sound a human ear can hear.