The logarithm of a number is the exponent to which another fixed value, the base, must be raised to produce that number. For example, the logarithm of 1000 to base 10 is 3, because 1000 is 10 to the power 3: 1000 = 10 × 10 × 10 = 10^{3}. More generally, if x = b^{y}, then y is the logarithm of x to base b, and is written y = log_{b}(x), so log_{10}(1000) = 3.
The logarithm to base 10 (b = 10) is called the common logarithm and has many applications in science and engineering. The natural logarithm has the constant e (≈ 2.718) as its base; its use is widespread in pure mathematics, especially calculus. The binary logarithm uses base 2 (b = 2) and is prominent in computer science.
Logarithms were introduced by John Napier in the early 17th century as a means to simplify calculations. They were rapidly adopted by navigators, scientists, engineers, and others to perform computations more easily, using slide rules and logarithm tables. Tedious multidigit multiplication steps can be replaced by table lookups and simpler addition because of the fact—important in its own right—that the logarithm of a product is the sum of the logarithms of the factors:
 $\backslash log\_b(xy)\; =\; \backslash log\_b\; (x)\; +\; \backslash log\_b\; (y).\; \backslash ,$
The presentday notion of logarithms comes from Leonhard Euler, who connected them to the exponential function in the 18th century.
Logarithmic scales reduce wideranging quantities to smaller scopes. For example, the decibel is a logarithmic unit quantifying sound pressure and voltage ratios. In chemistry, pH is a logarithmic measure for the acidity of an aqueous solution. Logarithms are commonplace in scientific formulae, and in measurements of the complexity of algorithms and of geometric objects called fractals. They describe musical intervals, appear in formulae counting prime numbers, inform some models in psychophysics, and can aid in forensic accounting.
In the same way as the logarithm reverses exponentiation, the complex logarithm is the inverse function of the exponential function applied to complex numbers. The discrete logarithm is another variant; it has applications in publickey cryptography.
Motivation and definition
The idea of logarithms is to reverse the operation of exponentiation, that is raising a number to a power. For example, the third power (or cube) of 2 is 8, because 8 is the product of three factors of 2:
 $2^3\; =\; 2\; \backslash times\; 2\; \backslash times\; 2\; =\; 8.\; \backslash ,$
It follows that the logarithm of 8 with respect to base 2 is 3, so log_{2} 8 = 3.
Exponentiation
The third power of some number b is the product of three factors of b. More generally, raising b to the nth power, where n is a natural number, is done by multiplying n factors of b. The nth power of b is written b^{n}, so that
 $b^n\; =\; \backslash underbrace\{b\; \backslash times\; b\; \backslash times\; \backslash cdots\; \backslash times\; b\}\_\{n\; \backslash text\{\; factors\}\}.$
Exponentiation may be extended to b^{y}, where b is a positive number and the exponent y is any real number. For example, b^{−1} is the reciprocal of b, that is, 1/b. (For further details, including the formula b^{m + n} = b^{m} · b^{n}, see exponentiation or ^{[1]} for an elementary treatise.)
Definition
The logarithm of a positive real number x with respect to base b, a positive real number not equal to 1^{[nb 1]}, is the exponent by which b must be raised to yield x. In other words, the logarithm of x to base b is the solution y to the equation^{[2]}
 $b^y\; =\; x.\; \backslash ,$
The logarithm is denoted "log_{b}(x)" (pronounced as "the logarithm of x to base b" or "the baseb logarithm of x"). In the equation y = log_{b}(x), the value y is the answer to the question "To what power must b be raised, in order to yield x?". This question can also be addressed (with a richer answer) for complex numbers, which is done in section "Complex logarithm", and this answer is much more extensively investigated in the page for the complex logarithm.
Examples
For example, log_{2}(16) = 4, since 2^{4} = 2 ×2 × 2 × 2 = 16. Logarithms can also be negative:
 $\backslash log\_2\; \backslash !\backslash left(\; \backslash frac\{1\}\{2\}\; \backslash right)\; =\; 1,\backslash ,$
since
 $2^\{1\}\; =\; \backslash frac\; 1\; \{2^1\}\; =\; \backslash frac\; 1\; 2.$
A third example: log_{10}(150) is approximately 2.176, which lies between 2 and 3, just as 150 lies between 10^{2} = 100 and 10^{3} = 1000. Finally, for any base b, log_{b}(b) = 1 and log_{b}(1) = 0, since b^{1} = b and b^{0} = 1, respectively.
Logarithmic identities
Several important formulas, sometimes called logarithmic identities or log laws, relate logarithms to one another.^{[3]}
Product, quotient, power and root
The logarithm of a product is the sum of the logarithms of the numbers being multiplied; the logarithm of the ratio of two numbers is the difference of the logarithms. The logarithm of the pth power of a number is p times the logarithm of the number itself; the logarithm of a pth root is the logarithm of the number divided by p. The following table lists these identities with examples:

Formula 
Example

product 
$\backslash log\_b(x\; y)\; =\; \backslash log\_b\; (x)\; +\; \backslash log\_b\; (y)\; \backslash ,$ 
$\backslash log\_3\; (243)\; =\; \backslash log\_3(9\; \backslash cdot\; 27)\; =\; \backslash log\_3\; (9)\; +\; \backslash log\_3\; (27)\; =\; 2\; +\; 3\; =\; 5\; \backslash ,$

quotient 
$\backslash log\_b\; \backslash !\backslash left(\backslash frac\; x\; y\; \backslash right)\; =\; \backslash log\_b\; (x)\; \; \backslash log\_b\; (y)\; \backslash ,$ 
$\backslash log\_2\; (16)\; =\; \backslash log\_2\; \backslash !\backslash left\; (\; \backslash frac\{64\}\{4\}\; \backslash right\; )\; =\; \backslash log\_2\; (64)\; \; \backslash log\_2\; (4)\; =\; 6\; \; 2\; =\; 4$

power 
$\backslash log\_b(x^p)\; =\; p\; \backslash log\_b\; (x)\; \backslash ,$ 
$\backslash log\_2\; (64)\; =\; \backslash log\_2\; (2^6)\; =\; 6\; \backslash log\_2\; (2)\; =\; 6\; \backslash ,$

root 
$\backslash log\_b\; \backslash sqrt[p]\{x\}\; =\; \backslash frac\; \{\backslash log\_b\; (x)\}\; p\; \backslash ,$ 
$\backslash log\_\{10\}\; \backslash sqrt\{1000\}\; =\; \backslash frac\{1\}\{2\}\backslash log\_\{10\}\; 1000\; =\; \backslash frac\{3\}\{2\}\; =\; 1.5$

Change of base
The logarithm log_{b}(x) can be computed from the logarithms of x and b with respect to an arbitrary base k using the following formula:
 $\backslash log\_b(x)\; =\; \backslash frac\{\backslash log\_k(x)\}\{\backslash log\_k(b)\}.\backslash ,$
Typical scientific calculators calculate the logarithms to bases 10 and e.^{[4]} Logarithms with respect to any base b can be determined using either of these two logarithms by the previous formula:
 $\backslash log\_b\; (x)\; =\; \backslash frac\{\backslash log\_\{10\}\; (x)\}\{\backslash log\_\{10\}\; (b)\}\; =\; \backslash frac\{\backslash log\_\{e\}\; (x)\}\{\backslash log\_\{e\}\; (b)\}.\; \backslash ,$
Given a number x and its logarithm log_{b}(x) to an unknown base b, the base is given by:
 $b\; =\; x^\backslash frac\{1\}\{\backslash log\_b(x)\}.$
Particular bases
Among all choices for the base b, three are particularly common. These are b = 10, b = e (the irrational mathematical constant ≈ 2.71828), and b = 2. In mathematical analysis, the logarithm to base e is widespread because of its particular analytical properties explained below. On the other hand, base10 logarithms are easy to use for manual calculations in the decimal number system:^{[5]}
 $\backslash log\_\{10\}(10\; x)\; =\; \backslash log\_\{10\}(10)\; +\; \backslash log\_\{10\}(x)\; =\; 1\; +\; \backslash log\_\{10\}(x).\backslash $
Thus, log_{10}(x) is related to the number of decimal digits of a positive integer x: the number of digits is the smallest integer strictly bigger than log_{10}(x).^{[6]} For example, log_{10}(1430) is approximately 3.15. The next integer is 4, which is the number of digits of 1430. The logarithm to base two is used in computer science, where the binary system is ubiquitous, and in music theory, where a pitch ratio of two (the octave) is ubiquitous and the cent is the binary logarithm (scaled by 1200) of the ratio between two pitches.
The following table lists common notations for logarithms to these bases and the fields where they are used. Many disciplines write log(x) instead of log_{b}(x), when the intended base can be determined from the context. The notation ^{b}log(x) also occurs.^{[7]} The "ISO notation" column lists designations suggested by the International Organization for Standardization (ISO 3111).^{[8]}
Base b

Name for log_{b}(x)

ISO notation

Other notations

Used in

2

binary logarithm

lb(x)^{[9]}

ld(x), log(x), lg(x), log2(x)

computer science, information theory, mathematics, music theory

e

natural logarithm

ln(x)^{[nb 2]}

log(x) (in mathematics and many programming languages^{[nb 3]})

mathematical analysis, physics, chemistry, statistics, economics, and some engineering fields

10

common logarithm

lg(x)

log(x) (in engineering, biology, astronomy), log10(x)

various engineering fields (see decibel and see below), logarithm tables, handheld calculators, spectroscopy

History
Predecessors
The Babylonians sometime in 2000–1600 BC may have invented the quarter square multiplication algorithm to multiply two numbers using only addition, subtraction and a table of squares.^{[13]}^{[14]} However it could not be used for division without an additional table of reciprocals. Large tables of quarter squares were used to simplify the accurate multiplication of large numbers from 1817 onwards until this was superseded by the use of computers.
The Indian mathematician Virasena worked with the concept of ardhaccheda: the number of times a number of the
form 2n could be halved. For exact powers of 2, this is the logarithm to that base, which is a whole number; for other
numbers, it is undefined. He described relations such as the product formula and also introduced integer logarithms
in base 3 (trakacheda) and base 4 (caturthacheda)^{[15]}
Michael Stifel published Arithmetica integra in Nuremberg in 1544, which contains a table^{[16]} of integers and powers of 2 that has been considered an early version of a logarithmic table.^{[17]}^{[18]}
In the 16th and early 17th centuries an algorithm called prosthaphaeresis was used to approximate multiplication and division. This used the trigonometric identity
 $\backslash cos\backslash ,\backslash alpha\backslash ,\backslash cos\backslash ,\backslash beta\; =\; \backslash frac12[\backslash cos(\backslash alpha+\backslash beta)\; +\; \backslash cos(\backslash alpha\backslash beta)]$
or similar to convert the multiplications to additions and table lookups. However logarithms are more straightforward and require less work. It can be shown using Euler's Formula that the two techniques are related.
From Napier to Euler
The method of logarithms was publicly propounded by John Napier in 1614, in a book titled Mirifici Logarithmorum Canonis Descriptio (Description of the Wonderful Rule of Logarithms).^{[19]} Joost Bürgi independently invented logarithms but published six years after Napier.^{[20]}
Johannes Kepler, who used logarithm tables extensively to compile his Ephemeris and therefore dedicated it to Napier,^{[21]} remarked:
...the accent in calculation led Justus Byrgius [Joost Bürgi] on the way to these very logarithms many years before Napier's system appeared; but ...instead of rearing up his child for the public benefit he deserted it in the birth.—Johannes Kepler^{[22]}, Rudolphine Tables (1627)
By repeated subtractions Napier calculated (1 − 10^{−7})^{L} for L ranging from 1 to 100. The result for L=100 is approximately 0.99999 = 1 − 10^{−5}. Napier then calculated the products of these numbers with 10^{7}(1 − 10^{−5})^{L} for L from 1 to 50, and did similarly with 0.9998 ≈ (1 − 10^{−5})^{20} and 0.9 ≈ 0.995^{20}. These computations, which occupied 20 years, allowed him to give, for any number N from 5 to 10 million, the number L that solves the equation
 $N=10^7\; \{(110^\{7\})\}^L.\; \backslash ,$
Napier first called L an "artificial number", but later introduced the word "logarithm" to mean a number that indicates a ratio: λόγος (logos) meaning proportion, and ἀριθμός (arithmos) meaning number. In modern notation, the relation to natural logarithms is:
^{[23]}
 $L\; =\; \backslash log\_\{(110^\{7\})\}\; \backslash !\backslash left(\; \backslash frac\{N\}\{10^7\}\; \backslash right)\; \backslash approx\; 10^7\; \backslash log\_\{\; \backslash frac\{1\}\{e\}\}\; \backslash !\backslash left(\; \backslash frac\{N\}\{10^7\}\; \backslash right)\; =\; 10^7\; \backslash log\_e\; \backslash !\backslash left(\; \backslash frac\{N\}\{10^7\}\; \backslash right),$
where the very close approximation corresponds to the observation that
 $\{(110^\{7\})\}^\{10^7\}\; \backslash approx\; \backslash frac\{1\}\{e\}.\; \backslash ,$
The invention was quickly and widely met with acclaim. The works of Bonaventura Cavalieri (Italy), Edmund Wingate (France), Xue Fengzuo (China), and
Johannes Kepler's Chilias logarithmorum (Germany) helped spread the concept further.^{[24]}
In 1647 Grégoire de SaintVincent related logarithms to the quadrature of the hyperbola, by pointing out that the area f(t) under the hyperbola from x = 1 to x = t satisfies
 $f(tu)\; =\; f(t)\; +\; f(u).\backslash ,$
The natural logarithm was first described by Nicholas Mercator in his work Logarithmotechnia published in 1668,^{[25]} although the mathematics teacher John Speidell had already in 1619 compiled a table on the natural logarithm.^{[26]} Around 1730, Leonhard Euler defined the exponential function and the natural logarithm by
 $e^x\; =\; \backslash lim\_\{n\; \backslash rightarrow\; \backslash infty\}\; (1+x/n)^n,$
 $\backslash ln(x)\; =\; \backslash lim\_\{n\; \backslash rightarrow\; \backslash infty\}\; n(x^\{1/n\}\; \; 1).$
Euler also showed that the two functions are inverse to one another.^{[27]}^{[28]}^{[29]}
Logarithm tables, slide rules, and historical applications
By simplifying difficult calculations, logarithms contributed to the advance of science, and especially of astronomy. They were critical to advances in surveying, celestial navigation, and other domains. PierreSimon Laplace called logarithms
 "...[a]n admirable artifice which, by reducing to a few days the labour of many months, doubles the life of the astronomer, and spares him the errors and disgust inseparable from long calculations."^{[30]}
A key tool that enabled the practical use of logarithms before calculators and computers was the table of logarithms.^{[31]} The first such table was compiled by Henry Briggs in 1617, immediately after Napier's invention. Subsequently, tables with increasing scope and precision were written. These tables listed the values of log_{b}(x) and b^{x} for any number x in a certain range, at a certain precision, for a certain base b (usually b = 10). For example, Briggs' first table contained the common logarithms of all integers in the range 1–1000, with a precision of 8 digits. As the function f(x) = b^{x} is the inverse function of log_{b}(x), it has been called the antilogarithm.^{[32]} The product and quotient of two positive numbers c and d were routinely calculated as the sum and difference of their logarithms. The product cd or quotient c/d came from looking up the antilogarithm of the sum or difference, also via the same table:
 $c\; d\; =\; b^\{\backslash log\_b\; (c)\}\; \backslash ,\; b^\{\backslash log\_b\; (d)\}\; =\; b^\{\backslash log\_b\; (c)\; +\; \backslash log\_b\; (d)\}\; \backslash ,$
and
 $\backslash frac\; c\; d\; =\; c\; d^\{1\}\; =\; b^\{\backslash log\_b\; (c)\; \; \backslash log\_b\; (d)\}.\; \backslash ,$
For manual calculations that demand any appreciable precision, performing the lookups of the two logarithms, calculating their sum or difference, and looking up the antilogarithm is much faster than performing the multiplication by earlier methods such as prosthaphaeresis, which relies on trigonometric identities. Calculations of powers and roots are reduced to multiplications or divisions and lookups by
 $c^d\; =\; (b^\{\backslash log\_b\; (c)\; \})^d\; =\; b^\{d\; \backslash log\_b\; (c)\}\; \backslash ,$
and
 $\backslash sqrt[d]\{c\}\; =\; c^\{\backslash frac\; 1\; d\}\; =\; b^\{\backslash frac\{1\}\{d\}\; \backslash log\_b\; (c)\}.\; \backslash ,$
Many logarithm tables give logarithms by separately providing the characteristic and mantissa of x, that is to say, the integer part and the fractional part of log_{10}(x).^{[33]} The characteristic of 10 · x is one plus the characteristic of x, and their significands are the same. This extends the scope of logarithm tables: given a table listing log_{10}(x) for all integers x ranging from 1 to 1000, the logarithm of 3542 is approximated by
 $\backslash log\_\{10\}(3542)\; =\; \backslash log\_\{10\}(10\backslash cdot\; 354.2)\; =\; 1\; +\; \backslash log\_\{10\}(354.2)\; \backslash approx\; 1\; +\; \backslash log\_\{10\}(354).\; \backslash ,$
Another critical application was the slide rule, a pair of logarithmically divided scales used for calculation, as illustrated here:
The nonsliding logarithmic scale, Gunter's rule, was invented shortly after Napier's invention. William Oughtred enhanced it to create the slide rule—a pair of logarithmic scales movable with respect to each other. Numbers are placed on sliding scales at distances proportional to the differences between their logarithms. Sliding the upper scale appropriately amounts to mechanically adding logarithms. For example, adding the distance from 1 to 2 on the lower scale to the distance from 1 to 3 on the upper scale yields a product of 6, which is read off at the lower part. The slide rule was an essential calculating tool for engineers and scientists until the 1970s, because it allows, at the expense of precision, much faster computation than techniques based on tables.^{[27]}
Analytic properties
A deeper study of logarithms requires the concept of a function. A function is a rule that, given one number, produces another number.^{[34]} An example is the function producing the xth power of b from any real number x, where the base b is a fixed number. This function is written
 $f(x)\; =\; b^x.\; \backslash ,$
Logarithmic function
To justify the definition of logarithms, it is necessary to show that the equation
 $b^x\; =\; y\; \backslash ,$
has a solution x and that this solution is unique, provided that y is positive and that b is positive and unequal to 1. A proof of that fact requires the intermediate value theorem from elementary calculus.^{[35]} This theorem states that a continuous function that produces two values m and n also produces any value that lies between m and n. A function is continuous if it does not "jump", that is, if its graph can be drawn without lifting the pen.
This property can be shown to hold for the function f(x) = b^{x}. Because f takes arbitrarily large and arbitrarily small positive values, any number y > 0 lies between f(x_{0}) and f(x_{1}) for suitable x_{0} and x_{1}. Hence, the intermediate value theorem ensures that the equation f(x) = y has a solution. Moreover, there is only one solution to this equation, because the function f is strictly increasing (for b > 1), or strictly decreasing (for 0 < b < 1).^{[36]}
The unique solution x is the logarithm of y to base b, log_{b}(y). The function that assigns to y its logarithm is called logarithm function or logarithmic function (or just logarithm).
The function log_{b}(x) is essentially characterized by the above product formula
 $\backslash log\_b(xy)\; =\; \backslash log\_b(x)\; +\; \backslash log\_b(y).$
More precisely, the logarithm to any base b > 1 is the only increasing function f from the positive reals to the reals satisfying f(b) = 1 and ^{[37]}
 $f(xy)=f(x)+f(y).$
Inverse function
The formula for the logarithm of a power says in particular that for any number x,
 $\backslash log\_b\; \backslash left\; (b^x\; \backslash right)\; =\; x\; \backslash log\_b(b)\; =\; x.$
In prose, taking the xth power of b and then the baseb logarithm gives back x. Conversely, given a positive number y, the formula
 $b^\{\backslash log\_b(y)\}\; =\; y$
says that first taking the logarithm and then exponentiating gives back y. Thus, the two possible ways of combining (or composing) logarithms and exponentiation give back the original number. Therefore, the logarithm to base b is the inverse function of f(x) = b^{x}.^{[38]}
Inverse functions are closely related to the original functions. Their graphs correspond to each other upon exchanging the x and the ycoordinates (or upon reflection at the diagonal line x = y), as shown at the right: a point (t, u = b^{t}) on the graph of f yields a point (u, t = log_{b}u) on the graph of the logarithm and vice versa. As a consequence, log_{b}(x) diverges to infinity (gets bigger than any given number) if x grows to infinity, provided that b is greater than one. In that case, log_{b}(x) is an increasing function. For b < 1, log_{b}(x) tends to minus infinity instead. When x approaches zero, log_{b}(x) goes to minus infinity for b > 1 (plus infinity for b < 1, respectively).
Derivative and antiderivative
Analytic properties of functions pass to their inverses.^{[35]} Thus, as f(x) = b^{x} is a continuous and differentiable function, so is log_{b}(y). Roughly, a continuous function is differentiable if its graph has no sharp "corners". Moreover, as the derivative of f(x) evaluates to ln(b)b^{x} by the properties of the exponential function, the chain rule implies that the derivative of log_{b}(x) is given by^{[36]}^{[39]}
 $\backslash frac\{d\}\{dx\}\; \backslash log\_b(x)\; =\; \backslash frac\{1\}\{x\backslash ln(b)\}.$
That is, the slope of the tangent touching the graph of the baseb logarithm at the point (x, log_{b}(x)) equals 1/(x ln(b)). In particular, the derivative of ln(x) is 1/x, which implies that the antiderivative of 1/x is ln(x) + C. The derivative with a generalised functional argument f(x) is
 $\backslash frac\{d\}\{dx\}\; \backslash ln(f(x))\; =\; \backslash frac\{f\text{'}(x)\}\{f(x)\}.$
The quotient at the right hand side is called the logarithmic derivative of f. Computing f'(x) by means of the derivative of ln(f(x)) is known as logarithmic differentiation.^{[40]} The antiderivative of the natural logarithm ln(x) is:^{[41]}
 $\backslash int\; \backslash ln(x)\; \backslash ,dx\; =\; x\; \backslash ln(x)\; \; x\; +\; C.$
Related formulas, such as antiderivatives of logarithms to other bases can be derived from this equation using the change of bases.^{[42]}
Integral representation of the natural logarithm
The natural logarithm of t agrees with the integral of 1/x dx from 1 to t:
 $\backslash ln\; (t)\; =\; \backslash int\_1^t\; \backslash frac\{1\}\{x\}\; \backslash ,\; dx.$
In other words, ln(t) equals the area between the x axis and the graph of the function 1/x, ranging from x = 1 to x = t (figure at the right). This is a consequence of the fundamental theorem of calculus and the fact that derivative of ln(x) is 1/x. The right hand side of this equation can serve as a definition of the natural logarithm. Product and power logarithm formulas can be derived from this definition.^{[43]} For example, the product formula ln(tu) = ln(t) + ln(u) is deduced as:
 $\backslash ln(tu)\; =\; \backslash int\_1^\{tu\}\; \backslash frac\{1\}\{x\}\; \backslash ,\; dx\; \backslash \; \backslash stackrel\; \{(1)\}\; =\; \backslash int\_1^\{t\}\; \backslash frac\{1\}\{x\}\; \backslash ,\; dx\; +\; \backslash int\_t^\{tu\}\; \backslash frac\{1\}\{x\}\; \backslash ,\; dx\; \backslash \; \backslash stackrel\; \{(2)\}\; =\; \backslash ln(t)\; +\; \backslash int\_1^u\; \backslash frac\{1\}\{w\}\; \backslash ,\; dw\; =\; \backslash ln(t)\; +\; \backslash ln(u).$
The equality (1) splits the integral into two parts, while the equality (2) is a change of variable (w = x/t). In the illustration below, the splitting corresponds to dividing the area into the yellow and blue parts. Rescaling the left hand blue area vertically by the factor t and shrinking it by the same factor horizontally does not change its size. Moving it appropriately, the area fits the graph of the function f(x) = 1/x again. Therefore, the left hand blue area, which is the integral of f(x) from t to tu is the same as the integral from 1 to u. This justifies the equality (2) with a more geometric proof.
The power formula ln(t^{r}) = r ln(t) may be derived in a similar way:
 $$
\ln(t^r) = \int_1^{t^r} \frac{1}{x}dx = \int_1^t \frac{1}{w^r} \left(rw^{r  1} \, dw\right) = r \int_1^t \frac{1}{w} \, dw = r \ln(t).
The second equality uses a change of variables (integration by substitution), w = x^{1/r}.
The sum over the reciprocals of natural numbers,
 $1\; +\; \backslash frac\; 1\; 2\; +\; \backslash frac\; 1\; 3\; +\; \backslash cdots\; +\; \backslash frac\; 1\; n\; =\; \backslash sum\_\{k=1\}^n\; \backslash frac\{1\}\{k\},$
is called the harmonic series. It is closely tied to the natural logarithm: as n tends to infinity, the difference,
 $\backslash sum\_\{k=1\}^n\; \backslash frac\{1\}\{k\}\; \; \backslash ln(n),$
converges (i.e., gets arbitrarily close) to a number known as the Euler–Mascheroni constant. This relation aids in analyzing the performance of algorithms such as quicksort.^{[44]}
There is also another integral representation of the logarithm that is useful in some situations.
 $\backslash ln(x)\; =\; \backslash lim\_\{\backslash epsilon\; \backslash to\; 0\}\; \backslash int\_\backslash epsilon^\backslash infty\; \backslash frac\{dt\}\{t\}\backslash left(\; e^\{xt\}\; \; e^\{t\}\; \backslash right)$
This can be verified by showing that it has the same value at x = 1, and the same derivative.
Transcendence of the logarithm
Real numbers that are not algebraic are called transcendental;^{[45]} for example, and e are such numbers, but $\backslash sqrt\{2\backslash sqrt\; 3\}$ is not. Almost all real numbers are transcendental. The logarithm is an example of a transcendental function. The Gelfond–Schneider theorem asserts that logarithms usually take transcendental, i.e., "difficult" values.^{[46]}
Calculation
Logarithms are easy to compute in some cases, such as log_{10}(1,000) = 3. In general, logarithms can be calculated using power series or the arithmeticgeometric mean, or be retrieved from a precalculated logarithm table that provides a fixed precision.^{[47]}^{[48]}
Newton's method, an iterative method to solve equations approximately, can also be used to calculate the logarithm, because its inverse function, the exponential function, can be computed efficiently.^{[49]} Using lookup tables, CORDIClike methods can be used to compute logarithms if the only available operations are addition and bit shifts.^{[50]}^{[51]} Moreover, the binary logarithm algorithm calculates lb(x) recursively based on repeated squarings of x, taking advantage of the relation
 $\backslash log\_2(x^2)\; =\; 2\; \backslash log\_2\; (x).\; \backslash ,$
Power series
 Taylor series
For any real number z that satisfies 0 < z < 2, the following formula holds:^{[nb 4]}^{[52]}
 $$
\ln (z) = (z1)  \frac{(z1)^2}{2} + \frac{(z1)^3}{3}  \frac{(z1)^4}{4} + \cdots
This is a shorthand for saying that ln(z) can be approximated to a more and more accurate value by the following expressions:
 $$
\begin{array}{lllll}
(z1) & & \\
(z1) &  & \frac{(z1)^2}{2} & \\
(z1) &  & \frac{(z1)^2}{2} & + & \frac{(z1)^3}{3} \\
\vdots &
\end{array}
For example, with z = 1.5 the third approximation yields 0.4167, which is about 0.011 greater than ln(1.5) = 0.405465. This series approximates ln(z) with arbitrary precision, provided the number of summands is large enough. In elementary calculus, ln(z) is therefore the limit of this series. It is the Taylor series of the natural logarithm at z = 1. The Taylor series of ln z provides a particularly useful approximation to ln(1+z) when z is small, z < 1, since then
 $$
\ln (1+z) = z  \frac{z^2}{2} +\frac{z^3}{3}\cdots \approx z.
For example, with z = 0.1 the firstorder approximation gives ln(1.1) ≈ 0.1, which is less than 5% off the correct value 0.0953.
 More efficient series
Another series is based on the area hyperbolic tangent function:
 $$
\ln (z) = 2\cdot\operatorname{artanh}\,\frac{z1}{z+1} = 2 \left ( \frac{z1}{z+1} + \frac{1}{3}{\left(\frac{z1}{z+1}\right)}^3 + \frac{1}{5}{\left(\frac{z1}{z+1}\right)}^5 + \cdots \right ),
for any real number z > 0.^{[nb 5]}^{[52]} Using the Sigma notation, this is also written as
 $\backslash ln\; (z)\; =\; 2\backslash sum\_\{n=0\}^\backslash infty\backslash frac\{1\}\{2n+1\}\backslash left(\backslash frac\{z1\}\{z+1\}\backslash right)^\{2n+1\}.$
This series can be derived from the above Taylor series. It converges more quickly than the Taylor series, especially if z is close to 1. For example, for z = 1.5, the first three terms of the second series approximate ln(1.5) with an error of about 3×10^{}. The quick convergence for z close to 1 can be taken advantage of in the following way: given a lowaccuracy approximation y ≈ ln(z) and putting
 $A\; =\; \backslash frac\; z\{\backslash exp(y)\},\; \backslash ,$
the logarithm of z is:
 $\backslash ln\; (z)=y+\backslash ln\; (A).\; \backslash ,$
The better the initial approximation y is, the closer A is to 1, so its logarithm can be calculated efficiently. A can be calculated using the exponential series, which converges quickly provided y is not too large. Calculating the logarithm of larger z can be reduced to smaller values of z by writing z = a · 10^{b}, so that ln(z) = ln(a) + b · ln(10).
A closely related method can be used to compute the logarithm of integers. From the above series, it follows that:
 $\backslash ln\; (n+1)\; =\; \backslash ln(n)\; +\; 2\backslash sum\_\{k=0\}^\backslash infty\backslash frac\{1\}\{2k+1\}\backslash left(\backslash frac\{1\}\{2\; n+1\}\backslash right)^\{2k+1\}.$
If the logarithm of a large integer n is known, then this series yields a fast converging series for log(n+1).
Arithmeticgeometric mean approximation
The arithmeticgeometric mean yields high precision approximations of the natural logarithm. ln(x) is approximated to a precision of 2^{−p} (or p precise bits) by the following formula (due to Carl Friedrich Gauss):^{[53]}^{[54]}
 $\backslash ln\; (x)\; \backslash approx\; \backslash frac\{\backslash pi\}\{2\; M(1,2^\{2m\}/x)\}\; \; m\; \backslash ln\; (2).$
Here M denotes the arithmeticgeometric mean. It is obtained by repeatedly calculating the average (arithmetic mean) and the square root of the product of two numbers (geometric mean). Moreover, m is chosen such that
 $x\; \backslash ,2^m\; >\; 2^\{p/2\}.\backslash ,$
Both the arithmeticgeometric mean and the constants π and ln(2) can be calculated with quickly converging series.
Applications
Logarithms have many applications inside and outside mathematics. Some of these occurrences are related to the notion of scale invariance. For example, each chamber of the shell of a nautilus is an approximate copy of the next one, scaled by a constant factor. This gives rise to a logarithmic spiral.^{[55]} Benford's law on the distribution of leading digits can also be explained by scale invariance.^{[56]} Logarithms are also linked to selfsimilarity. For example, logarithms appear in the analysis of algorithms that solve a problem by dividing it into two similar smaller problems and patching their solutions.^{[57]} The dimensions of selfsimilar geometric shapes, that is, shapes whose parts resemble the overall picture are also based on logarithms.
Logarithmic scales are useful for quantifying the relative change of a value as opposed to its absolute difference. Moreover, because the logarithmic function log(x) grows very slowly for large x, logarithmic scales are used to compress largescale scientific data. Logarithms also occur in numerous scientific formulas, such as the Tsiolkovsky rocket equation, the Fenske equation, or the Nernst equation.
Logarithmic scale
Scientific quantities are often expressed as logarithms of other quantities, using a logarithmic scale. For example, the decibel is a logarithmic unit of measurement. It is based on the common logarithm of ratios—10 times the common logarithm of a power ratio or 20 times the common logarithm of a voltage ratio. It is used to quantify the loss of voltage levels in transmitting electrical signals,^{[58]} to describe power levels of sounds in acoustics,^{[59]} and the absorbance of light in the fields of spectrometry and optics. The signaltonoise ratio describing the amount of unwanted noise in relation to a (meaningful) signal is also measured in decibels.^{[60]} In a similar vein, the peak signaltonoise ratio is commonly used to assess the quality of sound and image compression methods using the logarithm.^{[61]}
The strength of an earthquake is measured by taking the common logarithm of the energy emitted at the quake. This is used in the moment magnitude scale or the Richter scale. For example, a 5.0 earthquake releases 10 times and a 6.0 releases 100 times the energy of a 4.0.^{[62]} Another logarithmic scale is apparent magnitude. It measures the brightness of stars logarithmically.^{[63]} Yet another example is pH in chemistry; pH is the negative of the common logarithm of the activity of hydronium ions (the form hydrogen ions take in water).^{[64]} The activity of hydronium ions in neutral water is 10^{−7} mol·L^{−1}, hence a pH of 7. Vinegar typically has a pH of about 3. The difference of 4 corresponds to a ratio of 10^{4} of the activity, that is, vinegar's hydronium ion activity is about 10^{−3} mol·L^{−1}.
Semilog (loglinear) graphs use the logarithmic scale concept for visualization: one axis, typically the vertical one, is scaled logarithmically. For example, the chart at the right compresses the steep increase from 1 million to 1 trillion to the same space (on the vertical axis) as the increase from 1 to 1 million. In such graphs, exponential functions of the form f(x) = a · b^{x} appear as straight lines with slope equal to the logarithm of b.
Loglog graphs scale both axes logarithmically, which causes functions of the form f(x) = a · x^{k} to be depicted as straight lines with slope equal to the exponent k. This is applied in visualizing and analyzing power laws.^{[65]}
Psychology
Logarithms occur in several laws describing human perception:^{[66]}^{[67]}
Hick's law proposes a logarithmic relation between the time individuals take for choosing an alternative and the number of choices they have.^{[68]} Fitts's law predicts that the time required to rapidly move to a target area is a logarithmic function of the distance to and the size of the target.^{[69]} In psychophysics, the Weber–Fechner law proposes a logarithmic relationship between stimulus and sensation such as the actual vs. the perceived weight of an item a person is carrying.^{[70]} (This "law", however, is less precise than more recent models, such as the Stevens' power law.^{[71]})
Psychological studies found that individuals with little mathematics education tend to estimate quantities logarithmically, that is, they position a number on an unmarked line according to its logarithm, so that 10 is positioned as close to 100 as 100 is to 1000. Increasing education shifts this to a linear estimate (positioning 1000 10x as far away) in some circumstances, while logarithms are used when the numbers to be plotted are difficult to plot linearly.^{[72]}^{[73]}
Probability theory and statistics
Logarithms arise in probability theory: the law of large numbers dictates that, for a fair coin, as the number of cointosses increases to infinity, the observed proportion of heads approaches onehalf. The fluctuations of this proportion about onehalf are described by the law of the iterated logarithm.^{[74]}
Logarithms also occur in lognormal distributions. When the logarithm of a random variable has a normal distribution, the variable is said to have a lognormal distribution.^{[75]} Lognormal distributions are encountered in many fields, wherever a variable is formed as the product of many independent positive random variables, for example in the study of turbulence.^{[76]}
Logarithms are used for maximumlikelihood estimation of parametric statistical models. For such a model, the likelihood function depends on at least one parameter that must be estimated. A maximum of the likelihood function occurs at the same parametervalue as a maximum of the logarithm of the likelihood (the "log likelihood"), because the logarithm is an increasing function. The loglikelihood is easier to maximize, especially for the multiplied likelihoods for independent random variables.^{[77]}
Benford's law describes the occurrence of digits in many data sets, such as heights of buildings. According to Benford's law, the probability that the first decimaldigit of an item in the data sample is d (from 1 to 9) equals log_{10}(d + 1) − log_{10}(d), regardless of the unit of measurement.^{[78]} Thus, about 30% of the data can be expected to have 1 as first digit, 18% start with 2, etc. Auditors examine deviations from Benford's law to detect fraudulent accounting.^{[79]}
Computational complexity
Analysis of algorithms is a branch of computer science that studies the performance of algorithms (computer programs solving a certain problem).^{[80]} Logarithms are valuable for describing algorithms that divide a problem into smaller ones, and join the solutions of the subproblems.^{[81]}
For example, to find a number in a sorted list, the binary search algorithm checks the middle entry and proceeds with the half before or after the middle entry if the number is still not found. This algorithm requires, on average, log_{2}(N) comparisons, where N is the list's length.^{[82]} Similarly, the merge sort algorithm sorts an unsorted list by dividing the list into halves and sorting these first before merging the results. Merge sort algorithms typically require a time approximately proportional to N · log(N).^{[83]} The base of the logarithm is not specified here, because the result only changes by a constant factor when another base is used. A constant factor, is usually disregarded in the analysis of algorithms under the standard uniform cost model.^{[84]}
A function f(x) is said to grow logarithmically if f(x) is (exactly or approximately) proportional to the logarithm of x. (Biological descriptions of organism growth, however, use this term for an exponential function.^{[85]}) For example, any natural number N can be represented in binary form in no more than log_{2}(N) + 1 bits. In other words, the amount of memory needed to store N grows logarithmically with N.
Entropy and chaos
Entropy is broadly a measure of the disorder of some system. In statistical thermodynamics, the entropy S of some physical system is defined as
 $S\; =\; \; k\; \backslash sum\_i\; p\_i\; \backslash ln(p\_i).\backslash ,$
The sum is over all possible states i of the system in question, such as the positions of gas particles in a container. Moreover, p_{i} is the probability that the state i is attained and k is the Boltzmann constant. Similarly, entropy in information theory measures the quantity of information. If a message recipient may expect any one of N possible messages with equal likelihood, then the amount of information conveyed by any one such message is quantified as log_{2}(N) bits.^{[86]}
Lyapunov exponents use logarithms to gauge the degree of chaoticity of a dynamical system. For example, for a particle moving on an oval billiard table, even small changes of the initial conditions result in very different paths of the particle. Such systems are chaotic in a deterministic way, because small measurement errors of the initial state predictably lead to largely different final states.^{[87]} At least one Lyapunov exponent of a deterministically chaotic system is positive.
Fractals
Logarithms occur in definitions of the dimension of fractals.^{[88]} Fractals are geometric objects that are selfsimilar: small parts reproduce, at least roughly, the entire global structure. The Sierpinski triangle (pictured) can be covered by three copies of itself, each having sides half the original length. This makes the Hausdorff dimension of this structure log(3)/log(2) ≈ 1.58. Another logarithmbased notion of dimension is obtained by counting the number of boxes needed to cover the fractal in question.
Music
Four different octaves shown on a linear scale, then shown on a logarithmic scale (as the ear hears them).
Logarithms are related to musical tones and intervals. In equal temperament, the frequency ratio depends only on the interval between two tones, not on the specific frequency, or pitch, of the individual tones. For example, the note A has a frequency of 440 Hz and Bflat has a frequency of 466 Hz. The interval between A and Bflat is a semitone, as is the one between Bflat and B (frequency 493 Hz). Accordingly, the frequency ratios agree:
 $\backslash frac\{466\}\{440\}\; \backslash approx\; \backslash frac\{493\}\{466\}\; \backslash approx\; 1.059\; \backslash approx\; \backslash sqrt[12]2.$
Therefore, logarithms can be used to describe the intervals: an interval is measured in semitones by taking the base2^{1/12} logarithm of the frequency ratio, while the base2^{1/1200} logarithm of the frequency ratio expresses the interval in cents, hundredths of a semitone. The latter is used for finer encoding, as it is needed for nonequal temperaments.^{[89]}
Interval (the two tones are played at the same time)

)

play

play

play

play

play

Frequency ratio r

$2^\{\backslash frac\; 1\; \{72\}\}\; \backslash approx\; 1.0097$

$2^\{\backslash frac\; 1\; \{12\}\}\; \backslash approx\; 1.0595$

$\backslash tfrac\; 5\; 4\; =\; 1.25$

$\backslash begin\{align\}\; 2^\{\backslash frac\; 4\; \{12\}\}\; \&\; =\; \backslash sqrt[3]\; 2\; \backslash \backslash \; \&\; \backslash approx\; 1.2599\; \backslash end\{align\}$

$\backslash begin\{align\}\; 2^\{\backslash frac\; 6\; \{12\}\}\; \&\; =\; \backslash sqrt\; 2\; \backslash \backslash \; \&\; \backslash approx\; 1.4142\; \backslash end\{align\}$

$2^\{\backslash frac\; \{12\}\; \{12\}\}\; =\; 2$

Corresponding number of semitones $\backslash log\_\{\backslash sqrt[12]\; 2\}(r)\; =\; 12\; \backslash log\_2\; (r)$

$\backslash tfrac\; 1\; 6\; \backslash ,$

$1\; \backslash ,$

$\backslash approx\; 3.8631\; \backslash ,$

$4\; \backslash ,$

$6\; \backslash ,$

$12\; \backslash ,$

Corresponding number of cents $\backslash log\_\{\backslash sqrt[1200]\; 2\}(r)\; =\; 1200\; \backslash log\_2\; (r)$

$16\; \backslash tfrac\; 2\; 3\; \backslash ,$

$100\; \backslash ,$

$\backslash approx\; 386.31\; \backslash ,$

$400\; \backslash ,$

$600\; \backslash ,$

$1200\; \backslash ,$

Number theory
Natural logarithms are closely linked to counting prime numbers (2, 3, 5, 7, 11, ...), an important topic in number theory. For any integer x, the quantity of prime numbers less than or equal to x is denoted π(x). The prime number theorem asserts that π(x) is approximately given by
 $\backslash frac\{x\}\{\backslash ln(x)\},$
in the sense that the ratio of π(x) and that fraction approaches 1 when x tends to infinity.^{[90]} As a consequence, the probability that a randomly chosen number between 1 and x is prime is inversely proportional to the numbers of decimal digits of x. A far better estimate of π(x) is given by the
offset logarithmic integral function Li(x), defined by
 $\backslash mathrm\{Li\}(x)\; =\; \backslash int\_2^x\; \backslash frac1\{\backslash ln(t)\}\; \backslash ,dt.$
The Riemann hypothesis, one of the oldest open mathematical conjectures, can be stated in terms of comparing π(x) and Li(x).^{[91]} The Erdős–Kac theorem describing the number of distinct prime factors also involves the natural logarithm.
The logarithm of n factorial, n! = 1 · 2 · ... · n, is given by
 $\backslash ln\; (n!)\; =\; \backslash ln\; (1)\; +\; \backslash ln\; (2)\; +\; \backslash cdots\; +\; \backslash ln\; (n).\; \backslash ,$
This can be used to obtain Stirling's formula, an approximation of n! for large n.^{[92]}
Generalizations
Complex logarithm
The complex numbers a solving the equation
 $e^a=z.\backslash ,$
are called complex logarithms. Here, z is a complex number. A complex number is commonly represented as z = x + iy, where x and y are real numbers and i is the imaginary unit. Such a number can be visualized by a point in the complex plane, as shown at the right. The polar form encodes a nonzero complex number z by its absolute value, that is, the distance r to the origin, and an angle between the x axis and the line passing through the origin and z. This angle is called the argument of z. The absolute value r of z is
 $r=\backslash sqrt\{x^2+y^2\}.\; \backslash ,$
The argument is not uniquely specified by z: both φ and φ' = φ + 2π are arguments of z because adding 2π radians or 360 degrees^{[nb 6]} to φ corresponds to "winding" around the origin counterclockwise by a turn. The resulting complex number is again z, as illustrated at the right. However, exactly one argument φ satisfies −π < φ and φ ≤ π. It is called the principal argument, denoted Arg(z), with a capital A.^{[93]} (An alternative normalization is 0 ≤ Arg(z) < 2π.^{[94]})
Using trigonometric functions sine and cosine, or the complex exponential, respectively, r and φ are such that the following identities hold:^{[95]}
 $\backslash begin\{array\}\{lll\}z\&\; =\; \&\; r\; \backslash left\; (\backslash cos\; \backslash varphi\; +\; i\; \backslash sin\; \backslash varphi\backslash right)\; \backslash \backslash $
& = & r e^{i \varphi}.
\end{array} \,
This implies that the ath power of e equals z, where
 $a\; =\; \backslash ln\; (r)\; +\; i\; (\; \backslash varphi\; +\; 2\; n\; \backslash pi\; ),\; \backslash ,$
φ is the principal argument Arg(z) and n is an arbitrary integer. Any such a is called a complex logarithm of z. There are infinitely many of them, in contrast to the uniquely defined real logarithm. If n = 0, a is called the principal value of the logarithm, denoted Log(z). The principal argument of any positive real number x is 0; hence Log(x) is a real number and equals the real (natural) logarithm. However, the above formulas for logarithms of products and powers do not generalize to the principal value of the complex logarithm.^{[96]}
The illustration at the right depicts Log(z). The discontinuity, that is, the jump in the hue at the negative part of the x or real axis, is caused by the jump of the principal argument there. This locus is called a branch cut. This behavior can only be circumvented by dropping the range restriction on φ. Then the argument of z and, consequently, its logarithm become multivalued functions.
Inverses of other exponential functions
Exponentiation occurs in many areas of mathematics and its inverse function is often referred to as the logarithm. For example, the logarithm of a matrix is the (multivalued) inverse function of the matrix exponential.^{[97]} Another example is the padic logarithm, the inverse function of the padic exponential. Both are defined via Taylor series analogous to the real case.^{[98]} In the context of differential geometry, the exponential map maps the tangent space at a point of a manifold to a neighborhood of that point. Its inverse is also called the logarithmic (or log) map.^{[99]}
In the context of finite groups exponentiation is given by repeatedly multiplying one group element b with itself. The discrete logarithm is the integer n solving the equation
 $b^n\; =\; x,\backslash ,$
where x is an element of the group. Carrying out the exponentiation can be done efficiently, but the discrete logarithm is believed to be very hard to calculate in some groups. This asymmetry has important applications in public key cryptography, such as for example in the Diffie–Hellman key exchange, a routine that allows secure exchanges of cryptographic keys over unsecured information channels.^{[100]} Zech's logarithm is related to the discrete logarithm in the multiplicative group of nonzero elements of a finite field.^{[101]}
Further logarithmlike inverse functions include the double logarithm ln(ln(x)), the super or hyper4logarithm (a slight variation of which is called iterated logarithm in computer science), the Lambert W function, and the logit. They are the inverse functions of the double exponential function, tetration, of f(w) = we^{w},^{[102]} and of the logistic function, respectively.^{[103]}
Related concepts
From the perspective of pure mathematics, the identity log(cd) = log(c) + log(d) expresses a group isomorphism between positive reals under multiplication and reals under addition. Logarithmic functions are the only continuous isomorphisms between these groups.^{[104]} By means of that isomorphism, the Haar measure (Lebesgue measure) dx on the reals corresponds to the Haar measure dx/x on the positive reals.^{[105]} In complex analysis and algebraic geometry, differential forms of the form df/f are known as forms with logarithmic poles.^{[106]}
The polylogarithm is the function defined by
 $$
\operatorname{Li}_s(z) = \sum_{k=1}^\infty {z^k \over k^s}.
It is related to the natural logarithm by Li_{1}(z) = −ln(1 − z). Moreover, Li_{s}(1) equals the Riemann zeta function ζ(s).^{[107]}
See also
Notes
References
External links
 Khan Academy: Logarithms, free online micro lectures



This article was sourced from Creative Commons AttributionShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, EGovernment Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a nonprofit organization.