Skip to content

The logarithmic function

The logarithmic function

A table of values of log⁡2x\displaystyle \log_2 x

A logarithmic function is f(x)=log⁡ax\displaystyle {f(x)}={\log_a x}, where a>0\displaystyle a>0 and a≠1\displaystyle a\neq1. A table of values of f(x)=log⁡2x\displaystyle {f(x)}={\log_2 x}:

x\displaystyle x14\displaystyle \frac{1}{4}12\displaystyle \frac{1}{2}1\displaystyle 12\displaystyle 24\displaystyle 48\displaystyle 8
log⁡2x\displaystyle \log_2 x−2\displaystyle -2−1\displaystyle -10\displaystyle 01\displaystyle 12\displaystyle 23\displaystyle 3
  • When x\displaystyle x doubles, the value goes up by 1: the graph rises, but slowly.
  • When x\displaystyle x comes near 0, the value goes down without limit.
log⁡2x\displaystyle \log_2 x and log⁡12x\displaystyle \log_{\frac{1}{2}}x

The drawing shows the graphs of f(x)=log⁡2x\displaystyle {f(x)}={\log_2 x} and of g(x)=log⁡12x\displaystyle {g(x)}={\log_{\frac{1}{2}}x}. Each is the reflection of the other in the x-axis: log⁡12x=−log⁡2x\displaystyle {\log_{\frac{1}{2}}x}={-\log_2 x}.

f(x)=log⁡2x\displaystyle f(x)=\log_{2}x
g(x)=log⁡12x\displaystyle g(x)=\log_{\frac{1}{2}}x
(1,0)\displaystyle (1,0)
The properties of log⁡ax\displaystyle \log_a x
  • Domain: x>0\displaystyle x>0. Neither 0 nor a negative number has a logarithm, so the whole graph is to the right of the y-axis.
  • The point on the x-axis: (1,0)\displaystyle (1,0), since log⁡a1=0\displaystyle {\log_a 1}={0}. No point on the y-axis.
  • Vertical asymptote: x=0\displaystyle {x}={0} – the y-axis. The graph comes near it as x\displaystyle x comes near 0.
  • a>1\displaystyle a>1: the function increases throughout its domain; positive where x>1\displaystyle x>1, negative where 0<x<1\displaystyle 0<x<1.
  • 0<a<1\displaystyle 0<a<1: the function decreases throughout its domain; positive where 0<x<1\displaystyle 0<x<1, negative where x>1\displaystyle x>1.
log⁡ax\displaystyle \log_a x and ax\displaystyle a^x: a reflection in y=x\displaystyle {y}={x}

log⁡2x\displaystyle \log_2 x undoes 2x\displaystyle 2^x: the point (1,2)\displaystyle (1,2) is on the graph of 2x\displaystyle 2^x, and the point (2,1)\displaystyle (2,1) on the graph of log⁡2x\displaystyle \log_2 x.

  • Every point (p,q)\displaystyle (p,q) on the graph of ax\displaystyle a^x matches the point (q,p)\displaystyle (q,p) on the graph of log⁡ax\displaystyle \log_a x.
  • So the two graphs are reflections of each other in the line y=x\displaystyle {y}={x}.
  • Their properties swap: the horizontal asymptote y=0\displaystyle {y}={0} of ax\displaystyle a^x is the vertical asymptote x=0\displaystyle {x}={0} of log⁡ax\displaystyle \log_a x; the point (0,1)\displaystyle (0,1) is the point (1,0)\displaystyle (1,0).
f(x)=2x\displaystyle f(x)=2^{x}
g(x)=log⁡2x\displaystyle g(x)=\log_{2}x
y=x\displaystyle y=x
(1,2)\displaystyle (1,2)
(2,1)\displaystyle (2,1)
Shifts and a stretch of the graph

The drawing shows four functions, from log⁡x\displaystyle \log x to 3log⁡x+4\displaystyle 3\log x+4:

  • g(x)=log⁡(x−1)\displaystyle {g(x)}={\log(x-1)}: a horizontal shift of 1 to the right. The domain moves too – x>1\displaystyle x>1 – and so does the asymptote: x=1\displaystyle {x}={1}. The point on the x-axis is (2,0)\displaystyle (2,0).
  • h(x)=3log⁡x\displaystyle {h(x)}={3\log x}: a vertical stretch by 3. The domain, the asymptote x=0\displaystyle {x}={0} and the point (1,0)\displaystyle (1,0) stay.
  • k(x)=3log⁡x+4\displaystyle {k(x)}={3\log x+4}: a vertical shift of 4 up. The point on the x-axis: 3log⁡x+4=0\displaystyle {3\log x+4}={0}, that is log⁡x=−43\displaystyle {\log x}={-\frac{4}{3}}, and x=10−43≈0.046\displaystyle {x}={10^{-\frac{4}{3}}\approx0.046}.
f(x)=log⁡x\displaystyle f(x)=\log x
g(x)=log⁡(x−1)\displaystyle g(x)=\log(x-1)
h(x)=3log⁡x\displaystyle h(x)=3\log x
k(x)=3log⁡x+4\displaystyle k(x)=3\log x+4
x=1\displaystyle x=1
Reflections and the absolute value

The drawing shows f(x)=log⁡2x\displaystyle {f(x)}={\log_2 x} and three operations on it:

  • g(x)=log⁡2(−x)\displaystyle {g(x)}={\log_2(-x)}: a reflection in the y-axis. The domain: −x>0\displaystyle -x>0, that is x<0\displaystyle x<0.
  • h(x)=−log⁡2x\displaystyle {h(x)}={-\log_2 x}: a reflection in the x-axis. The function decreases.
  • k(x)=∣log⁡2x∣\displaystyle {k(x)}={|\log_2 x|}: the part below the x-axis (where 0<x<1\displaystyle 0<x<1) goes up above it. k(x)≥0\displaystyle k(x)\geq0, and its minimum is at the point (1,0)\displaystyle (1,0).
f(x)=log⁡2x\displaystyle f(x)=\log_{2}x
g(x)=log⁡2(−x)\displaystyle g(x)=\log_{2}(-x)
h(x)=−log⁡2x\displaystyle h(x)=-\log_{2}x
k(x)=∣log⁡2x∣\displaystyle k(x)=|\log_{2}x|
The domain of log⁡af(x)\displaystyle \log_a f(x)

log⁡af(x)\displaystyle \log_a f(x) is defined only where f(x)>0\displaystyle f(x)>0. The example below finds the domain of log⁡(x2−4)\displaystyle \log(x^2-4):

x2−4>0x^2-4>0
  • The parabola x2−4\displaystyle x^2-4 is positive outside its roots −2\displaystyle -2 and 2\displaystyle 2: x<−2\displaystyle x<-2 or x>2\displaystyle x>2.
  • As x\displaystyle x comes near 2\displaystyle 2 or −2\displaystyle -2 from inside the domain, x2−4\displaystyle x^2-4 comes near 0, and the logarithm goes down without limit: the graph has two vertical asymptotes, x=2\displaystyle {x}={2} and x=−2\displaystyle {x}={-2}.
Exercise 1

The function is f(x)=log⁡2(x+2)\displaystyle {f(x)}={\log_2(x+2)}.

a

Find the domain and the vertical asymptote.

b

Mark the points where the graph meets the axes.

f(x)=log⁡2(x+2)\displaystyle f(x)=\log_{2}(x+2)
x=−2\displaystyle x=-2

Exercise 2

The graph of y=log⁡ax\displaystyle {y}={\log_a x} passes through the point (9,2)\displaystyle (9,2).
Write the function.

y= ?\displaystyle y=\,?
(9,2)\displaystyle (9,2)

Exercise 3

The function is f(x)=log⁡6(x2−5x)\displaystyle {f(x)}={\log_6(x^2-5x)}.

a

Find the domain of the function.

    b

    Write the equations of the vertical asymptotes.

    c

    For which values of x\displaystyle x is f(x)=1\displaystyle {f(x)}={1}?

      d

      Mark the points where the graph of f\displaystyle f meets the line y=1\displaystyle {y}={1}.

      f(x)=log⁡6(x2−5x)\displaystyle f(x)=\log_{6}(x^{2}-5x)
      g(x)=1\displaystyle g(x)=1

      Exercise 4

      Compare f(x)=log⁡3x\displaystyle {f(x)}={\log_3 x} with g(x)=log⁡13x\displaystyle {g(x)}={\log_{\frac{1}{3}}x}: the domain, the points on the axes, where each is positive and negative, where each increases and decreases, the asymptotes.