Skip to main content

Graphing Logarithmic Functions

Logarithmic functions are used to model various real life situations and being able to graph them is invaluable as it allows us to visualize the function in order to analyze and predict trends.

Domain and Range

The domain of an exponential function of the form y=bxy = b^x for any real number xx where b>0b > 0 and b1b \neq 1 is (,)(-\infty, \infty). The range of this function is (0,)(0, \infty). Now, given that logarithmic functions are inverses of exponential functions, the domain of a logarithmic function in the form of y=logb(x)y = \log_b(x) is (0,)(0, \infty) and the range is (,)(-\infty, \infty).

When we applied certain transformations like vertical shift to the parent exponential function, the range of y=bxy = b^x changed. Similarly, applying certain transformations to the parent function y=logb(x)y = \log_b(x) can change the domain. The domain of a logarithmic function consists only of positive real numbers and so, given a logarithmic function, we can identify the domain by setting up an inequality showing the argument of log greater than zero. We can then solve for xx and write the resulting domain in interval notation.

Example\underline{Example}

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

The argument of log is x5x - 5, we ignore the 22 as it is outside the log. This gives us the inequality x5>0x - 5 > 0.

We can solve for xx by adding 55 to both sides of x5>0x - 5 > 0 giving us x>5x > 5.

Rewriting the domain in interval notation gives us (5,)(5, \infty).

Graphing

For any real number xx and constant b>0b > 0 where b1b \neq 1, we get the following characteristics in the graph of f(x)=logb(x)f(x) = \log_b(x)...

  1. It is a one-to-one function.
  2. The domain is (0,)(0, \infty) and the range is (,)(-\infty, \infty).
  3. The xx-intercept is (1,0)(1, 0) and there is no $$y-intercept.
  4. A key point is (b,1)(b, 1).
  5. The graph is increasing if b>1b > 1 and decreasing if 0<b<10 < b < 1.
Parent Logarithmic Function
Fig. 1 - Parent Logarithmic Function

Given a logarithmic function with the form f(x)=logb(x)f(x) = \log_b(x), we can graph the function using the following steps...

  1. Draw and label the vertical asymptote, x=0x = 0.
  2. Plot the xx-intercept, (1,0)(1, 0).
  3. Plot the key point (b,1)(b, 1).
  4. Draw a smooth curve through the points.
  5. State the domain, (0,)(0, \infty), the range, (,)(-\infty, \infty), and the vertical asymptote, x=0x = 0.

Example\underline{Example}

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

We can plot the points (1,0)(1, 0) and (15,1)(\frac{1}{5}, 1) and draw a smooth curve through those points. When drawing the curve, we will make sure to get close to x=0x = 0 but never have our curve touch or cross it.

Graph of Example
Fig. 2 - Graph of Example

The domain is (0,)(0, \infty), the range is (,)(-\infty, \infty) and there is a vertical asymptote at x=0x = 0.

Horizontal Shift

We can shift the parent function cc units horizontally using the function f(x)=logb(x+c)f(x) = \log_b(x + c). If c>0c > 0 then we shift cc units to the left and if c<0c < 0, we shift cc units to the right. When we apply a horizontal shift, the vertical asymptote becomes x=cx = -c, the domain becomes (c,)(-c, \infty) and the range stays the same as (,)(-\infty, \infty).

Horizontal Shift
Fig. 3 - Horizontal Shift

Vertical Shift

We can shift the parent function dd units vertically using the function f(x)=logb(x)+df(x) = \log_b(x) + d. If d>0d > 0 then we shift dd units up and if d<0d < 0, we shift dd units down. When we apply a vertical shift, the vertical asymptote, domain, and range stay the same. This means the vertical asymptote is x=0x = 0, the domain is (0,)(0, \infty) and the range is (,)(-\infty, \infty).

Vertical Shift
Fig. 4 - Vertical Shift

Stretches and Compressions

Given a positive constant aa where a1a \neq 1, we can stretch and compress the function using f(x)=alogb(x)f(x) = a\log_b(x). If a>1a > 1 then we are stretching the parent function vertically by a factor of aa and if 0<a<10 < a < 1 then we are compressing the parent function vertically by a factor of aa. Doing this transformation does not change any of the properties of the parent function.

Stretch and Compress
Fig. 5 - Stretch and Compress

Reflections

When the parent function is multiplied by 1-1 meaning f(x)-f(x) or f(x)=logb(x)f(x) = -\log_b(x), then the result is a reflection about the xx-axis. The reflected function's vertical asymptote, domain, and range remains the same which means the vertical asymptote is x=0x = 0, the domain is (0,)(0, \infty) and the range is (,)(-\infty, \infty). However, the key point does change to (b1,1)(b^{-1}, 1) and the reflected function changes directions as xx approaches \infty.

On the other hand, when the input of the parent function is multiplied by 1-1 meaning f(x)f(-x) or f(x)=logb(x)f(x) = \log_b(-x), then the result is a reflection about the yy-axis. In this case, the vertical asymptote remains the same as x=0x = 0 and the range remains the same as (,)(-\infty, \infty). The new xx-intercept is (1,0)(-1, 0), the key point is now (b,1)(-b, 1) and the domain is now (,0)(-\infty, 0).

Reflection
Fig. 6 - Reflection
note

Due to the fact that exponential functions and logarithm functions are inverse functions, the parent functions are reflections of each other about y=xy = x.

General Equation

All translations of the parent logarithmic function, y=logb(x)y = \log_b(x), has the form f(x)=alogb(x+c)+df(x) = a\log_b(x + c) + d where b>1b > 1. The constant aa denotes stretching or compressing, cc denotes the horizontal shift, and dd denotes the vertical shift. If a<0a < 0 then there is a reflection about the xx-axis and if f(x)=log(x)f(x) = \log(-x) then there is a reflection about the yy-axis.

We can graph any logarithmic function by graphing the parent function and then translating it based on the constants found in the function. After this we can state the domain, range, and asymptote based on how they were altered through the translations.

Example\underline{Example}

Graph the function of f(x)=2log3(x+4)+5f(x) = -2\log_3(x + 4) + 5. State the domain, range, and vertical asymptote.

The parent function is f(x)=log3(x)f(x) = \log_3(x) because the base is 33. The graph has additional constants which are a=2a = -2, c=4c = 4, and d=5d = 5. Through these constants we can denote that we are stretching the parent function by a scale of 22, shifting it to the left 44 units and down 55 units. Finally, due to the fact that a<0a < 0, we are reflecting about the xx-axis.

Example Function
Fig. 7 - Example Function

Due to the fact that we shifted 44 units to the left, our new vertical asymptote is x=4x = -4 and the new domain is (4,)(-4, \infty). The range stays the same as (,)(-\infty, \infty).