A logarithm answers an exponent question: what power of a particular base produces a given number? For example, \(\log_2 8=3\) because \(2^3=8\).
What is a logarithm?
The logarithmic and exponential forms of an equation are equivalent:
\[y=\log_b x\quad\Longleftrightarrow\quad b^y=x.\]
For real logarithms, the conditions are \(b>0\), \(b\ne1\), and \(x>0\). The base cannot be 1 because \(1^y=1\) for every real exponent, so it cannot define an inverse function.
Here are several examples:
- \(\log_2 32=5\), because \(2^5=32\).
- \(\log_{10}0.01=-2\), because \(10^{-2}=0.01\).
- \(\log_5 1=0\), because \(5^0=1\).
- \(\log_9 3=\tfrac12\), because \(9^{1/2}=3\).
A logarithm can therefore be negative, zero, or positive, even though its argument must be positive.
The main logarithm rules
For \(x>0\), \(y>0\), a real exponent r, and a valid base b:
Product rule
\[\log_b(xy)=\log_b x+\log_b y.\]
For example, \(\log_2(8\times4)=3+2=5\), which agrees with \(\log_2 32=5\).
Quotient rule
\[\log_b\left(\frac{x}{y}\right)=\log_b x-\log_b y.\]
For example, \(\log_3(81/3)=4-1=3\).
Power rule
\[\log_b(x^r)=r\log_b x.\]
For example, \(\log_2(8^2)=2\log_2 8=6\). The exponent becomes a multiplier; it does not multiply the base.
Change of base
If c is another positive base different from 1,
\[\log_b x=\frac{\log_c x}{\log_c b}.\]
This lets you evaluate logarithms on a calculator that offers only common logarithms or natural logarithms. For instance,
\[\log_2 10=\frac{\ln10}{\ln2}\approx3.3219.\]
The notation \(\ln x\) means a logarithm with base \(e\). In many school contexts, \(\log x\) means base 10, but conventions vary; state the base when there could be confusion.
How to graph a logarithmic function
To graph \(y=\log_2 x\), first choose powers of 2. They give points whose logarithms are easy to calculate:
- \(2^{-2}=\tfrac14\), so plot \((\tfrac14,-2)\).
- \(2^{-1}=\tfrac12\), so plot \((\tfrac12,-1)\).
- \(2^0=1\), so plot \((1,0)\).
- \(2^1=2\), so plot \((2,1)\).
- \(2^2=4\), so plot \((4,2)\).
Draw a smooth curve through these points. Its domain is \(x>0\), its range is all real numbers, and \(x=0\) is a vertical asymptote. It has no y-intercept.
More generally, \(y=\log_b x\) is increasing when \(b>1\) and decreasing when \(0<b<1\). The graph is the reflection of \(y=b^x\) across the line \(y=x\), because the two functions are inverses.
Solving a logarithmic equation
Solve \(\log_3(x-1)=2\).
- The argument must be positive: \(x-1>0\), so \(x>1\).
- Rewrite in exponential form: \(x-1=3^2=9\).
- Therefore, \(x=10\). It satisfies the domain restriction, and substituting gives \(\log_3 9=2\).
Common mistakes
- Splitting a sum. There is no general rule \(\log_b(x+y)=\log_b x+\log_b y\). With base 10 and \(x=y=1\), the left side is \(\log_{10}2\), while the right side is 0.
- Losing an exponent. \(x^r\) and \(xr\) are different expressions.
- Ignoring the domain. An algebraic solution is invalid if it makes a logarithm’s argument zero or negative.
Continue with inverse functions to explore the relationship between logarithms and exponentials.
Further reading
OpenStax provides additional lessons on logarithmic functions and logarithmic properties.