For a positive real base , the logarithm is the inverse function of the exponential function :
It asks which exponent produces a given positive number. Thus and . The base restrictions matter: would produce only one value, while a negative base does not define as a real-valued function for every real exponent.
The useful transformation is
For example, corresponds to in base two. Products become sums and ratios become differences. The logarithm does not generally convert a sum into a sum of logarithms. Base conversion uses the natural logarithm: . It also gives , positive when and negative when .
Historically, John Napier's 1614 Mirifici logarithmorum canonis descriptio presented logarithmic tables and their use, documented in the Smithsonian Libraries' digitized original. Tables made multiplication-heavy calculations more manageable by replacing products with addition and a lookup. The 1619 Constructio title page below belongs to a later publication from the same work on logarithms. These historical publications preceded the modern inverse function and integral presentation used here.
Figure 1.
Title page of Napier's 1619 Mirifici logarithmorum canonis constructio
. Source.
For integers and , the integer logarithm is the largest nonnegative integer such that . Equivalently,
The equivalence follows from the monotonicity of exponentiation in its exponent and the definition of the floor function. For example, , so the base-three integer logarithm of is .
A multiplication loop maintains and accepts another factor while . Repeated squaring makes the search faster: precompute starting at , and consider these factors in decreasing . Include a factor when the accumulated product remains at most . If , the loop invariant before considering is . Accepting exactly when halves that uncertainty, proving the greedy algorithm returns . This takes arithmetic operations; it is not the same claim as this bound on bit complexity.
For positive operands in bounded integer arithmetic, test before multiplying by . Integer division makes this equivalent to while preventing integer overflow in a rejected candidate.
For an input , start at and repeatedly increment and double while . In exact arithmetic, the loop invariant and the minimality of the terminating index give . For a general positive real input, the formula is instead : if , the loop makes no updates and cannot return a negative index.
Finite-width integer arithmetic also requires an overflow check. In wrapping signed 32-bit arithmetic, doubling produces the negative value and a further doubling produces zero. For a positive input exceeding , the loop can then remain at zero indefinitely. This is a two's complement wraparound example, not a universal language rule for signed overflow. A signed 64-bit doubling variable can represent the first power of two above every positive signed 32-bit input, repairing this particular range. The proof of the mathematical loop and the representation limits are separate parts of its correctness argument.
For the natural logarithm, define . Its derivative is , negative below one and positive above one. Thus its global minimum is , proving the bound, with equality only at one. Equivalently for ; this also follows from concavity and the tangent line at one.
For , the power series for the logarithm gives . The inequality is strict because for every .
For integers , rationality of is equivalent to equality of some positive integer powers . Exponentiation proves one direction and taking logarithms proves the other. Thus multiplicatively independent integers give an irrational number as their logarithm ratio. For distinct prime bases and arguments, unique factorization supplies that independence.
The logarithm is strictly concave on positive real numbers, as its second derivative is negative. Thus the Jensen inequality gives for a probability measure and an integrable positive , whenever the left side is defined. It also controls the negative logarithmic part of convex combinations of strictly positive functions.
The Cauchy principal value integral is the logarithmic integral. The offset version differs by a constant and is often used with the prime-counting function. It has .
The natural logarithm is the logarithm with base Euler's number, and the inverse function of the real exponential function. A particularly geometric definition is
For , it is the area under the hyperbola from to . For , the reversed integration limits give a negative value. The fundamental theorem of calculus gives , so the natural logarithm is increasing, while gives concavity.
Figure 1.
Exponential function and natural logarithm graphs reflect across ; equal multiplicative intervals have equal logarithmic areas
. Details.
The change of variables shows for . Thus the intervals from to and from to each contribute area , explaining . Equal ratios give equal increments on a logarithmic scale, even though the ordinary differences grow. This makes the natural logarithm useful for comparing multiplicative changes and solving for time in exponential growth or exponential decay. The integral construction and inverse function properties are discussed in OpenStax, the natural logarithm as an integral.
Integrating the geometric series for from zero to gives the displayed power series for . It has radius of convergence one. At the alternating series test gives conditional convergence to ; at the negative harmonic series diverges. Replacing by gives . An expression formed by substituting a nonlinear function for need not have the same convergence range after it is re-expanded as a Taylor series in the new variable.
The natural logarithm has the parameter-integral representation
For , the identity shows convergence: the absolute value is at most , which is integrable when . At , the apparent singularity is removable, with limiting value .
Write the left side as . On a compact parameter interval with , its differentiated integrand is bounded by the integrable function . The dominated convergence theorem justifies differentiation under the integral sign, giving . Since , the fundamental theorem of calculus gives . At , the original improper integral diverges as , and it also diverges for .
A logarithmic scale places a positive quantity according to a logarithm, so equal ratios occupy equal distances. For example, are equally spaced under the natural logarithm because every successive difference is . An ordinary linear scale instead gives equal distances to equal differences: .
For a base and a positive reference , define the axis position
The reference has the same units as , making a dimensionless quantity. The distance between two positions is
Multiplying both values by the same positive factor preserves that distance. Replacing by translates every position by ; changing the base rescales positions through . Neither change alters which ratios receive equal gaps.
In base ten, the values occupy positions when . The differences between neighboring values grow from nine to ninety to nine hundred, but every step spans one order of magnitude. The values occupy positions : the same spacing shifted by . This lets one plot small and large positive quantities together while keeping equal proportional changes equally visible.
A logarithmic scale is a rule for position, not an instruction to relabel the tick marks with their logarithms. A mark labelled still means the original value one hundred. Ordinary real logarithms exclude zero and negative inputs. Omitting such values or clipping them to a plotting boundary does not give them genuine logarithmic positions; the plotting choice needs to be clear.[ref]
For positive quantities, a difference of one order of magnitude means a factor of ten; a difference of orders of magnitude means a factor of . The logarithmic difference records this comparison, without subtracting the quantities themselves. For example, is three orders of magnitude above one, regardless of a common change of units. Roughly assigning a single value to an order of magnitude also requires a rounding convention; powers of ten are the reference levels.
For positive endpoints , halfway along a logarithmic scale means
Here is the base. Equivalently, using the natural logarithm, . The product of numbers identity for logarithms gives , so the midpoint is the geometric mean . The two endpoints lie at equal multiplicative distances because .
For and , this midpoint is , giving a factor of on each side. The arithmetic mean is halfway on a linear scale, but its two ratios are and . Thus reading halfway between the marks and as on a logarithmic scale gives the wrong value.
Figure 1.
Equal ratios give equal logarithmic gaps, and the geometric mean is halfway between two positive values
. Original rulers calculated from logarithms. The lower rulers cover the same endpoints and : the blue geometric mean is centered on the logarithmic scale, while the orange arithmetic mean is centered on the linear scale. Tick labels show original values. Details.
A semi-log plot uses a logarithmic scale on one axis and a linear scale on the other. Which axis is logarithmic matters. Plotting against makes positive exponential functions appear as straight lines; plotting against instead makes an affine function of a logarithm appear straight. The plotting operations change positions while retaining the original tick values.[ref]
Take the original dimensionless mathematical model for . It has exponential growth, with , , and . Taking a base-ten logarithm gives
The slope in these transformed positions is , although the original relative growth rate is . Equal steps of two in multiply by . The corresponding ordinary gains increase, so the left plot bends while the right plot is straight.
Figure 1.
The same exponential growth model bends on a linear scale and is straight on a semi-log plot with a logarithmic vertical axis
. Original exact mathematical model , not measurements. Both panels show identical values at the same . Right-hand tick labels retain the original values, with equal gaps for each doubling. The stated slope is for , not the original derivative . Details.
One practical use is checking a proposed exponential distribution for failure times. For rate and , its cumulative distribution function is , so the reciprocal survival function satisfies . Estimated probabilities can therefore be placed on a logarithmic vertical axis and compared with a straight line. Agreement supports compatibility with the chosen statistical model; a roughly straight finite sample does not establish a unique physical mechanism.[ref]
A log-log plot uses logarithmic scales on both axes. For a positive power law with , positive references give
Its transformed slope is the exponent when both axes use the same logarithm base and the slope is measured in logarithmic coordinate units. For example, takes the values at . Every doubling of quadruples , giving slope two on a log-log plot.
This differs from a semi-log plot: a power law has constant proportional response to a proportional change of input, whereas exponential growth has constant proportional response to an additive change of input. Both can appear straight with appropriate axes, so one must read the scale labels before interpreting a slope.
For , concavity of the natural logarithm gives
Equivalently, for .
For , the natural logarithm satisfies
To prove it, put . Then and the derivative is . More precisely,
This positive integral controls errors in symmetric approximations to the logarithm. After writing , the bound is for ; the inequality reverses for by replacing with .
For positive-definite Hermitian matrices, the matrix logarithm preserves the Loewner order:
No commutativity is required. With the natural logarithm, the spectral theorem gives the convergent integral representation
If , then ; taking its inverse and applying the reverse congruence gives . Hence
This proves operator monotonicity by a resolvent comparison.
For singular positive semidefinite matrices, the ordinary finite matrix logarithm is not defined at a zero eigenvalue. If and have the same kernel of a linear map, compress to its orthogonal complement and apply the theorem there. More generally holds for every , but divergent logarithms cannot simply be replaced by finite operators on different supports. The spectral definition and this support qualification are essential.[ref]

Ancestors (7)

  1. Exponential function
  2. Calculus
  3. Real analysis
  4. Analysis
  5. Area of mathematics
  6. Mathematics
  7. Home

Synonyms (1)

Discussion (0) New discussion

There are no discussions about this article yet.

Articles by others on the same topic (2)

A logarithm is a mathematical function that helps to determine the power to which a given base must be raised to produce a certain number.