Skip to main content
Mathematics LibreTexts

4.4: Graphs of Logarithmic Functions

  • Page ID
    174528
    • Roy Simpson, Cosumnes River College
    • OpenStax

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

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

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

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

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

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

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

    \(\newcommand{\longvect}{\overrightarrow}\)

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

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives
    • Identify the domain of a logarithmic function.
    • Graph logarithmic functions.
    CRC-Logo-Vertical-RGB.png
    Hawk A.I. Section-Specific Tutor
    Please note that, to access the Hawk A.I. Tutor, you will need a (free) OpenAI account.

    When we investigated 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 $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? Figure \( \PageIndex{ 1 } \) shows this point on the logarithmic graph.

    Figure \( \PageIndex{ 1 } \)
     
    A graph titled, “Logarithmic Model Showing Years as a Function of the Balance in the Account”. The x-axis is labeled, “Account Balance”, and the y-axis is labeled, “Years”. The line starts at $25,000 on the first year. The graph also notes that the balance reaches $5,000 near year 14.

    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 = b^x \) for any real number \(x\) and constant \( b > 0 \), \(b \neq 1\), where the domain of \(y\) is \( \left( -\infty, \infty \right) \) and the range of \(y\) is \( \left( 0, \infty \right) \).

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

    • The domain of \( y = \log_b(x) \) is the range of \( y = b^x \): \( \left( 0, \infty \right) \).
    • The range of \( y = \log_b(x) \) is the domain of \( y = b^x \): \( \left( -\infty, \infty \right) \).
    Theorem: Domain and Range of the Logarithmic Function

    The domain of the logarithmic function \( f(x) = \log_b(x) \) is \( \left( 0,\infty \right) \) and the range is \( \left( -\infty,\infty \right) \).

    Proof
    Let \( y = \log_b(x) \). Since the logarithm base \( b \) is the inverse of the exponential function base \( b \), the domain of the logarithm is the range of the exponential function. This is precisely \( \left( 0,\infty \right) \). Moreover, the range of the logarithm is the domain of the exponential function, which is \( \left( -\infty,\infty \right) .\)

    Transformations of the parent function \( 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 — to the parent function without loss of shape.

    We have seen that certain transformations can change the range of \( y = b^x \). Similarly, applying transformations to the parent function \( 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 strictly greater than zero.

    For example, consider \( f(x) = \log_4(2x - 3) \). This function is defined for any values of \(x\) such that the argument, in this case \(2x−3\), is greater than zero. To find the domain, we set up an inequality and solve for \(x\):\[ \begin{array}{rrclcl} & 2x - 3 & > & 0 & & \\[6pt] \implies & 2x & > & 3 & \quad & \left( \text{adding }3\text{ to both sides} \right) \\[6pt] \implies & x & > & 1.5 & \quad & \left( \text{dividing both sides by }2 \right) \\[6pt] \end{array} \nonumber \]In interval notation, the domain of \( f(x) = \log_4(2x - 3) \) is \(( 1.5, \infty )\).

    Example \( \PageIndex{ 1 } \): Identifying the Domain of a Logarithmic Shift

    What is the domain of \( 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 > 0\). Solving this inequality,\[ x + 3 > 0 \implies x > -3. \nonumber \]The domain of \( f(x) = \log_2(x + 3) \) is \(( −3, \infty )\).

    Checkpoint \( \PageIndex{ 1 } \)

    What is the domain of \( f(x) = \log_5(x - 2) + 1 \)?

    Example \( \PageIndex{ 2 } \): Identifying the Domain of a Logarithmic Shift and Reflection

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

    Solution

    The logarithmic function is defined only when the input is positive, so this function is defined when \(5–2x>0\). Solving this inequality,\[ \begin{array}{rrclcl} & 5 - 2x & > & 0 & & \\[6pt] \implies & -2x & > & -5 & \quad & \left( \text{subtracting }5\text{ from both sides} \right) \\[6pt] \implies & x & < & \dfrac{5}{2} & \quad & \left( \text{dividing both sides by }-2\text{ and switching the inequality} \right) \\[6pt] \end{array} \nonumber \]The domain of \( f(x) = \log(5 - 2x) \) is \(\left( –\infty, \frac{5}{2} \right)\).

    Checkpoint \( \PageIndex{ 2 } \)

    What is the domain of \(f(x)=\log(x−5)+2\)?

    Of course, there is no need to restrict the argument of a logarithm to linear expressions. We can rely on the graphing skills we built in previous chapters to find the domain of the following example.

    Example \(\PageIndex{3}\): Identifying the Domain of a Logarithm Composed with a Nonlinear Function

    State the domain of the function.\[ g(x) = -2 \log_5 \left( \dfrac{2x^3 - 3x^2 - 3x + 2}{3x^3 + 375} \right) \nonumber \]

    Solution

    Since the argument of a logarithm must be positive, answering this question requires us to solve\[ \dfrac{2x^3 - 3x^2 - 3x + 2}{3x^3 + 375} > 0. \nonumber \]From our previous work, we have two ways to solve this rational inequality - sign charts or a quick graph. As you probably will guess, I am in favor of a quick sketch. In either case, we will need to factor the numerator and denominator of the rational expression.

    Factoring the denominator is the easier task, so we start there.\[ \begin{array}{rclcl} 3x^3 + 375 & = & 3\left( x^3 + 125 \right) & \quad & \left( \text{factoring out the GCF} \right) \\[6pt] & = & 3\left( x + 5 \right)\left( x^2 - 5x + 25 \right) & \quad & \left( \text{factoring the sum of cubes} \right) \\[6pt] \end{array} \nonumber \]Hence, the rational inequality is\[ \dfrac{2x^3 - 3x^2 - 3x + 2}{3\left( x + 5 \right)\left( x^2 - 5x + 25 \right)} > 0, \nonumber \]where the trinomial in the denominator is prime (i.e., it does not have real zeros).

    Turning our attention to the numerator, we are forced to use the Rational Zeros Theorem. The candidate roots are \( \pm 1 \), \( \pm 2 \), and \( \pm \frac{1}{2} \). Starting with \( 1 \), we get\[\begin{array}{r}
    \underline{1} \mid & 2 & -3 & -3 & 2 \\
    & & 2 & -1 & -4 \\
    \hline & 2 & -1 & -4 & -2 \\
    \end{array}\nonumber \]Since the remainder is nonzero, \( (x - 1) \) is not a factor. Let's move to \( -1 \).\[\begin{array}{r}
    \underline{-1} \mid & 2 & -3 & -3 & 2 \\
    & & -2 & 5 & -2 \\
    \hline & 2 & -5 & 2 & 0 \\
    \end{array}\nonumber \]The remainder is zero. Therefore, \( (x - (-1)) = (x + 1) \) is a factor. Moreover, the remaining factor is \( 2x^2 - 5x + 2 = \left( 2x - 1 \right)\left( x - 2 \right) \). Thus, the rational inequality we need to solve can be rewritten as\[ \dfrac{(x+1)(2x - 1)(x - 2)}{3(x + 5)(x^2 - 5x + 25)} > 0. \nonumber \]The intercepts of the function on the left side are \( (-1,0) \), \( \left( \frac{1}{2},0 \right) \), \( (2, 0) \), and \( \left( 0, \frac{2}{375} \right) \). The vertical asymptote is \( x = -5 \) and the horizontal asymptote is \( y = \frac{2}{3} \). Noting that the multiplicities of the \( x \)-intercepts are all \( 1 \) and the multiplicity of the vertical asymptote is odd, we quickly sketch the following graph.

    372 4.4 Example 3.png

    We can see this graph is above the \( x \)-axis on the interval \( \left( -\infty,-5 \right) \cup \left( -1, \frac{1}{2} \right) \cup \left( 2, \infty \right)\). Hence, this is the domain of the logarithmic function.

    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 = \log_b(x) \) along with all its transformations: shifts, stretches, compressions, and reflections.

    We begin with the parent function \( y = \log_b(x) \). Because every logarithmic function of this form is the inverse of an exponential function with 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 = \log_2(y) \) in Table \( \PageIndex{ 1 } \).

    Table \( \PageIndex{ 1 } \)
     
    \(x\) \(−3\) \(−2\) \(−1\) \(0\) \(1\) \(2\) \(3\)
    \( 2^x = y \) \( \frac{1}{8} \) \( \frac{1}{4} \) \( \frac{1}{2} \) \(1\) \(2\) \(4\) \(8\)
    \( \log_2(y) = x \) \(−3\) \(−2\) \(−1\) \(0\) \(1\) \(2\) \(3\)

    Using the inputs and outputs from Table \( \PageIndex{ 1 } \), we can build another table to observe the relationship between points on the graphs of the inverse functions \( f(x) = 2^x \) and \( g(x) = \log_2(x) \). See Table \( \PageIndex{ 2 } \).

    Table \( \PageIndex{ 2 } \)
     
    \( f(x) = 2^x \) \( \left( -3, \frac{1}{8} \right) \) \( \left( -2, \frac{1}{4} \right) \) \( \left( -1, \frac{1}{2} \right) \) \(( 0, 1 )\) \(( 1, 2 )\) \(( 2, 4 )\) \(( 3, 8 )\)
    \( g(x) = \log_2(x) \) \( \left( \frac{1}{8}, -3 \right) \) \( \left( \frac{1}{4}, -2 \right) \) \( \left( \frac{1}{2}, -1 \right) \) \(( 1, 0 )\) \(( 2, 1 )\) \(( 4, 2 )\) \(( 8, 3 )\)

    As we’d expect, the \( x \)- and \( y \)-coordinates are reversed for the inverse functions. Figure \( \PageIndex{ 2 } \) shows the graph of \(f\) and \(g\).

    Figure \( \PageIndex{ 2 } \)

    Notice that the graphs of \( f(x) = 2^x \) and \( g(x) = \log_2(x) \) are reflections about the line \(y=x\).
     
    Graph of two functions, f(x)=2^x and g(x)=log_2(x), with the line y=x denoting the axis of symmetry.

    Observe the following from the graph:

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

    This leads to the following theorem.

    Theorem: Properties of the Graphs of Logarithmic Functions

    A logarithmic function with the form \( f(x) = \log_b(x) \), where \(b > 0\) and \(b \neq 1\), has these characteristics:

    • one-to-one function
    • vertical asymptote: \(x=0\)
    • domain: \((0 , \infty )\)
    • range: \((-\infty, \infty )\)
    • \( x \)-intercept: \( \left( 1,0 \right) \)
    • Secondary key point: \( \left( b, 1 \right) \)
    • \( y \)-intercept: none
    • increasing if \(b>1\)
    • decreasing if \(0<b<1\)
    Two graphs of the function f(x)=log_b(x) with points (1,0) and (b, 1). The first graph shows the line when b

    Figure \( \PageIndex{ 3 } \) shows how changing the base \(b\) in \( 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 )\) has base \(e \approx 2.718\)).

    Figure \( \PageIndex{ 3 } \)

    The graphs of three logarithmic functions with different bases, all greater than 1.
     
    Graph of three equations: y=log_2(x) in blue, y=ln(x) in orange, and y=log(x) in red. The y-axis is the asymptote.
    Example \( \PageIndex{ 4 } \): Graphing a Logarithmic Function with the Form \(f(x) = \log_b(x) \).

    Graph \( 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=5\) is greater than one, we know the function is increasing. The left tail of the graph will approach the vertical asymptote \(x=0\), and the right tail will increase slowly without bound.
    • The \( x \)-intercept is \( (-1, 0) \).
    • The key point \(( 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 Figure \( \PageIndex{ 4 } \)).
    Figure \( \PageIndex{ 4 } \)
     
    Graph of f(x)=log_5(x) with labeled points at (1, 0) and (5, 1). The y-axis is the asymptote.

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

    Checkpoint \( \PageIndex{ 4 } \)

    Graph \( f(x) = \log_{1/5}(x) \). State the domain, range, and asymptote.

    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 \( \PageIndex{ 5 } \).

    Figure \( \PageIndex{ 5 } \)
     
    Graph of two functions. The parent function is f(x)=log_b(x), with an asymptote at x=0  and g(x)=log_b(x+c) is the translation function with an asymptote at x=-c. This shows the translation of shifting left.
    Example \( \PageIndex{ 5 } \): 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, \( \left( \frac{1}{3}, -1 \right) \), \(( 1, 0 )\), and \(( 3, 1 )\).

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

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

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

    Figure \( \PageIndex{ 6 } \)
     
    Graph of two functions. The parent function is y=log_3(x), with an asymptote at x=0 and labeled points at (1/3, -1), (1, 0), and (3, 1).The translation function f(x)=log_3(x-2) has an asymptote at x=2 and labeled points at (3, 0) and (5, 1).
    Checkpoint \( \PageIndex{ 5 } \)

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

    Figure \( \PageIndex{ 7 } \)
     
    Graph of two functions. The parent function is f(x)=log_b(x), with an asymptote at x=0  and g(x)=log_b(x)+d is the translation function with an asymptote at x=0. This shows the translation of shifting up. Graph of two functions. The parent function is f(x)=log_b(x), with an asymptote at x=0  and g(x)=log_b(x)-d is the translation function with an asymptote at x=0. This shows the translation of shifting down.
    Example \( \PageIndex{ 6 } \): 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, \( \left( \frac{1}{3}, -1 \right) \), \(( 1, 0 )\), and \(( 3, 1 )\).

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

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

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

    Figure \( \PageIndex{ 8 } \)
     
    Graph of two functions. The parent function is y=log_3(x), with an asymptote at x=0 and labeled points at (1/3, -1), (1, 0), and (3, 1).The translation function f(x)=log_3(x)-2 has an asymptote at x=0 and labeled points at (1, 0) and (3, 1).
    Checkpoint \( \PageIndex{ 6 } \)

    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) = a \log_b(x) \) and the vertical compression, \( h(x) = \frac{1}{a} \log_b(x) \). See Figure \( \PageIndex{ 9 } \).

    Figure \( \PageIndex{ 9 } \)
     
    Graph of two functions. The parent function is f(x)=log_b(x), with an asymptote at x=0  and g(x)=alog_b(x) when a
    Example \( \PageIndex{ 7 } \): Graphing a Stretch or Compression of the Parent Function \( y = \log_b(x) \)

    Sketch a graph of \( 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) = 2 \log_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, \( \left( \frac{1}{4}, -1 \right) \), \( (-1, 0) \), and \( (4, 1) \).

    The new coordinates are found by multiplying the \(y\) coordinates by \( 2 \).

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

    The domain is \( \left( 0, \infty \right) \), the range is \( \left( -\infty, \infty \right) \), and the vertical asymptote is \(x=0\). See Figure \( \PageIndex{ 10 } \).

    Figure \( \PageIndex{ 10 } \)
     
    Graph of two functions. The parent function is y=log_4(x), with an asymptote at x=0 and labeled points at (1, 0), and (4, 1).The translation function f(x)=2log_4(x) has an asymptote at x=0 and labeled points at (1, 0) and (2, 1).
    Checkpoint \( \PageIndex{ 7 } \)

    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 \( \PageIndex{ 8 } \): Combining a Shift and a Stretch

    Sketch a graph of \( 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 Figure \( \PageIndex{ 11 } \). 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 \( \PageIndex{ 11 } \)
     
    Graph of three functions. The parent function is y=log(x), with an asymptote at x=0. The first translation function y=5log(x+2) has an asymptote at x=-2. The second translation function y=log(x+2) has an asymptote at x=-2.

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

    Checkpoint \( \PageIndex{ 8 } \)

    Sketch a graph of the function \(f(x)=3 \log(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 \( \PageIndex{ 12 } \)
     
    Graph of two functions. The parent function is f(x)=log_b(x), with an asymptote at x=0  and g(x)=-log_b(x) when b
    Example \( \PageIndex{ 9 } \): 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 \( \PageIndex{ 13 } \)
     
    Graph of two functions. The parent function is y=log(x), with an asymptote at x=0 and labeled points at (1, 0), and (10, 1).The translation function f(x)=log(-x) has an asymptote at x=0 and labeled points at (-1, 0) and (-10, 1).

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

    Checkpoint \( \PageIndex{ 9 } \)

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

    Example \( \PageIndex{ 10 } \): Approximating the Solution of a Logarithmic Equation

    Solve \( 4 \ln(x) + 1 = -2 \ln(x - 1) \) using graphing technology. Round to the nearest thousandth.

    Solution

    In the graphing calculator portion of Desmos, we enter \(y = 4 \ln( x )+1\) on one line and \(y = −2 \ln(x−1)\) on the next line. For a window, use the values \( 0 \) to \( 5 \) for \(x\) and \( –10 \) to \( 10 \) for \(y\). The graphs should intersect somewhere a little to right of \(x=1\). Clicking on their intersection point, we see the \( x \)-coordinate of the point of intersection is displayed as \( 1.3385 \). So, to the nearest thousandth, \(x \approx 1.339\).

    Checkpoint \( \PageIndex{ 10 } \)

    Solve \(5 \log( x+2 )=4−\log( x )\) using graphing technology. Round to the nearest thousandth.

    Summarizing Transformations of the Logarithmic Function

    Now that we have worked with each type of translation for the logarithmic function, we can summarize each in Table \( \PageIndex{ 3 } \) to arrive at the general equation for translating exponential functions.

    Table \( \PageIndex{ 3 } \)

    Transformations of the Parent Function \( y = \log_b(x) \)
     
    Transformation Form
    Shift
    • Horizontally \(c\) units to the left (if \( c > 0 \))
    • Vertically \(d\) units up (if \( d > 0 \))
    \( y = \log_b(x + c) + d \)
    Stretch and Compress
    • Stretch if \(| a |>1\)
    • Compression if \(| a |<1\)
    \( y = a \log_b(x) \)
    Reflect about the \( x \)-axis \( y = -\log_b(x) \)
    Reflect about the \( y \)-axis \( y = \log_b(-x) \)
    General equation for all transformations \( y = a \log_b(x + c) + d \)
    Translations of Logarithmic Functions

    All translations of the parent logarithmic function, \( y = \log_b(x) \), have the form\[f(x)= a \log_b (x + c) + d \nonumber \]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_b(−x)\), the graph of the parent function is reflected about the \( y \)-axis.

    Example \( \PageIndex{ 11 } \): Finding the Vertical Asymptote of a Logarithm Graph

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

    Solution

    The vertical asymptote is at \(x=−4\).

    In Example \( \PageIndex{ 11 } \), 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\).

    Checkpoint \( \PageIndex{ 11 } \)

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

    Example \( \PageIndex{ 12 } \): Finding the Equation from a Graph

    Find a possible equation for the common logarithmic function graphed in Figure \( \PageIndex{ 14 } \).

    Figure \( \PageIndex{ 14 } \)
     
    Graph of a logarithmic function with a vertical asymptote at x=-2, has been vertically reflected, and passes through the points (-1, 1) and (2, -1).
    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)=−a \log(x+2)+k \nonumber \]It appears the graph passes through the points \(( –1, 1)\) and \((2, –1)\). Substituting \((–1, 1)\),\[ \begin{array}{rrclcl} & 1 & = & -a \log(-1 + 2) + k & \quad & \left( \text{substituting} \right) \\[6pt] \implies & 1 & = & -a \log(1) + k & \quad & \left( \text{simplifying} \right) \\[6pt] \implies & 1 & = & -a (0) + k & \quad & \left( \log(1) = 0 \right) \\[6pt] \implies & 1 & = & k & \quad & \left( \log(1) = 0 \right) \\[6pt] \end{array} \nonumber \]Next, substituting in \((2, –1)\),\[ \begin{array}{rrclcl} & -1 & = & -a\log(2 + 2) + 1 & \quad & \left( \text{substituting} \right) \\[6pt] \implies & -1 & = & -a\log(4) + 1 & \quad & \left( \text{simplifying} \right) \\[6pt] \implies & -2 & = & -a\log(4) & \quad & \left( \text{subtracting }1\text{ from both sides} \right) \\[6pt] \implies & -\dfrac{2}{\log(4)} & = & a & \quad & \left( \text{dividing both sides by }-\log(4) \right) \\[6pt] \end{array} \nonumber \]This gives us the equation \(f(x) = –\frac{2}{\log(4)} \log(x+2)+1\).

    We can verify this answer by comparing the function values in Table \( \PageIndex{ 4 } \) with the points on the graph in Figure \( \PageIndex{ 14 } \).

    Table \( \PageIndex{ 4 } \)
     
    \(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
    Checkpoint \( \PageIndex{ 12 } \)

    Give the equation of the natural logarithm graphed in Figure \( \PageIndex{ 15 } \).

    Figure \( \PageIndex{ 15 } \)
     
    Graph of a logarithmic function with a vertical asymptote at x=-3, has been vertically stretched by 2, and passes through the points (-1, -1).
    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 \( \PageIndex{ 15 } \). 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 \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 \(x \to −3^+\), \(f(x) \to −\infty\), and as \(x \to \infty\), \(f(x) \to \infty \).

    More Complex Transformations

    Just as we encountered early in this course, logarithmic functions can also have horizontal stretches or compressions. Since these more robust transformations occur in Calculus, we spend a few moments reminding ourselves how to deal with graphing such types of functions.

    Example \(\PageIndex{13}\): Graphing a More Complex Logarithmic Function

    Sketch a graph of the function\[ h(x) = 2 \ln\left( -\dfrac{1}{4} x + 1 \right) - 1. \nonumber \]

    Solution

    As we have done previously, we begin by factoring the argument of the function.\[ h(x) = 2 \ln\left( -\dfrac{1}{4} \left( x - 4 \right) \right) - 1. \nonumber \]Starting with the parent graph (which contains the anchor points \( \left( 1,0 \right) \) and \( \left( e,1 \right) \)), we read our function from left to right:

    372 4.4 Example 13.a.png
    • The parent graph, \( y = \ln(x) \), has been stretched vertically by a factor of \( 2 \). Thus, we multiply the \( y \)-coordinates of our anchor points by \( 2 \) to get \( \left( 1,0 \right) \) and \( \left( e,2 \right) \) to get the graph of \( y = 2\ln(x) \).
      372 4.4 Example 13.b.png
    • The graph of \( y = 2 \ln(x) \) has been reflected horizontally about the \( y \)-axis and stretched horizontally by a factor of \( 4 \). Therefore, we multiply the \( x \)-coordinates of our anchor points by \( -4 \) to get \( \left( -4,0 \right) \) and \( \left( -4e,2 \right) \) to get the graph of \( y = 2 \ln\left( -\frac{1}{4}x \right) \).
      372 4.4 Example 13.c.png
    • The graph of \( y = 2 \ln\left( -\frac{1}{4}x \right) \) gets shifted horizontally \( 4 \) units to the right. In this horizontal shift, the vertical asymptote also shifts. Hence, we add \( 4 \) to all the \( x \)-coordinates of our anchor points and to the vertical asymptote. Thus, the graph of \( y = 2 \ln\left( -\frac{1}{4}\left( x - 4 \right) \right) \) contains the points \( \left( 0,0 \right) \) and \( \left( -4e + 4,2 \right) \), and the vertical asymptote is at \( x = 4 \).
      372 4.4 Example 13.d.png
    • The graph of \( y = 2\ln\left( -\frac{1}{4}\left( x - 4 \right) \right) \) gets shifted vertically \( 1 \) unit down to arrive at our final graph of the function \( h(x) = 2 \ln\left( -\frac{1}{4} \left( x - 4 \right) - 1 \right) \). The anchor points get moved to \( \left( 0,-1 \right) \) and \( \left( -4e+4, 1 \right) \). The final graph is shown below.
      372 4.4 Example 13.e.png

    Revisiting Graphs of Absolute Value Functions

    Finally, while you might not know it yet, absolute values and natural logarithms will appear together quite often in Calculus. It's best that we spend an example reminding ourselves of the effect of the absolute value on a function.

    Example \(\PageIndex{14}\)

    Graph\[ k(x) = \left| 2 \ln\left( -\dfrac{1}{4}x + 1 \right) - 1\right|. \nonumber \]

    Solution

    If this function looks familiar, it is because it is the absolute value of the function \( h(x) \) from Example \( \PageIndex{ 13 } \). The easiest way to graph the absolute value of a function is to recall that the absolute value keeps non-negative values the same, but forces negative values to become positive. Graphically, this means that any coordinate on the graph of \( h(x) \) with negative \( y \)-values will be reflected about the \( x \)-axis to their positive values. All other coordinates remain unchanged.

    372 4.4 Example 14.png

    This page titled 4.4: Graphs of Logarithmic Functions is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Roy Simpson, Cosumnes River College (OpenStax) via source content that was edited to the style and standards of the LibreTexts platform.