The
graph of the logarithm to base 2 crosses the
x axis (horizontal axis) at 1 and passes through the points with
coordinates (2, 1),
(4, 2), and
(8, 3). For example,
log2(8) = 3, because
23 = 8. The graph gets arbitrarily close to the
y axis, but does not meet or intersect it.
The logarithm of a number is the exponent by which another fixed value, the base, has to 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 = 103 = 10 × 10 × 10. More generally, if x = by, then y is the logarithm of x to base b, and is written logb(x), so log10(1000) = 3.
Logarithms were introduced by John Napier in the early 17th century as a means to simplify calculations. They were rapidly adopted by scientists, engineers, and others to perform computations more easily and rapidly, using slide rules and logarithm tables. These devices rely on the fact—important in its own right—that the logarithm of a product is the sum of the logarithms of the factors:

The present-day notion of logarithms comes from Leonhard Euler, who connected them to the exponential function in the 18th century.
The logarithm to base 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 b = 2 and is prominent in computer science.
Logarithmic scales reduce wide-ranging 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 formulas, and in measurements of the complexity of algorithms and of geometric objects called fractals. They describe musical intervals, appear in formulas 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 public-key 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:

It follows that the logarithm of 8 with respect to base 2 is 3.
[ Exponentiation
The third power of some number b is the product of 3 factors of b. More generally, raising b to the n-th power, where n is a natural number, is done by multiplying n factors. The n-th power of b is written bn, so that

The n-th power of b, bn, is defined whenever b is a positive number and n is a real number. For example, b−1 is the reciprocal of b, that is, 1/b.[nb 1]
[ Definition
The logarithm of a number x with respect to base b is the exponent to which b has to be raised to yield x. In other words, the logarithm of x to base b is the solution y of the equation[2]

The logarithm is denoted "logb(x)" (pronounced as "the logarithm of x to base b" or "the base-b logarithm of x"). In the equation y = logb(x), the value y, is the answer to the question "To what power must b be raised, in order to yield x?". For the logarithm to be defined, the base b must be a positive real number not equal to 1 and x must be a positive number.[nb 2]
[ Examples
For example, log2(16) = 4, since 24 = 2 ×2 × 2 × 2 = 16. Logarithms can also be negative:

since

A third example: log10(150) is approximately 2.176, which lies between 2 and 3, just as 150 lies between 102 = 100 and 103 = 1000. Finally, for any base b, logb(b) = 1 and logb(1) = 0, since b1 = b and b0 = 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. Therefore, the logarithm of the p-th power of a number is p times the logarithm of the number itself; the logarithm of a p-th root is the logarithm of the number divided by p. The following table lists these identities with examples:
|
Formula |
Example |
| product |
 |
 |
| quotient |
 |
 |
| power |
 |
 |
| root |
![\log_b \sqrt[p]{x} = \frac {\log_b (x)} p \,](/cgi-bin/wiki-image.mpl?image=%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fen%2Fmath%2F3%2Fc%2Fa%2F3ca49ea6d6cf9ced59d76f8fc5e42755.png&site=wikipedia&host=http://en.wikipedia.org/) |
 |
[ Change of base
The logarithm logb(x) can be computed from the logarithms of x and b with respect to an arbitrary base k using the following formula:

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:

Given a number x and its logarithm logb(x) to an unknown base b, the base is given by:

[ 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, base-10 logarithms are easy to use for manual calculations in the decimal number system:[5]

Thus, log10(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 log10(x).[6] For example, log10(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.
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 logb(x), when the intended base can be determined from the context. The notation blog(x) also occurs.[7] The "ISO notation" column lists designations suggested by the International Organization for Standardization (ISO 31-11).[8]
| Base b |
Name for logb(x) |
ISO notation |
Other notations |
Used in |
| 2 |
binary logarithm |
lb(x)[9] |
ld(x), log(x), lg(x) |
computer science, information theory, mathematics |
| e |
natural logarithm |
ln(x)[nb 3] |
log(x)
(in mathematics and many programming languages[nb 4]) |
mathematical analysis, physics, chemistry,
statistics, economics, and some engineering fields |
| 10 |
common logarithm |
lg(x) |
log(x)
(in engineering, biology, astronomy), |
various engineering fields (see decibel and see below),
logarithm tables, handheld calculators |
[ History
[ Predecessors
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).[13][14] Michael Stifel published Arithmetica integra in Nuremberg in 1544 which contains a table[15] of integers and powers of 2 that has been considered an early version of a logarithmic table.[16][17]
In the 16th and early 17th centuries an algorithm called prosthaphaeresis was used to approximate multiplication and division. This used the trigonometrical identity
![\cos\,\alpha\,\cos\,\beta = \frac12[\cos(\alpha+\beta) + \cos(\alpha-\beta)]](/cgi-bin/wiki-image.mpl?image=%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fen%2Fmath%2Ff%2Fa%2F2%2Ffa244116fc51e7c1bdef9195fd3317e8.png&site=wikipedia&host=http://en.wikipedia.org/)
or similar or convert the multiplications to additions and table lookups. However logarithms are more straightforward and require less work. It can be shown using complex numbers that this is basically the same technique.
The Babylonians sometime in 2000–1600 BC invented the quarter square multiplication algorithm to multiply two numbers using only addition, subtraction and a table of squares. However it could not be used for division without an additional table of reciprocals. This method was used to simplify the accurate multiplication of large numbers till superseded by the use of computers.
[ From Napier to Euler
John Napier (1550–1617), the inventor of logarithms
The method of logarithms was publicly propounded by John Napier in 1614, in a book entitled Mirifici Logarithmorum Canonis Descriptio (Description of the Wonderful Rule of Logarithms).[18] Joost Bürgi independently invented logarithms but published six years after Napier.[19]
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 107(1 − 10−5)L for L from 1 to 50, and did similarly with 0.9998 ≈ (1 − 10−5)20 and 0.9 ≈ 0.99520. 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

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: [20]

where the very close approximation corresponds to the observation that

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.[21]
The hyperbola
y = 1/x (red curve) and the area from
x = 1 to 6 (shaded in orange).
In 1647 Grégoire de Saint-Vincent 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

The natural logarithm was first described by Nicholas Mercator in his work Logarithmotechnia published in 1668,[22] although the mathematics teacher John Speidell had already in 1619 compiled a table on the natural logarithm.[23] Around 1730, Leonhard Euler defined the exponential function and the natural logarithm by


Euler also showed that the two functions are inverse to one another.[24][25][26]
[ 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. Pierre-Simon 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.[27]
A key tool that enabled the practical use of logarithms before calculators and computers was the table of logarithms.[28] 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 logb(x) and bx 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) = bx is the inverse function of logb(x), it has been called the antilogarithm.[29] 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:

and

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 look-ups by

and
![\sqrt[d]{c} = c^{\frac 1 d} = b^{\frac{1}{d} \log_b (c)}. \,](/cgi-bin/wiki-image.mpl?image=%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fen%2Fmath%2Fb%2F3%2F9%2Fb39e1f10bcbdc24bd9bf19bb7d0436b3.png&site=wikipedia&host=http://en.wikipedia.org/)
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 log10(x).[30] 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 log10(x) for all integers x ranging from 1 to 1000, the logarithm of 3542 is approximated by

Another critical application was the slide rule, a pair of logarithmically divided scales used for calculation, as illustrated here:
Schematic depiction of a slide rule. Starting from 2 on the lower scale, add the distance to 3 on the upper scale to reach the product 6. The slide rule works because it is marked such that the distance from 1 to
x is proportional to the logarithm of
x.
The non-sliding 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.[24]
[ 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.[31] An example is the function producing the x-th power of b from any real number x, where the base (or radix) b is a fixed number. This function is written

[ Logarithmic function
To justify the definition of logarithms, it is necessary to show that the equation

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.[32] This theorem states that a continuous function which 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) = bx. Because f takes arbitrarily large and arbitrarily small positive values, any number y > 0 lies between f(x0) and f(x1) for suitable x0 and x1. 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).[33]
The unique solution x is the logarithm of y to base b, logb(y). The function which assigns to y its logarithm is called logarithm function or logarithmic function (or just logarithm).
[ Inverse function
The graph of the logarithm function log
b(
x) (blue) is obtained by
reflecting the graph of the function
bx (red) at the diagonal line (
x = y).
The formula for the logarithm of a power says in particular that for any number x,

In prose, taking the x-th power of b and then the base-b logarithm gives back x. Conversely, given a positive number y, the formula

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) = bx.[34]
Inverse functions are closely related to the original functions. Their graphs correspond to each other upon exchanging the x- and the y-coordinates (or upon reflection at the diagonal line x = y), as shown at the right: a point (t, u = bt) on the graph of f yields a point (u, t = logbu) on the graph of the logarithm and vice versa. As a consequence, logb(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, logb(x) is an increasing function. For b < 1, logb(x) tends to minus infinity instead. When x approaches zero, logb(x) goes to minus infinity for b > 1 (plus infinity for b < 1, respectively).
[ Derivative and antiderivative
The graph of the natural logarithm (green) and its tangent at
x = 1.5 (black)
Analytic properties of functions pass to their inverses.[32] Thus, as f(x) = bx is a continuous and differentiable function, so is logb(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)bx by the properties of the exponential function, the chain rule implies that the derivative of logb(x) is given by[33][35]

That is, the slope of the tangent touching the graph of the base-b logarithm at the point (x, logb(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

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.[36] The antiderivative of the natural logarithm ln(x) is:[37]

Related formulas, such as antiderivatives of logarithms to other bases can be derived from this equation using the change of bases.[38]
[ Integral representation of the natural logarithm
The natural logarithm of
t is the shaded area underneath the graph of the function
f(
x) = 1/
x (reciprocal of
x).
The natural logarithm of t agrees with the integral of 1/x dx from 1 to t:

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.[39] For example, the product formula ln(tu) = ln(t) + ln(u) is deduced as:

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.
A visual proof of the product formula of the natural logarithm
The power formula ln(tr) = r ln(t) may be derived in a similar way:

The second equality uses a change of variables (integration by substitution), w := x1/r.
The sum over the reciprocals of natural numbers,

is called the harmonic series. It is closely tied to the natural logarithm: as n tends to infinity, the difference,

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.[40]
[ Transcendence of the logarithm
The logarithm is an example of a transcendental function and from a theoretical point of view, the Gelfond–Schneider theorem asserts that logarithms usually take "difficult" values. The formal statement relies on the notion of algebraic numbers, which includes all rational numbers, but also numbers such as the square root of 2 or
![\sqrt{-5+\sqrt[3]{3 / 13}}.](/cgi-bin/wiki-image.mpl?image=%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fen%2Fmath%2Fb%2F4%2Fd%2Fb4d60776353c8d3287070d36d877bbcf.png&site=wikipedia&host=http://en.wikipedia.org/)
Complex numbers that are not algebraic are called transcendental;[41] for example, π and e are such numbers. Almost all complex numbers are transcendental. Using these notions, thee Gelfond–Scheider theorem states that given two algebraic numbers a and b, logb(a) is either a transcendental number or aSource: this wikipedia article, under CC-BY-SA.