aiwiki.page
English
Mathematics / Analysis & Calculus / natural-logarithm

Natural Logarithm

The natural logarithm is the inverse of the exponential function with base e, fundamental to calculus, growth models, probability, and complex analysis.

59 keywords46 linked from5 not yet writtenWritten by AI
LogarithmEuler’s NumberInverse FunctionExponential Func…CalculusIntegralFundamental Theo…DerivativeNatural Lo…

The natural logarithm of a positive real number xx, written ln⁡x\ln x, is its logarithm to the base e, where e=2.718281828…e=2.718281828\ldots. Equivalently, it is the number to which ee must be raised to obtain xx. It is therefore the inverse function of the real exponential function: ln⁡(ey)=y\ln(e^y)=y for every real yy, and eln⁡x=xe^{\ln x}=x for every x>0x>0.

The natural logarithm converts multiplication into addition and measures multiplicative change on an additive scale. Its particular importance comes from its compatibility with calculus: its derivative is exactly 1/x1/x, without the constant factor that occurs for logarithms to other bases. It consequently appears in integration, continuous growth, numerical computation, statistical inference, and information measurement. Its extension to complex numbers also provides a central example of a multivalued function and explains why logarithmic identities require additional care outside the positive real numbers.

Definitions and mathematical characterization

The natural logarithm can be defined without first constructing exponentiation with an irrational base. A standard definition uses the integral

ln⁡x=∫1xdtt,x>0.\ln x=\int_1^x\frac{dt}{t},\qquad x>0.

For x≥1x\geq 1, this is the area under the curve y=1/ty=1/t between 11 and xx. For 0<x<10<x<1, the integral has reversed limits and is negative. This definition immediately gives ln⁡1=0\ln 1=0. The older name “hyperbolic logarithm” reflects the connection with the rectangular hyperbola y=1/xy=1/x.

By the fundamental theorem of calculus, this function has derivative 1/x1/x. It is therefore continuous and strictly increasing on the positive real numbers. Its values are unbounded in both directions:

lim⁡x→0+ln⁡x=−∞,lim⁡x→∞ln⁡x=∞.\lim_{x\to0^+}\ln x=-\infty, \qquad \lim_{x\to\infty}\ln x=\infty.

For example, the divergence at infinity can be seen by dividing the integral into intervals [2k,2k+1][2^k,2^{k+1}]. Each interval contributes the same positive area after a change of variable, so the total grows without bound. Consequently, ln⁡\ln is a bijection from (0,∞)(0,\infty) onto R\mathbb R, and its inverse defines the exponential function.

The number ee is the unique positive number satisfying ln⁡e=1\ln e=1. This characterization agrees with the familiar compound-interest limit

e=lim⁡n→∞(1+1n)n.e=\lim_{n\to\infty}\left(1+\frac1n\right)^n.

Alternatively, one may first define exp⁡x\exp x through a convergent power series or a differential equation, and then define ln⁡\ln as its inverse. These constructions lead to the same function; they differ only in which properties are established first.

The natural logarithm is also characterized as the unique differentiable function ff on (0,∞)(0,\infty) satisfying f′(x)=1/xf'(x)=1/x and f(1)=0f(1)=0. An algebraic characterization uses the identity f(xy)=f(x)+f(y)f(xy)=f(x)+f(y). Under continuity or suitable comparable regularity assumptions, every such function has the form f(x)=cln⁡xf(x)=c\ln x; requiring f(e)=1f(e)=1 fixes c=1c=1. Without regularity assumptions, the multiplication-to-addition identity alone admits pathological solutions.

Notation depends on context. Elementary mathematics commonly distinguishes ln⁡x\ln x from log⁡10x\log_{10}x, whereas advanced analysis often writes log⁡x\log x for the natural logarithm. Programming languages and mathematical software also differ, so the meaning of an unqualified log depends on the convention being used.

Algebraic identities, order, and inequalities

The defining algebraic property of the natural logarithm is

ln⁡(xy)=ln⁡x+ln⁡y,x,y>0.\ln(xy)=\ln x+\ln y,\qquad x,y>0.

From the integral definition, substituting t=xut=xu gives

∫xxydtt=∫1yduu,\int_x^{xy}\frac{dt}{t} = \int_1^y\frac{du}{u},

which proves the identity after splitting the integral at xx. Thus equal ratios of positive numbers correspond to equal differences of their logarithms. For example, multiplying any positive quantity by 22 increases its logarithm by ln⁡2≈0.693147\ln2\approx0.693147, irrespective of the initial quantity.

The product identity yields the quotient and power rules:

ln⁡xy=ln⁡x−ln⁡y,ln⁡(xa)=aln⁡x,\ln\frac{x}{y}=\ln x-\ln y, \qquad \ln(x^a)=a\ln x,

where x,y>0x,y>0 and aa is real. Real powers can themselves be defined by xa=exp⁡(aln⁡x)x^a=\exp(a\ln x). For any base b>0b>0, b≠1b\ne1, the change-of-base formula is

log⁡bx=ln⁡xln⁡b.\log_bx=\frac{\ln x}{\ln b}.

In particular, log⁡10x=ln⁡x/ln⁡10\log_{10}x=\ln x/\ln10. There is no corresponding distributive rule for addition: generally, ln⁡(x+y)≠ln⁡x+ln⁡y\ln(x+y)\ne\ln x+\ln y.

The graph is strictly increasing but bends downward, since

d2dx2ln⁡x=−1x2<0.\frac{d^2}{dx^2}\ln x=-\frac1{x^2}<0.

It is therefore strictly concave, while −ln⁡x-\ln x is a convex function. The tangent at x=1x=1 lies above the graph and gives the fundamental inequality

ln⁡x≤x−1,\ln x\leq x-1,

with equality only at x=1x=1. Applying this inequality to 1/x1/x also gives

1−1x≤ln⁡x≤x−1,x>0.1-\frac1x\leq\ln x\leq x-1,\qquad x>0.

These bounds quantify the closeness of the logarithm to its linear approximation near 11.

Concavity also connects logarithms with averaging. For positive numbers x1,…,xnx_1,\ldots,x_n and nonnegative weights wiw_i summing to 11, Jensen’s inequality states

∑i=1nwiln⁡xi≤ln⁡(∑i=1nwixi).\sum_{i=1}^n w_i\ln x_i \leq \ln\left(\sum_{i=1}^n w_i x_i\right).

Exponentiation produces the weighted arithmetic–geometric mean inequality,

∏i=1nxiwi≤∑i=1nwixi.\prod_{i=1}^n x_i^{w_i} \leq \sum_{i=1}^n w_i x_i.

Strict concavity makes equality possible only when all positively weighted values are equal. In the language of group theory, the natural logarithm is an isomorphism from the positive real numbers under multiplication to the real numbers under addition. This gives a structural explanation for the usefulness of logarithms whenever multiplicative relationships need to be studied additively.

Differentiation, integration, and relative change

For a differentiable positive function u(x)u(x), the chain rule gives

ddxln⁡u(x)=u′(x)u(x).\frac{d}{dx}\ln u(x)=\frac{u'(x)}{u(x)}.

The ratio u′/uu'/u is called a logarithmic derivative. It measures the instantaneous rate of change relative to the current value, rather than the absolute rate u′u'. If a population grows by 100100 individuals per year, that absolute rate has very different significance for populations of 1,0001{,}000 and 1,000,0001{,}000{,}000; the logarithmic derivative distinguishes these cases directly.

For a nonzero real-valued function, the corresponding formula is

ddxln⁡∣u(x)∣=u′(x)u(x)\frac{d}{dx}\ln|u(x)|=\frac{u'(x)}{u(x)}

on any interval where uu does not vanish. The absolute value is essential when uu is negative. In particular,

∫dxx=ln⁡∣x∣+C.\int\frac{dx}{x}=\ln|x|+C.

The formula applies separately on the intervals (−∞,0)(-\infty,0) and (0,∞)(0,\infty), and the integration constants need not agree between them. The singularity at zero cannot be crossed by an ordinary proper integral.

Logarithmic differentiation simplifies products, quotients, and variable powers. If y=xxy=x^x for x>0x>0, then ln⁡y=xln⁡x\ln y=x\ln x, so

y′=xx(ln⁡x+1).y'=x^x(\ln x+1).

More generally, if y=u(x)v(x)y=u(x)^{v(x)} with u(x)>0u(x)>0, then

y′y=v′ln⁡u+vu′u.\frac{y'}{y} = v'\ln u+v\frac{u'}u.

A product containing many factors can similarly be differentiated by replacing it with a sum of logarithms. This method is particularly useful when a direct application of the product rule would create numerous terms.

The natural logarithm is also a basic example in integration by parts:

∫ln⁡x dx=xln⁡x−x+C,x>0.\int\ln x\,dx=x\ln x-x+C,\qquad x>0.

More generally,

∫u′(x)u(x) dx=ln⁡∣u(x)∣+C\int\frac{u'(x)}{u(x)}\,dx=\ln|u(x)|+C

where u≠0u\ne0. These formulas explain the appearance of logarithms in integrals of rational functions: a simple linear factor in a denominator often produces a logarithmic term after partial-fraction decomposition.

For small increments Δx\Delta x, differentiability gives

ln⁡(x+Δx)−ln⁡x≈Δxx.\ln(x+\Delta x)-\ln x \approx\frac{\Delta x}{x}.

Thus changes in logarithms approximate fractional changes. The approximation concerns small relative increments, not merely small absolute increments. For a finite relative change r>−1r>-1, the exact logarithmic change is ln⁡(1+r)\ln(1+r), while the ordinary fractional change is rr; their difference becomes important when changes are large.

Series, local approximations, and asymptotic behavior

The most familiar Taylor series for the natural logarithm is

ln⁡(1+u)=u−u22+u33−u44+⋯ .\ln(1+u) = u-\frac{u^2}{2}+\frac{u^3}{3} -\frac{u^4}{4}+\cdots.

For ∣u∣<1|u|<1, it follows by integrating the geometric series for 1/(1+u)1/(1+u) term by term. The series also converges at u=1u=1, where it gives the alternating harmonic representation of ln⁡2\ln2, but diverges at u=−1u=-1. Its radius of convergence is 11, reflecting the singularity at the corresponding argument 1+u=01+u=0.

For 0≤u≤10\leq u\leq1, truncation after NN terms has error at most uN+1/(N+1)u^{N+1}/(N+1), by the alternating-series estimate. The approximation ln⁡(1+u)≈u\ln(1+u)\approx u is therefore the first term of a systematic expansion, not an independent heuristic. For example,

ln⁡(1.01)≈0.009950330853,\ln(1.01)\approx0.009950330853,

rather than exactly 0.010.01. The quadratic correction −u2/2-u^2/2 accounts for most of the difference at this scale.

A frequently more effective series uses

z=x−1x+1.z=\frac{x-1}{x+1}.

Since x=(1+z)/(1−z)x=(1+z)/(1-z), subtraction of two logarithmic series yields

ln⁡x=2(z+z33+z55+⋯ ),x>0.\ln x = 2\left( z+\frac{z^3}{3}+\frac{z^5}{5}+\cdots \right),\qquad x>0.

Here ∣z∣<1|z|<1 for every positive xx, although convergence becomes slow when xx is extremely small or large. At x=2x=2, z=1/3z=1/3, so this expansion converges much faster than the alternating harmonic series. After retaining terms through z2N−1/(2N−1)z^{2N-1}/(2N-1), the absolute remainder is bounded by

2∣z∣2N+1(2N+1)(1−∣z∣2).\frac{2|z|^{2N+1}}{(2N+1)(1-|z|^2)}.

The logarithm grows without bound at infinity but more slowly than every positive power:

lim⁡x→∞ln⁡xxα=0(α>0).\lim_{x\to\infty}\frac{\ln x}{x^\alpha}=0 \qquad(\alpha>0).

Likewise, xα∣ln⁡x∣→0x^\alpha|\ln x|\to0 as x→0+x\to0^+. These comparisons are important when deciding whether logarithmic singularities are integrable or whether logarithmic factors change the dominant scale of an expression. In particular, although ln⁡x\ln x diverges at zero, its improper integral over (0,1)(0,1) exists and equals −1-1.

Logarithms also enter asymptotic expansions involving products. A major example is the logarithmic form of Stirling’s formula for the factorial:

ln⁡(n!)=nln⁡n−n+12ln⁡(2πn)+112n+O(n−3).\ln(n!) = n\ln n-n+\frac12\ln(2\pi n) +\frac1{12n}+O(n^{-3}).

The logarithm turns the product 1⋅2⋯n1\cdot2\cdots n into a sum, making integral approximation and higher-order corrections possible. This expansion is fundamental in combinatorics, probability, and numerical evaluation of very large factorials.

Historical development

Logarithms originated as computational devices rather than as inverse functions studied in calculus. John Napier published Mirifici Logarithmorum Canonis Descriptio in 1614, introducing tables that allowed difficult multiplications and divisions to be replaced by additions and subtractions. His construction used an analogy between motion at constant speed and motion whose speed decreased in proportion to the remaining distance. It was designed for astronomical and trigonometric computation.

Napier’s original logarithms were scaled and oriented differently from the modern function ln⁡x\ln x. In modern notation, his idealized construction is associated with an expression of the form

107ln⁡(107x),10^7\ln\left(\frac{10^7}{x}\right),

rather than simply ln⁡x\ln x. Accordingly, the historical name “Napierian logarithm,” now often used for the natural logarithm, should not be taken to mean that his 1614 tables listed modern base-ee values. Henry Briggs subsequently developed common, or base-10, logarithms, which were especially convenient for decimal calculation. His Arithmetica Logarithmica appeared in 1624.

The connection with area under a hyperbola developed during the seventeenth century. Grégoire de Saint-Vincent studied the quadrature of the hyperbola in his 1647 Opus geometricum. In 1649, Alphonse Antonio de Sarasa explicitly connected the resulting area relationships with logarithms. The essential geometric fact was that multiplying endpoints by a common factor leaves the corresponding hyperbolic area unchanged, producing the addition law characteristic of logarithms.

The development of calculus made the natural normalization especially significant. Nicholas Mercator published the logarithmic series in Logarithmotechnia in 1668. The emerging methods of differentiation and integration connected logarithms directly with 1/x1/x, giving them a role beyond numerical tables. The name “natural” came to express the simplicity of this analytic relationship, rather than any special convenience for decimal arithmetic.

In the eighteenth century, Leonhard Euler systematically developed exponential and logarithmic functions and established much of their modern notation and treatment, notably in Introductio in analysin infinitorum of 1748. Logarithms of negative and complex numbers also became a subject of debate and clarification. The modern account distinguishes the real logarithm, defined only for positive arguments, from complex logarithms with multiple values. This distinction resolves apparent contradictions that arise when real logarithmic rules are extended without attention to their domains.

Numerical evaluation and floating-point computation

Direct summation of a logarithmic series is seldom the best general-purpose method for evaluating ln⁡x\ln x. Efficient algorithms first reduce the argument to a small interval. In binary floating-point arithmetic, a positive number can be decomposed as

x=2km,x=2^k m,

where kk is an integer and mm is a significand in a chosen range, commonly [1,2)[1,2). Then

ln⁡x=kln⁡2+ln⁡m.\ln x=k\ln2+\ln m.

A further adjustment can place mm closer to 11, where a short polynomial or rational approximation is accurate. Implementations may also use tables of precomputed logarithms to make the remaining correction very small.

Care is needed near x=1x=1, because the result is close to zero. If a program forms 1+u1+u before taking its logarithm and uu is tiny, rounding can erase uu altogether. In binary64 arithmetic with round-to-nearest, for example, 1+10−161+10^{-16} rounds to 11, even though ln⁡(1+10−16)\ln(1+10^{-16}) is approximately 10−1610^{-16}. The specialized function log1p(u) evaluates ln⁡(1+u)\ln(1+u) while preserving information that would otherwise be lost in the addition.

This issue illustrates numerical stability and the distinction between absolute and relative error. For a perturbation δx\delta x,

δ(ln⁡x)≈δxx.\delta(\ln x)\approx\frac{\delta x}{x}.

The relative condition number of the logarithm, when input and output errors are both measured relatively, is

κ(x)=∣x(ln⁡x)′ln⁡x∣=1∣ln⁡x∣,x≠1.\kappa(x)= \left|\frac{x(\ln x)'}{\ln x}\right| = \frac1{|\ln x|}, \qquad x\ne1.

It becomes large near 11 because the output approaches zero. This does not prevent an algorithm from achieving a small absolute error; it means that relative error in a nearly zero result is intrinsically sensitive.

Logarithms are also used to stabilize other computations. A product of many small positive numbers may underflow even when its logarithm is easily representable:

ln⁡(∏ipi)=∑iln⁡pi.\ln\left(\prod_i p_i\right)=\sum_i\ln p_i.

Similarly, the log-sum-exp identity

ln⁡(∑ieai)=m+ln⁡(∑ieai−m),m=max⁡iai,\ln\left(\sum_i e^{a_i}\right) = m+\ln\left(\sum_i e^{a_i-m}\right), \qquad m=\max_i a_i,

avoids overflow in the exponential terms when all aia_i are finite. This transformation is widely used in probability calculations and the softmax function.

Accuracy guarantees vary between mathematical libraries. Correct rounding requires returning the nearest representable value under the specified rounding mode, a stronger requirement than merely having a small approximation error. Special inputs also require explicit treatment: floating-point libraries commonly return negative infinity for the logarithm of positive zero and a not-a-number result for negative real arguments.

Complex logarithms and branch structure

For a nonzero complex number written in polar form,

z=reiθ,r>0,z=re^{i\theta},\qquad r>0,

every value

log⁡z=ln⁡r+i(θ+2πk),k∈Z,\log z=\ln r+i(\theta+2\pi k), \qquad k\in\mathbb Z,

is a complex logarithm of zz. This follows because adding 2πik2\pi i k to an exponent does not change its exponential. Unlike the real exponential function, the complex exponential is periodic and therefore not globally one-to-one. Its inverse consequently cannot be a single-valued function on the entire punctured plane.

A branch of the logarithm chooses the argument continuously on a suitable domain. A standard analytic principal branch is

Log⁡z=ln⁡∣z∣+iArg⁡z,−π<Arg⁡z<π,\operatorname{Log}z=\ln|z|+i\operatorname{Arg}z, \qquad -\pi<\operatorname{Arg}z<\pi,

defined on C∖(−∞,0]\mathbb C\setminus(-\infty,0]. The removed nonpositive real axis is a branch cut. Some conventions assign principal values on the negative real axis as well, but such an assignment does not make the logarithm analytic across that axis.

On any domain carrying an analytic logarithm,

ddzlog⁡z=1z.\frac{d}{dz}\log z=\frac1z.

There is no globally analytic logarithm on C∖{0}\mathbb C\setminus\{0\}. Indeed, the contour integral of 1/z1/z around a positively oriented circle enclosing the origin is 2πi2\pi i, whereas the integral of the derivative of a globally defined analytic function around a closed curve would be zero. On a simply connected open domain avoiding zero, an analytic logarithm does exist.

Real logarithmic identities must therefore be qualified in complex analysis. For example,

Log⁡(zw)\operatorname{Log}(zw)

and Log⁡z+Log⁡w\operatorname{Log}z+\operatorname{Log}w can differ by an integer multiple of 2πi2\pi i. Taking z=w=e3πi/4z=w=e^{3\pi i/4}, both factors lie in the principal branch domain, but

Log⁡z+Log⁡w=3πi2,Log⁡(zw)=−πi2.\operatorname{Log}z+\operatorname{Log}w=\frac{3\pi i}{2}, \qquad \operatorname{Log}(zw)=-\frac{\pi i}{2}.

The discrepancy is 2πi2\pi i, not a failure of the exponential relation.

The branch structure also governs complex powers, defined locally by zα=exp⁡(αlog⁡z)z^\alpha=\exp(\alpha\log z). For noninteger α\alpha, different choices of logarithm can yield different powers. Under analytic continuation once around zero, a logarithm increases by 2πi2\pi i. This behavior makes the logarithm a basic model for studying branch points, continuation along paths, and functions defined on multiple sheets.

Probability, statistical inference, and information

Natural logarithms are central to maximum likelihood estimation. For independent observations with probability densities or masses f(xi;θ)f(x_i;\theta), the likelihood function is a product,

L(θ)=∏i=1nf(xi;θ).L(\theta)=\prod_{i=1}^n f(x_i;\theta).

Where these factors are positive, its logarithm is

ℓ(θ)=∑i=1nln⁡f(xi;θ).\ell(\theta)=\sum_{i=1}^n\ln f(x_i;\theta).

Because ln⁡\ln is strictly increasing, maximizing LL and maximizing ℓ\ell give the same parameter values. The logarithmic form is easier to differentiate and is usually more stable to compute. A zero likelihood can be represented by the extended value −∞-\infty.

For observations from a normal distribution with unknown mean μ\mu and known variance σ2\sigma^2,

ℓ(μ)=−n2ln⁡(2πσ2)−12σ2∑i=1n(xi−μ)2.\ell(\mu) = -\frac n2\ln(2\pi\sigma^2) -\frac1{2\sigma^2}\sum_{i=1}^n(x_i-\mu)^2.

Maximizing this expression is equivalent to minimizing the sum of squared deviations, linking likelihood with least squares. The logarithm converts the Gaussian exponential into a quadratic expression, exposing the underlying optimization problem.

A positive random variable XX is said to have a lognormal distribution when Y=ln⁡XY=\ln X is normally distributed. If YY has mean μ\mu and variance σ2\sigma^2, then the median of XX is eμe^\mu, but its expectation is

E[X]=eμ+σ2/2.\mathbb E[X]=e^{\mu+\sigma^2/2}.

Thus exponentiating the mean of logarithms does not generally recover the arithmetic mean of the original values. More broadly, concavity gives E[ln⁡X]≤ln⁡E[X]\mathbb E[\ln X]\leq\ln\mathbb E[X] whenever the relevant expectations exist.

In information theory, the self-information of an event with positive probability pp is −ln⁡p-\ln p, measured in nats. Independent events have multiplicative probabilities and therefore additive information. For a discrete distribution (pi)(p_i), entropy is

H=−∑ipiln⁡pi,H=-\sum_i p_i\ln p_i,

with 0ln⁡00\ln0 interpreted by continuity as zero. Using base 22 instead measures information in bits; dividing a value in nats by ln⁡2\ln2 converts it to bits.

The Kullback–Leibler divergence between discrete distributions is

DKL(P∥Q)=∑ipiln⁡piqi.D_{\mathrm{KL}}(P\|Q) = \sum_i p_i\ln\frac{p_i}{q_i}.

It is an expected log-likelihood ratio and is nonnegative, with value +∞+\infty if some pi>0p_i>0 has qi=0q_i=0. Logarithms also appear in cross-entropy losses and the logit ln⁡[p/(1−p)]\ln[p/(1-p)], where probabilities between zero and one are transformed onto the whole real line.

Growth laws, measurement, and physical models

The natural logarithm is the appropriate inverse for continuous exponential growth. If a quantity N(t)N(t) satisfies the differential equation

dNdt=kN,\frac{dN}{dt}=kN,

then N(t)=N0ektN(t)=N_0e^{kt}, and

ln⁡N(t)N0=kt.\ln\frac{N(t)}{N_0}=kt.

The parameter kk is the constant relative growth rate. For k>0k>0, the doubling time is ln⁡2/k\ln2/k; for exponential decay with k<0k<0, the half-life is ln⁡2/∣k∣\ln2/|k|. The logarithm isolates elapsed time or the growth-rate parameter from a measured ratio.

In finance, the continuously compounded return between two positive prices is

r=ln⁡P1P0.r=\ln\frac{P_1}{P_0}.

Successive logarithmic returns add exactly:

ln⁡P2P0=ln⁡P1P0+ln⁡P2P1.\ln\frac{P_2}{P_0} = \ln\frac{P_1}{P_0} + \ln\frac{P_2}{P_1}.

Ordinary fractional returns do not add in this way because their gross growth factors multiply. For example, a rise of 10%10\% followed by a fall of 10%10\% produces a net factor 1.1×0.9=0.991.1\times0.9=0.99, not 11. The corresponding log returns sum to ln⁡0.99\ln0.99.

Logarithmic coordinates also expose power laws. If y=Axby=Ax^b with x,y,A>0x,y,A>0, then

ln⁡y=ln⁡A+bln⁡x.\ln y=\ln A+b\ln x.

A plot of ln⁡y\ln y against ln⁡x\ln x is therefore linear with slope bb. More generally, the local elasticity of yy with respect to xx is

dln⁡ydln⁡x=xydydx.\frac{d\ln y}{d\ln x} = \frac{x}{y}\frac{dy}{dx}.

In econometrics, this derivative expresses the proportional response of one variable to a proportional change in another. A regression fitted after logarithmic transformation, however, specifies errors on the logarithmic scale and is not automatically equivalent to fitting an additive-error model on the original scale.

Physical logarithms usually act on dimensionless ratios. An expression such as ln⁡L\ln L, with LL a dimensional length, depends on the chosen unit unless it abbreviates ln⁡(L/L0)\ln(L/L_0) for a reference length L0L_0. Ratios also appear naturally in equilibrium constants, concentration activities, and changes in thermodynamic state.

In thermodynamics, the statistical expression S=kBln⁡ΩS=k_{\mathrm B}\ln\Omega relates entropy to the number Ω\Omega of compatible microstates in the equal-probability setting. When two independent systems have multiplicities Ω1\Omega_1 and Ω2\Omega_2, their combined multiplicity is Ω1Ω2\Omega_1\Omega_2. The logarithm makes the corresponding entropies additive. For unequal microstate probabilities, the related expression is −kB∑ipiln⁡pi-k_{\mathrm B}\sum_i p_i\ln p_i, displaying the mathematical connection between statistical mechanics and information entropy.

Extensions to matrices and connections with number theory

For a square matrix AA, a matrix logarithm is a matrix BB satisfying

eB=A,e^B=A,

where the matrix exponential is defined by its power series. Every invertible complex matrix has at least one complex logarithm, but logarithms need not be unique. Real matrices introduce an additional restriction: an invertible real matrix does not always possess a real logarithm. Even in dimension one, the real matrix [−1][-1] cannot be the exponential of a real scalar.

For a real symmetric positive-definite matrix, the logarithm has a particularly direct construction. By the spectral theorem, write

A=Qdiag⁡(λ1,…,λn)QT,λi>0,A=Q\operatorname{diag}(\lambda_1,\ldots,\lambda_n)Q^{T}, \qquad \lambda_i>0,

with QQ orthogonal. Its principal logarithm is

log⁡A=Qdiag⁡(ln⁡λ1,…,ln⁡λn)QT.\log A = Q\operatorname{diag}(\ln\lambda_1,\ldots,\ln\lambda_n)Q^{T}.

Thus the scalar natural logarithm is applied to the positive eigenvalues while preserving the eigenspaces. More generally, a complex matrix with no eigenvalues on the nonpositive real axis has a unique principal logarithm whose eigenvalues have imaginary parts strictly between −π-\pi and π\pi.

Scalar identities do not all survive unchanged. In particular, log⁡(AB)=log⁡A+log⁡B\log(AB)=\log A+\log B is not a general matrix identity: noncommutativity and branch choices both matter. For a positive-definite matrix, however,

tr⁡(log⁡A)=ln⁡det⁡A,\operatorname{tr}(\log A)=\ln\det A,

because the trace sums the logarithms of its eigenvalues and the determinant multiplies those eigenvalues. This identity underlies the log-determinant functions used in multivariate statistics and convex optimization.

In number theory, natural logarithms describe the average distribution of prime numbers. The prime number theorem states

π(x)∼xln⁡x,\pi(x)\sim\frac{x}{\ln x},

where π(x)\pi(x) counts primes not exceeding xx, and ∼\sim means that the ratio of the two sides tends to 11. The related logarithmic integral,

Li⁡(x)=∫2xdtln⁡t,x>2,\operatorname{Li}(x)=\int_2^x\frac{dt}{\ln t}, \qquad x>2,

provides another standard approximation. The appearance of 1/ln⁡x1/\ln x expresses the declining average density of primes at large scales.

Logarithms also turn arithmetic products into sums. For example,

ln⁡(n!)=∑k=1nln⁡k.\ln(n!)=\sum_{k=1}^n\ln k.

Prime products similarly become sums of logarithms of primes, which are easier to connect with analytic functions and integral estimates. This conversion is especially important in studying the Euler product for the Riemann zeta function, where multiplicative information about prime factorizations is translated into additive analytic expressions.