Sub topic 6
Domain, Range and the Graph of a Logarithm
Prerequisites
Assume you know integer and fractional exponents, function notation, and the idea that inverse functions undo one another. We will use the logarithm function
\[ f(x)=\log_b(x) \]
where the base satisfies \(b>0\) and \(b\ne1\).
Domain and range
A logarithm asks which exponent produces its input:
\[ y=\log_b(x) \quad\Longleftrightarrow\quad b^y=x. \]
For every real exponent \(y\), \(b^y\) is positive. Therefore, the input \(x\) of a real logarithm must also be positive.
- Domain: \(x>0\)
- Range: all real numbers
The domain is the set of allowed input values. The range is the set of possible output values.
For example, \(\log2(8)=3\), because \(2^3=8\). However, \(\log2(0)\) and \(\log_2(-4)\) are not real numbers. No real power of 2 equals 0 or a negative number.
Shape of the basic graph
The graph of \(y=\log_b(x)\) is the reflection of \(y=b^x\) across the line \(y=x\). This happens because logarithms and exponentials are inverse functions.
Every basic logarithm graph has these features:
| Feature | Description |
|---|---|
| Domain | \(x>0\) |
| Range | All real numbers |
| Vertical asymptote | \(x=0\) |
| Intercept | \((1,0)\) |
| \(y\)-intercept | None |
| Behavior when \(b>1\) | Increasing |
| Behavior when \(0<b<1\) | Decreasing |
A vertical asymptote is a line that the graph approaches but does not touch. As \(x\) approaches \(0\) from the right, \(\log_b(x)\) becomes very large negative when \(b>1\). The graph never crosses the \(y\)-axis because \(x=0\) is outside the domain.
For \(b>1\), larger inputs give larger logarithms. For \(0<b<1\), larger inputs give smaller logarithms.
Transforming the graph
A common transformed logarithm is
\[ y=\log_b(x-h)+k. \]
The expression \(x-h\) shifts the graph horizontally, and \(k\) shifts it vertically.
The domain comes from requiring the logarithm's argument to be positive:
\[ x-h>0 \quad\Longrightarrow\quad x>h. \]
Thus, the vertical asymptote moves from \(x=0\) to \(x=h\), while the range remains all real numbers.
For example,
\[ y=\log_2(x-3)+1 \]
has domain \(x>3\), range all real numbers, and vertical asymptote \(x=3\). The point \((1,0)\) on the basic graph becomes \((4,1)\).
import math
def logarithm_value(x, base):
if x <= 0 or base <= 0 or base == 1:
raise ValueError("Require x > 0, base > 0, and base != 1.")
return math.log(x, base)
print(logarithm_value(8, 2)) # 3.0Exercise
State the domain, range, and vertical asymptote of y = log_3(x + 2) - 4.
Show answer
Domain: x > -2. Range: all real numbers. Vertical asymptote: x = -2.