The natural logarithm of a positive real number , written , is its logarithm to the base e, where . Equivalently, it is the number to which must be raised to obtain . It is therefore the inverse function of the real exponential function: for every real , and for every .
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 , 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
For , this is the area under the curve between and . For , the integral has reversed limits and is negative. This definition immediately gives . The older name “hyperbolic logarithm” reflects the connection with the rectangular hyperbola .
By the fundamental theorem of calculus, this function has derivative . It is therefore continuous and strictly increasing on the positive real numbers. Its values are unbounded in both directions:
For example, the divergence at infinity can be seen by dividing the integral into intervals . Each interval contributes the same positive area after a change of variable, so the total grows without bound. Consequently, is a bijection from onto , and its inverse defines the exponential function.
The number is the unique positive number satisfying . This characterization agrees with the familiar compound-interest limit
Alternatively, one may first define through a convergent power series or a differential equation, and then define 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 on satisfying and . An algebraic characterization uses the identity . Under continuity or suitable comparable regularity assumptions, every such function has the form ; requiring fixes . Without regularity assumptions, the multiplication-to-addition identity alone admits pathological solutions.
Notation depends on context. Elementary mathematics commonly distinguishes from , whereas advanced analysis often writes 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
From the integral definition, substituting gives
which proves the identity after splitting the integral at . Thus equal ratios of positive numbers correspond to equal differences of their logarithms. For example, multiplying any positive quantity by increases its logarithm by , irrespective of the initial quantity.
The product identity yields the quotient and power rules:
where and is real. Real powers can themselves be defined by . For any base , , the change-of-base formula is
In particular, . There is no corresponding distributive rule for addition: generally, .
The graph is strictly increasing but bends downward, since
It is therefore strictly concave, while is a convex function. The tangent at lies above the graph and gives the fundamental inequality
with equality only at . Applying this inequality to also gives
These bounds quantify the closeness of the logarithm to its linear approximation near .
Concavity also connects logarithms with averaging. For positive numbers and nonnegative weights summing to , Jensen’s inequality states
Exponentiation produces the weighted arithmetic–geometric mean inequality,
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 , the chain rule gives
The ratio is called a logarithmic derivative. It measures the instantaneous rate of change relative to the current value, rather than the absolute rate . If a population grows by individuals per year, that absolute rate has very different significance for populations of and ; the logarithmic derivative distinguishes these cases directly.
For a nonzero real-valued function, the corresponding formula is
on any interval where does not vanish. The absolute value is essential when is negative. In particular,
The formula applies separately on the intervals and , 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 for , then , so
More generally, if with , then
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:
More generally,
where . 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 , differentiability gives
Thus changes in logarithms approximate fractional changes. The approximation concerns small relative increments, not merely small absolute increments. For a finite relative change , the exact logarithmic change is , while the ordinary fractional change is ; their difference becomes important when changes are large.
Series, local approximations, and asymptotic behavior
The most familiar Taylor series for the natural logarithm is
For , it follows by integrating the geometric series for term by term. The series also converges at , where it gives the alternating harmonic representation of , but diverges at . Its radius of convergence is , reflecting the singularity at the corresponding argument .
For , truncation after terms has error at most , by the alternating-series estimate. The approximation is therefore the first term of a systematic expansion, not an independent heuristic. For example,
rather than exactly . The quadratic correction accounts for most of the difference at this scale.
A frequently more effective series uses
Since , subtraction of two logarithmic series yields
Here for every positive , although convergence becomes slow when is extremely small or large. At , , so this expansion converges much faster than the alternating harmonic series. After retaining terms through , the absolute remainder is bounded by
The logarithm grows without bound at infinity but more slowly than every positive power:
Likewise, as . 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 diverges at zero, its improper integral over exists and equals .
Logarithms also enter asymptotic expansions involving products. A major example is the logarithmic form of Stirling’s formula for the factorial:
The logarithm turns the product 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 . In modern notation, his idealized construction is associated with an expression of the form
rather than simply . 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- 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 , 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 . Efficient algorithms first reduce the argument to a small interval. In binary floating-point arithmetic, a positive number can be decomposed as
where is an integer and is a significand in a chosen range, commonly . Then
A further adjustment can place closer to , 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 , because the result is close to zero. If a program forms before taking its logarithm and is tiny, rounding can erase altogether. In binary64 arithmetic with round-to-nearest, for example, rounds to , even though is approximately . The specialized function log1p(u) evaluates 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 ,
The relative condition number of the logarithm, when input and output errors are both measured relatively, is
It becomes large near 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:
Similarly, the log-sum-exp identity
avoids overflow in the exponential terms when all 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,
every value
is a complex logarithm of . This follows because adding 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
defined on . 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,
There is no globally analytic logarithm on . Indeed, the contour integral of around a positively oriented circle enclosing the origin is , 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,
and can differ by an integer multiple of . Taking , both factors lie in the principal branch domain, but
The discrepancy is , not a failure of the exponential relation.
The branch structure also governs complex powers, defined locally by . For noninteger , different choices of logarithm can yield different powers. Under analytic continuation once around zero, a logarithm increases by . 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 , the likelihood function is a product,
Where these factors are positive, its logarithm is
Because is strictly increasing, maximizing and maximizing 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 .
For observations from a normal distribution with unknown mean and known variance ,
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 is said to have a lognormal distribution when is normally distributed. If has mean and variance , then the median of is , but its expectation is
Thus exponentiating the mean of logarithms does not generally recover the arithmetic mean of the original values. More broadly, concavity gives whenever the relevant expectations exist.
In information theory, the self-information of an event with positive probability is , measured in nats. Independent events have multiplicative probabilities and therefore additive information. For a discrete distribution , entropy is
with interpreted by continuity as zero. Using base instead measures information in bits; dividing a value in nats by converts it to bits.
The Kullback–Leibler divergence between discrete distributions is
It is an expected log-likelihood ratio and is nonnegative, with value if some has . Logarithms also appear in cross-entropy losses and the logit , 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 satisfies the differential equation
then , and
The parameter is the constant relative growth rate. For , the doubling time is ; for exponential decay with , the half-life is . 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
Successive logarithmic returns add exactly:
Ordinary fractional returns do not add in this way because their gross growth factors multiply. For example, a rise of followed by a fall of produces a net factor , not . The corresponding log returns sum to .
Logarithmic coordinates also expose power laws. If with , then
A plot of against is therefore linear with slope . More generally, the local elasticity of with respect to is
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 , with a dimensional length, depends on the chosen unit unless it abbreviates for a reference length . Ratios also appear naturally in equilibrium constants, concentration activities, and changes in thermodynamic state.
In thermodynamics, the statistical expression relates entropy to the number of compatible microstates in the equal-probability setting. When two independent systems have multiplicities and , their combined multiplicity is . The logarithm makes the corresponding entropies additive. For unequal microstate probabilities, the related expression is , displaying the mathematical connection between statistical mechanics and information entropy.
Extensions to matrices and connections with number theory
For a square matrix , a matrix logarithm is a matrix satisfying
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 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
with orthogonal. Its principal logarithm is
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 and .
Scalar identities do not all survive unchanged. In particular, is not a general matrix identity: noncommutativity and branch choices both matter. For a positive-definite matrix, however,
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
where counts primes not exceeding , and means that the ratio of the two sides tends to . The related logarithmic integral,
provides another standard approximation. The appearance of expresses the declining average density of primes at large scales.
Logarithms also turn arithmetic products into sums. For example,
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.