Exponential and Logarithmic Functions
Exponential and Logarithmic Functions
Definition: An exponential function has the form f(x) = b^x, where a fixed base b (b > 0, b ≠ 1) is raised to a variable exponent x; a logarithmic function, log_b(x), is its inverse, answering the question “to what power must b be raised to produce x?”
How It Works
- In y = b^x, the base b is fixed and the variable x sits in the exponent — the opposite arrangement from a power function like x², where the variable is the base instead.
- When b > 1, y = b^x is increasing (exponential growth): each unit increase in x multiplies y by b rather than adding to it, so the curve climbs slowly at first, then shoots upward.
- When 0 < b < 1, y = b^x is decreasing (exponential decay): each unit increase in x multiplies y by a fraction less than 1, so the curve drops quickly at first, then flattens toward zero without ever reaching it.
- Every exponential curve y = b^x passes through (0, 1), since any valid base raised to the power 0 equals 1, and it never touches the x-axis — y = 0 is a horizontal asymptote.
- The natural exponential uses the special base e ≈ 2.71828, an irrational constant defined as the limit of (1 + 1/n)^n as n grows without bound; it is the unique base whose function e^x is its own derivative.
- A logarithm log_b(y) = x is the inverse question to exponentiation: it asks what exponent x turns base b into the value y, so b^x = y and log_b(y) = x are two ways of writing the same relationship.
- The natural logarithm ln(x) uses base e; the common logarithm log(x), or log10(x), uses base 10 and was historically the standard for hand computation before calculators.
- Because a positive base raised to any real power is always positive, logarithms are only defined for positive inputs — log_b(x) has no real value for x ≤ 0, so every log function’s domain is x > 0.
- Exponential and logarithmic functions are inverses of each other, so their graphs are mirror images across the line y = x: every point (p, q) on y = b^x has a matching point (q, p) on y = log_b(x).
- Applying a log and an exponential in sequence undoes the other exactly: log_b(b^x) = x for all real x, and b^(log_b(x)) = x for all x > 0 — this cancellation is the main algebraic tool for solving an equation where the unknown sits in an exponent.
Illustration
var bIn = document.getElementById(‘explog-b’); var bOut = document.getElementById(‘explog-b-out’); var modeBtn = document.getElementById(‘explog-mode-btn’);
var modes = [‘both’, ‘exp’, ‘log’]; var modeIndex = 0; var modeLabels = { both: ‘Show: Both + y=x’, exp: ‘Show: Exponential’, log: ‘Show: Logarithm’ };
function fmt(n) { return (Math.round(n * 100) / 100).toFixed(2).replace(/.00$/, ‘.0’); }
function applyMode() { var mode = modes[modeIndex]; var showExp = (mode === ‘exp’ || mode === ‘both’); var showLog = (mode === ‘log’ || mode === ‘both’); expCurve.setAttribute(‘visibility’, showExp ? ‘visible’ : ‘hidden’); eqExpTxt.setAttribute(‘visibility’, showExp ? ‘visible’ : ‘hidden’); logCurve.setAttribute(‘visibility’, showLog ? ‘visible’ : ‘hidden’); eqLogTxt.setAttribute(‘visibility’, showLog ? ‘visible’ : ‘hidden’); identityLine.setAttribute(‘visibility’, mode === ‘both’ ? ‘visible’ : ‘hidden’); modeBtn.textContent = modeLabels[mode]; }
function update() { var b = parseFloat(bIn.value); bOut.textContent = fmt(b);
// y = b^x grows very fast, so clamp to the visible range the same way
// the parabola exemplar clamps a steep curve.
var expPts = [];
for (var x = -10; x <= 10.001; x += 0.25) {
var y = Math.pow(b, x);
if (y > 12) y = 12;
if (y < -12) y = -12;
var p = toPx(x, y);
expPts.push((expPts.length === 0 ? 'M' : 'L') + p[0].toFixed(1) + ',' + p[1].toFixed(1));
}
expCurve.setAttribute('d', expPts.join(' '));
// y = log_b(x) is only defined for x > 0, so sampling starts just above
// zero instead of at the origin; the path simply never reaches x <= 0.
var logPts = [];
for (var x2 = 0.02; x2 <= 10.001; x2 += 0.25) {
var y2 = Math.log(x2) / Math.log(b);
if (y2 > 12) y2 = 12;
if (y2 < -12) y2 = -12;
var p2 = toPx(x2, y2);
logPts.push((logPts.length === 0 ? 'M' : 'L') + p2[0].toFixed(1) + ',' + p2[1].toFixed(1));
}
logCurve.setAttribute('d', logPts.join(' '));
eqExpTxt.textContent = 'y = ' + fmt(b) + '^x';
eqLogTxt.textContent = 'y = log_' + fmt(b) + '(x)';
var val = Math.pow(b, 3);
var inv = Math.log(val) / Math.log(b);
calcTxt.textContent = fmt(b) + '^3 = ' + fmt(val);
calcInvTxt.textContent = 'log_' + fmt(b) + '(' + fmt(val) + ') = ' + fmt(inv);
applyMode();
}
bIn.addEventListener(‘input’, update); modeBtn.addEventListener(‘click’, function () { modeIndex = (modeIndex + 1) % modes.length; update(); });
update(); })();
Under the Hood
The three laws that let you manipulate logarithms algebraically, plus the change-of-base formula used to evaluate any base on a calculator that only has ln and log10 buttons:
log_b(xy) = log_b(x) + log_b(y) product rule: log of a product is a sum
log_b(x/y) = log_b(x) - log_b(y) quotient rule: log of a quotient is a difference
log_b(x^n) = n * log_b(x) power rule: an exponent moves out as a multiplier
log_b(x) = ln(x) / ln(b) change of base: rewrite any base using natural log
log_b(b) = 1 log_b(1) = 0 two quick identities
- These three rules, plus change of base, are the only tools you ever need — every other logarithmic manipulation is built from applying them in combination.
Worked Example 1: Solving an exponential equation with logs. Given: 2^x = 32. Step 1: recognize 32 as a power of 2, or take log base 2 of both sides: log_2(2^x) = log_2(32). Step 2: the left side simplifies to x (since log_b(b^x) = x), and 32 = 2^5, so log_2(32) = 5. Answer: x = 5 (confirm: 2^5 = 32).
Worked Example 2: Half-life. Given: a radioactive isotope has a half-life of 8 days. Starting from 200 mg, how much remains after 24 days? Step 1: apply N(t) = N0 · (1/2)^(t/T), with N0 = 200, T = 8, t = 24. Step 2: t/T = 24/8 = 3, so N(24) = 200 · (1/2)³ = 200 · 0.125. Answer: N(24) = 25 mg (three half-lives have passed: 200 → 100 → 50 → 25).
Worked Example 3: Compound growth. Given: $1,000 invested at 6% annual interest, compounded annually. How long until it doubles? Step 1: set up A = P(1 + r)^t with A = 2000, P = 1000, r = 0.06, giving 2 = 1.06^t. Step 2: take the log of both sides (any base works, since the base cancels in the ratio): t = log(2) / log(1.06). Answer: t ≈ 11.9 years — close to the “Rule of 72” estimate of 72/6 = 12 years.
History
- Scottish mathematician John Napier introduced logarithms in 1614 in Mirifici Logarithmorum Canonis Descriptio, inventing them specifically to spare astronomers and navigators from tedious hand multiplication and division of large numbers.
- Napier’s original tables were not quite the clean base-10 system used today; English mathematician Henry Briggs met with Napier in 1615 and proposed rebuilding the tables around base 10, giving us the “common logarithm,” still called the Briggsian logarithm in some texts.
- The constant e appeared implicitly in Jacob Bernoulli’s 1683 work on compound interest, when he studied the limit of (1 + 1/n)^n, before the number had a name or a symbol.
- Leonhard Euler formalized the constant in the 18th century, gave it the symbol e, computed it to many decimal places, and connected it to the natural exponential and logarithm through his work on infinite series and calculus.
- Mechanical slide rules, in wide use from the 1600s until pocket calculators arrived in the 1970s, worked by physically adding lengths marked off in logarithmic scale — since log(a) + log(b) = log(ab), lining up two log-scaled lengths performed multiplication mechanically.
- Printed logarithm tables, once a required tool in every science and engineering classroom for hand multiplication, division, and root-extraction, became largely obsolete within a generation of the electronic calculator’s arrival.
Why It Matters
- Compound interest and investment growth are exponential: savings accounts, retirement funds, and loans all grow (or accrue debt) by a fixed percentage each period, exactly the b^x pattern, and logarithms are what let you solve for “how long” or “at what rate.”
- Radioactive decay follows an exponential curve, and taking logarithms of decay measurements is the basis of carbon-14 dating, which archaeologists and geologists use to estimate the age of organic material up to roughly 50,000 years old.
- The Richter scale for earthquake magnitude and the decibel scale for sound intensity are both logarithmic: each whole step up on the Richter scale is a tenfold increase in shaking amplitude, and each 10 dB is a tenfold increase in sound intensity — both compress an enormous range of real values into manageable numbers.
- Population growth, viral spread, and other “the more you have, the faster it grows” processes are modeled with exponential functions, at least until resource limits force a more complex model.
- The pH scale in chemistry is a logarithm (pH = -log10 of hydrogen ion concentration), so a difference of just one pH unit reflects a tenfold change in acidity, which is why small pH shifts matter enormously.
- Computer science leans on logarithms to describe efficient algorithms: binary search and balanced trees run in O(log n) time, meaning the work grows only logarithmically even as the data set grows exponentially.
Common Pitfalls
- Trying to take the logarithm of zero or a negative number: log_b(x) is undefined for x ≤ 0 in the real numbers, no matter how close to zero x is — every log graph has a vertical asymptote at x = 0 and never extends into negative x.
- Assuming logarithms distribute over addition: log_b(x + y) is not log_b(x) + log_b(y). The product rule applies to log_b(xy), multiplication inside the log, not to a sum inside the log — there is no shortcut for the log of a sum.
- Mixing up which direction is growth and which is decay: b > 1 always means growth, and 0 < b < 1 always means decay. It is the base’s position relative to 1 that decides the direction, not the sign of x.
- Confusing (log_b x)^n, the whole logarithm raised to a power, with log_b(x^n), the power rule pulling n out front. These are different expressions and are not interchangeable.
- Forgetting which base “log” means by default: in most algebra and calculator contexts, log(x) means base 10, but in calculus, higher math, and most programming languages it means the natural log, base e — always check the source’s convention.
- Treating e like a short, rounded constant instead of an irrational number: truncating it too aggressively (say, just “2.7”) introduces meaningful error in any calculation that compounds over many steps.
Comparison
| Growth Type | Form | As x Increases | Real-World Example |
|---|---|---|---|
| Linear | y = mx + c | Adds the same fixed amount every step | A taxi fare that adds a flat rate per mile |
| Exponential | y = b^x (b > 1) | Multiplies by the same fixed factor every step; eventually outpaces any polynomial | Compound interest on a savings account |
| Logarithmic | y = log_b(x) | Adds the same fixed amount only when x is multiplied by a fixed factor; grows without bound, but ever more slowly | Perceived loudness on the decibel scale |
FAQ
Why is e special — where does it actually come from? It falls out of a simple question: what happens to (1 + 1/n)^n as n gets larger and larger? That expression, which shows up naturally in compound-interest math, converges to a fixed irrational number, approximately 2.71828, no matter how large n grows. Euler later showed this same constant is the unique base for which the slope of e^x at every point equals its own height — d/dx(e^x) = e^x — which is why e is the natural choice throughout calculus.
How do I compute a logarithm in a base my calculator doesn’t have, like log_5(17)? Use the change-of-base formula: log_b(x) = ln(x) / ln(b). Every scientific calculator has ln and log buttons, so log_5(17) = ln(17) / ln(5) ≈ 2.833 / 1.609 ≈ 1.76.
Why do exponential and logarithm graphs look like mirror images of each other? Because they are inverse functions, and graphically, a function and its inverse are always mirror images across the line y = x. Swapping x and y, which is what “inverse” means algebraically, is exactly the same operation as reflecting a graph across that diagonal line.
Example
A social media post starts with a single share and doubles every hour. Its reach follows N(t) = 2^t, so after just 20 hours it has been shared over a million times (2^20 = 1,048,576) — the same explosive doubling pattern behind compound interest and bacterial growth. Working backward, a marketer who wants to know how many hours until a post reaches 10,000 shares solves 2^t = 10,000 with a logarithm: t = log_2(10,000) = ln(10,000) / ln(2) ≈ 13.3 hours, the same change-of-base tool used throughout this note.
Related Terms
Referenced by