Logarithmic functions

An exponential function answers the question: what is ${2^5}$? A logarithm answers the reverse question: to what power must we raise ${2}$ to get ${32}$? The answer, ${5}$, is the logarithm of ${32}$ with base ${2}$. This page defines logarithms as the inverses of exponential functions.

Definition of the logarithm

The exponential function ${f(x)=a^x}$ is one-to-one, because its graph always rises (or always falls). So it has an inverse function (see inverse functions). That inverse is the logarithmic function with base ${a}$:

Let ${a>0}$ and ${a\ne 1}$. Then

${\log_a x=y\quad}$ means ${\quad a^y=x}$.

We read ${\log_a x}$ as "log base ${a}$ of ${x}$". In words: ${\log_a x}$ is the exponent you put on ${a}$ to get ${x}$. So a logarithm is an exponent.

Each fact can be written in two forms. The base is the same in both:

Logarithmic formExponential form
${\log_{10}1000=3}$${10^3=1000}$
${\log_2 \frac{1}{8}=-3}$${2^{-3}=\frac{1}{8}}$
${\log_5 25=2}$${5^2=25}$
${\log_9 3=\frac{1}{2}}$${9^{1/2}=3}$

Example 1: Write in exponential form:

(a) ${\log_4 64=3}$

(b) ${\log_{10}0.1=-1}$

Write in logarithmic form:

(c) ${3^4=81}$

(d) ${8^{1/3}=2}$

Solution:

(a) ${4^3=64}$

(b) ${10^{-1}=0.1}$

(c) ${\log_3 81=4}$

(d) ${\log_8 2=\dfrac{1}{3}}$

Example 2: Find each value.

(a) ${\log_2 32}$

(b) ${\log_3\dfrac{1}{9}}$

(c) ${\log_4 2}$

(d) ${\log_7 1}$

Solution:

In each case, ask: what power of the base gives the number?

(a) ${2^5=32}$, so ${\log_2 32=5}$.

(b) ${3^{-2}=\dfrac{1}{9}}$, so ${\log_3\dfrac{1}{9}=-2}$.

(c) ${4^{1/2}=\sqrt{4}=2}$, so ${\log_4 2=\dfrac{1}{2}}$.

(d) ${7^0=1}$, so ${\log_7 1=0}$.

Properties of logarithms

These facts follow straight from the definition:

${\log_a 1=0}$, because ${a^0=1}$.

${\log_a a=1}$, because ${a^1=a}$.

${\log_a a^x=x}$ and ${a^{\log_a x}=x}$.

The last line is the inverse function property: ${\log_a}$ undoes ${a^x}$, and ${a^x}$ undoes ${\log_a}$. For example, ${\log_5 5^7=7}$ and ${3^{\log_3 10}=10}$.

Graphs of logarithmic functions

The graph of an inverse function is the reflection across the line ${y=x}$. So the graph of ${y=\log_a x}$ is the graph of ${y=a^x}$ reflected across ${y=x}$. Each point ${(x,y)}$ becomes ${(y,x)}$. For example, ${(2,4)}$ is on ${y=2^x}$, so ${(4,2)}$ is on ${y=\log_2 x}$.

(1, 0)(4, 2)y = 2xy = log₂ xy = xxy
The graph of ${y=\log_2 x}$ (blue) is the graph of ${y=2^x}$ (teal) reflected across the line ${y=x}$ (dashed).

The features of ${a^x}$ also trade places. For ${a>1}$:

The domain of ${\log_a x}$ is ${(0,\infty)}$, and the range is ${(-\infty,\infty)}$.

The graph passes through ${(1,0)}$.

The ${y}$-axis, ${x=0}$, is a vertical asymptote.

Watch out: The logarithm of ${0}$ or of a negative number is undefined. For example, ${\log_2(-4)}$ would be a power of ${2}$ that equals ${-4}$. But every power of ${2}$ is positive.

Example 3: Find the domain of each function.

(a) ${f(x)=\log_3(x-2)}$

(b) ${g(x)=\log_2(6-2x)}$

Sketch the graph of ${f}$.

Solution:

The input of a logarithm must be positive.

(a) ${x-2>0}$, so ${x>2}$. The domain is ${(2,\infty)}$.

(b) ${6-2x>0}$, so ${2x<6}$, and ${x<3}$. The domain is ${(-\infty,3)}$.

The graph of ${f}$ is the graph of ${y=\log_3 x}$ moved ${2}$ units right. Its vertical asymptote moves to ${x=2}$. Two points on it:

${f(3)=\log_3 1=0}$

${f(5)=\log_3 3=1}$

(3, 0)(5, 1)x = 2xy
The graph of ${y=\log_3(x-2)}$: the graph of ${y=\log_3 x}$ moved ${2}$ units right. Its vertical asymptote is ${x=2}$.

Common and natural logarithms

Two bases are used so often that they have their own names and calculator keys:

The common logarithm has base ${10}$: ${\log x=\log_{10}x}$.

The natural logarithm has base ${e}$: ${\ln x=\log_e x}$.

When no base is written, the base is ${10}$. The natural logarithm ${\ln x}$ is the inverse of ${e^x}$. So ${\ln e^x=x}$ and ${e^{\ln x}=x}$.

Example 4: Find each value. Use a calculator for (e) and (f).

(a) ${\log 100}$

(b) ${\log 0.001}$

(c) ${\ln e^3}$

(d) ${\ln 1}$

(e) ${\log 50}$

(f) ${\ln 10}$

Solution:

(a) ${10^2=100}$, so ${\log 100=2}$.

(b) ${10^{-3}=0.001}$, so ${\log 0.001=-3}$.

(c) ${\ln e^3=3}$, by the inverse property.

(d) ${\ln 1=0}$, because ${e^0=1}$.

(e) ${\log 50\approx 1.699}$. This is between ${1}$ and ${2}$, because ${50}$ is between ${10^1}$ and ${10^2}$.

(f) ${\ln 10\approx 2.303}$.

An application

Logarithms are useful when numbers range from very small to very large. Instead of the number, we use its exponent.

Example 5: Chemists measure how acidic a liquid is with its pH:

${\text{pH}=-\log[\text{H}^+]}$

Here ${[\text{H}^+]}$ is the concentration of hydrogen ions, in moles per liter. Find the pH of

(a) pure water, with ${[\text{H}^+]=10^{-7}}$,

(b) orange juice, with ${[\text{H}^+]=3.2\times 10^{-4}}$.

Solution:

(a) ${\log 10^{-7}=-7}$, so ${\text{pH}=-(-7)=7}$.

(b) With a calculator:

$\text{pH}=-\log(3.2\times 10^{-4})\approx 3.49$

A smaller pH means a more acidic liquid. Each step of ${1}$ in pH means ${10}$ times as many hydrogen ions.

Summary