You're staring at a spreadsheet. Column A has your raw measurements. Column B has their uncertainties. Now you need the natural log of those values — and you have no idea how the uncertainty propagates through ln Small thing, real impact..
Been there. It's the kind of thing that looks simple until you actually try to do it.
The short version: the uncertainty in ln(x) is just the relative uncertainty in x. But knowing the formula and knowing why it works — and when it breaks — are two different things. Let's walk through it properly.
What Is Ln Uncertainty
When you take the natural logarithm of a measured value, the uncertainty doesn't just tag along unchanged. So it transforms. The result is a new uncertainty that applies to the logged value — and it's almost always smaller than what you started with No workaround needed..
Here's the core idea. If you have a measurement x with absolute uncertainty Δx, then:
Δ(ln x) = Δx / x
That's it. The absolute uncertainty in the natural log equals the relative uncertainty in the original measurement. No square roots. No partial derivatives to memorize. Just division Small thing, real impact. Which is the point..
Why the natural log specifically
You might wonder — why ln and not log₁₀? The math works for any base, but the constant changes. For base-10 logs:
Δ(log₁₀ x) = (Δx / x) / ln(10) ≈ 0.434 × (Δx / x)
The natural log is cleaner because the derivative of ln(x) is exactly 1/x. Still, in physics and chemistry labs, ln shows up constantly — Arrhenius plots, radioactive decay, Nernst equation, entropy calculations. No extra constants. So this specific propagation rule comes up a lot Small thing, real impact..
Why It Matters
If you're linearizing data for a fit — say, plotting ln(k) vs 1/T for an activation energy — your error bars must reflect the transformed uncertainties. On the flip side, get this wrong and your fit weights are garbage. Here's the thing — your slope uncertainty is garbage. Your final reported Ea is garbage Not complicated — just consistent..
I've seen lab reports where students plotted raw uncertainties on logged axes. The error bars looked huge near the origin and tiny at the high end — exactly backwards from what the math says. Here's the thing — the reviewer caught it. The student had to redo the whole analysis Simple, but easy to overlook..
It also matters when you're combining logged values. Say you're calculating ΔG = -RT ln K. Now, the uncertainty in ln K feeds directly into ΔG. If you approximate it poorly, your thermodynamic conclusions shift.
And here's the thing most textbooks skip: this formula assumes Δx is small compared to x. Like, really small. Under 10% relative uncertainty, it's excellent. Practically speaking, at 20%, you start seeing noticeable bias. At 50%, the approximation falls apart completely.
We'll come back to that.
How It Works
The calculus derivation (three lines, no pain)
You don't need to re-derive this every time. But seeing it once helps it stick.
Let y = ln(x). The derivative dy/dx = 1/x.
Standard error propagation for a single variable: Δy = |dy/dx| Δx That's the part that actually makes a difference..
Substitute: Δ(ln x) = |1/x| Δx = Δx / x And that's really what it comes down to..
Done. The absolute value doesn't matter for positive x — which ln requires anyway.
What if you have ln(f(x)) instead of just ln(x)?
Same principle. Chain rule.
If y = ln(u) where u = f(x), then:
Δy = (1/u) × Δu
And Δu comes from whatever f(x) is. Maybe u = x², so Δu = 2x Δx. Then:
Δ(ln(x²)) = (1/x²) × 2x Δx = 2 Δx / x
Which makes sense — ln(x²) = 2 ln x, so the uncertainty should double. The math checks out.
When your variable has multiple uncertainty sources
Real measurements usually have more than one error component. Random error, systematic error, calibration uncertainty, resolution limit. You combine them in quadrature first, then propagate.
Say x = 5.0 ± 0.Still, 2 (random) ± 0. 1 (systematic).
Combined Δx = √(0.2² + 0.Even so, 1²) = √0. 05 ≈ 0.224.
Then Δ(ln x) = 0.224 / 5.0 = 0.0448.
Don't propagate each component through ln separately and then combine. That's wrong — the relative uncertainty is what adds in quadrature, not the logged uncertainties. Combine first, log once.
The exact formula (for when the approximation fails)
Remember the small-uncertainty assumption? Here's the exact version.
If x has uncertainty Δx, the true range of ln(x) spans from ln(x - Δx) to ln(x + Δx). The exact uncertainty is half that width:
Δ(ln x)_exact = ½ [ln(x + Δx) - ln(x - Δx)]
For x = 5.0, Δx = 0.2:
Approximation: 0.2/5.0 = 0.Which means 0400 Exact: ½ [ln(5. 2) - ln(4.8)] = ½ [1.On top of that, 6487 - 1. 5686] = 0.
They match to four decimals. But try *x = 5.0, Δx = 2.
Approximation: 2.On top of that, 0 = 0. 5) - ln(2.5)] = ½ [2.Practically speaking, 0149 - 0. 500 Exact: ½ [ln(7.And 5/5. 9163] = 0.
That's a 10% difference in the uncertainty itself. Practically speaking, if you're doing rigorous work — publication, thesis, calibration certificates — use the exact form. It's one extra line of code Surprisingly effective..
Common Mistakes
Using absolute uncertainty directly on the logged axis
This is the big one. Because of that, you calculate ln(x), then you plot error bars of length Δx. No. On the flip side, the error bar on the ln axis has length Δx/x. It's dimensionless. In practice, your axis is dimensionless. The units cancelled Not complicated — just consistent..
Forgetting that ln requires positive arguments
Obvious, right? ln(-0.But I've seen code crash because a measurement with x = 0.Which means 15 dipped negative in a Monte Carlo simulation. 1 ± 0.05) is undefined.
use it directly — the result is meaningless. You have three options:
- Truncate the distribution. Reject any Monte Carlo draw where x ≤ 0. This biases your result upward (you're throwing away the low tail), but it's honest about the limitation.
- Switch to a different model. If x can plausibly be zero or negative, ln(x) isn't the right transformation. Consider ln(x + c) for some offset c, or use a different analysis entirely.
- Report the bound. If x = 0.1 ± 0.15, say that the lower bound of ln(x) is undefined and report only the upper uncertainty.
Monte Carlo: when you don't want to think about the math
If the calculus makes your head spin — or if f(x) is something ugly like ln(sin(x) + e^(-x²)) — just simulate it It's one of those things that adds up..
Generate N random values of x from its distribution (Gaussian with mean x̄ and standard deviation Δx, for example). Take the natural log of each one. And compute the standard deviation of the resulting ln(x) values. That's your uncertainty.
import numpy as np
x = 5.random.Practically speaking, normal(x, dx, 1_000_000)
samples = samples[samples > 0] # discard non-positive draws
y = np. Consider this: 0
dx = 0. log(samples)
dy = np.Also, 2
samples = np. std(y)
# dy ≈ 0.
Monte Carlo handles asymmetric uncertainties automatically. 5*, the distribution of *ln(x)* is skewed — the upper uncertainty (from *ln(7.On top of that, 0 ± 2. 5)*) is larger than the lower uncertainty (from *ln(2.If *x = 5.5)*). The exact formula I gave earlier captures this symmetry, but Monte Carlo captures *everything*, including non-Gaussian input distributions and correlated variables.
Short version: it depends. Long version — keep reading.
### Log base 10 vs. natural log
A quick note: if you're working with log₁₀ instead of ln, the same principle applies, but there's a constant factor.
**Δ(log₁₀ x) = (1 / (x ln 10)) × Δx ≈ 0.4343 × Δx / x**
The factor *1/ln(10) ≈ 0.Still, 4343* comes from the chain rule — the derivative of log₁₀(x) is *1/(x ln 10)*. If someone hands you a result in log₁₀ and you need it in natural log (or vice versa), multiply or divide by *ln(10) ≈ 2.3026*.
### A practical checklist
Before you report *Δ(ln x)* in a paper or a plot, run through this:
- [ ] Is *x* strictly positive across its entire uncertainty range? If not, the result is invalid — see the options above.
- [ ] Did you combine all uncertainty sources into a single *Δx* before propagating? (Combine in quadrature if independent.)
- [ ] Is the relative uncertainty *Δx/x* small enough for the linear approximation? If *Δx/x < 0.1*, the approximation is fine. If it's larger, check with the exact formula or Monte Carlo.
- [ ] Are your error bars on the log-scale plot labeled as *Δ(ln x)* or *Δx/x*? They should be dimensionless numbers, not in the original units.
- [ ] If using log₁₀, did you include the *ln(10)* factor?
### Why this matters
Logarithmic transformations are everywhere — decibels in acoustics, pH in chemistry, Richter scales in seismology, log-returns in finance, and log-log plots in power-law analysis. Now, in every case, the uncertainty on the transformed variable isn't the same as the uncertainty on the raw variable. Propagating it correctly means your error bars reflect reality.
Worth pausing on this one.
### Why this matters (continued)
Wrong propagation doesn't just make your plots look ugly — it can lead to incorrect scientific conclusions. Consider a dataset where you're fitting a power law on a log-log plot. If you've underestimated the uncertainties on your logarithmic values, you might claim a statistically significant detection where none exists. Conversely, overestimating them could mask a real signal.
In fields like astrophysics, where measurements often span orders of magnitude, getting log-propagation right is essential. A stellar mass measured as *M = 10^6 ± 10^5 M☉* translates to *log₁₀(M) = 6.043*, not *6.Worth adding: 0 ± 0. 1*. Also, 0 ± 0. That distinction determines whether your black hole mass estimate is consistent with theoretical predictions.
### Putting it all together
Here's a complete example that handles both natural log and log base 10, with proper uncertainty propagation:
```python
import numpy as np
def propagate_log_uncertainty(x, dx, base=np.e):
"""
Propagate uncertainty through logarithmic transformation.
Parameters:
x: central value (must be positive)
dx: uncertainty in x
base: logarithm base (np.Consider this: e for natural log, 10 for log10)
Returns:
uncertainty in log(x)
"""
if x <= 0:
raise ValueError("x must be positive for logarithm")
if base == np. e:
return dx / x
elif base == 10:
return dx / (x * np.log(10))
else:
return dx / (x * np.
# Example usage
x = 5.0
dx = 0.2
# Natural log uncertainty
d_ln_x = propagate_log_uncertainty(x, dx, base=np.e)
print(f"Δ(ln x) = {d_ln_x:.4f}") # 0.0400
# Log base 10 uncertainty
d_log10_x = propagate_log_uncertainty(x, dx, base=10)
print(f"Δ(log₁₀ x) = {d_log10_x:.4f}") # 0.0174
Conclusion
Propagating uncertainty through logarithmic transformations is deceptively simple once you know the rules, but easy to get wrong if you don't. The key insight is that d(ln x)/dx = 1/x, which means the absolute uncertainty in ln x equals the relative uncertainty in x. For log base 10, multiply by 1/ln(10) And that's really what it comes down to. That's the whole idea..
Not obvious, but once you see it — you'll see it everywhere That's the part that actually makes a difference..
When in doubt, especially with large uncertainties or asymmetric distributions, Monte Carlo simulation provides a reliable fallback that handles any transformation and any input distribution. But for most cases — particularly when relative uncertainties are small — the analytical formulas are fast, accurate, and sufficient.
Counterintuitive, but true.
The next time you're plotting data on a logarithmic axis or analyzing log-transformed measurements, remember: your error bars aren't just Δx anymore. They're Δx/x (for natural log), and getting that right ensures your science stays solid Easy to understand, harder to ignore..