Note that log_{b}(0) is undefined because there is no number x such that b^{x} = 0. In fact, there is a vertical asymptote on the graph of log_{b}(x) at x = 0.
Logarithms and exponentials with the same base cancel each other. This is true because logarithms and exponentials are inverse operations (just like multiplication and division or addition and subtraction).
b
log
b
(
x
)
=
x
because
antilog
b
(
log
b
(
x
)
)
=
x
log
b
(
b
x
)
=
x
because
log
b
(
antilog
b
(
x
)
)
=
x
Both of the above are derived from the following two equations that define a logarithm:
b
c
=
x
,
log
b
(
x
)
=
c
Substituting c in the left equation gives b^{logb(x)} = x, and substituting x in the right gives log_{b}(b^{c}) = c. Finally, replace c by x.
Logarithms can be used to make calculations easier. For example, two numbers can be multiplied just by using a logarithm table and adding. The first three operations below assume x = b^{c}, and/or y = b^{d} so that log_{b}(x) = c and log_{b}(y) = d. Derivations also use the log definitions x = b^{logb(x)} and x = log_{b}(b^{x}).
Where
b
,
x
, and
y
are positive real numbers and
b
≠
1
. Both
c
and
d
are real numbers.
The laws result from canceling exponentials and appropriate law of indices. Starting with the first law:
x
y
=
b
log
b
(
x
)
b
log
b
(
y
)
=
b
log
b
(
x
)
+
log
b
(
y
)
⇒
log
b
(
x
y
)
=
log
b
(
b
log
b
(
x
)
+
log
b
(
y
)
)
=
log
b
(
x
)
+
log
b
(
y
)
The law for powers exploits another of the laws of indices:
x
y
=
(
b
log
b
(
x
)
)
y
=
b
y
log
b
(
x
)
⇒
log
b
(
x
y
)
=
y
log
b
(
x
)
The law relating to quotients then follows:
log
b
(
x
y
)
=
log
b
(
x
y
−
1
)
=
log
b
(
x
)
+
log
b
(
y
−
1
)
=
log
b
(
x
)
−
log
b
(
y
)
log
b
(
1
y
)
=
log
b
(
y
−
1
)
=
−
log
b
(
y
)
Similarly, the root law is derived by rewriting the root as a reciprocal power:
log
b
(
x
y
)
=
log
b
(
x
1
y
)
=
1
y
log
b
(
x
)
log
b
a
=
log
d
(
a
)
log
d
(
b
)
This identity is useful to evaluate logarithms on calculators. For instance, most calculators have buttons for ln and for log_{10}, but not for logarithm of arbitrary base.
Consider the equation
b
c
=
a
Take logarithm base
d
of both sides:
log
d
b
c
=
log
d
a
Simplify and solve for
c
:
c
log
d
b
=
log
d
a
c
=
log
d
a
log
d
b
Since
c
=
log
b
a
, then
log
b
a
=
log
d
a
log
d
b
This formula has several consequences:
log
b
a
=
1
log
a
b
log
b
n
a
=
log
b
a
n
b
log
a
d
=
d
log
a
b
−
log
b
a
=
log
b
(
1
a
)
=
log
1
b
a
log
b
1
a
1
⋯
log
b
n
a
n
=
log
b
π
(
1
)
a
1
⋯
log
b
π
(
n
)
a
n
,
where
π
is any permutation of the subscripts 1, ..., n. For example
log
b
w
⋅
log
a
x
⋅
log
d
c
⋅
log
d
z
=
log
d
w
⋅
log
b
x
⋅
log
a
c
⋅
log
d
z
.
The following summation/subtraction rule is especially useful in probability theory when one is dealing with a sum of logprobabilities:
log
b
(
a
+
c
)
=
log
b
a
+
log
b
(
1
+
c
a
)
log
b
(
a
−
c
)
=
log
b
a
+
log
b
(
1
−
c
a
)
Note that in practice
a
and
c
have to be switched on the right hand side of the equations if
c
>
a
. Also note that the subtraction identity is not defined if
a
=
c
since the logarithm of zero is not defined. Many programming languages have a specific log1p(x)
function that calculates
log
e
(
1
+
x
)
without underflow when
x
is small.
More generally:
log
b
∑
i
=
0
N
a
i
=
log
b
a
0
+
log
b
(
1
+
∑
i
=
1
N
a
i
a
0
)
=
log
b
a
0
+
log
b
(
1
+
∑
i
=
1
N
b
(
log
b
a
i
−
log
b
a
0
)
)
where
a
0
>
a
1
>
…
>
a
N
are sorted in descending order.
A useful identity involving exponents:
x
log
(
log
(
x
)
)
log
(
x
)
=
log
(
x
)
1
1
log
x
(
a
)
+
1
log
y
(
a
)
=
log
x
y
(
a
)
Based on and
x
1
+
x
≤
ln
(
1
+
x
)
≤
x
for all
−
1
<
x
2
x
2
+
x
≤
x
1
+
x
+
x
2
/
12
≤
ln
(
1
+
x
)
≤
x
1
+
x
≤
x
2
2
+
x
1
+
x
for
0
≤
x
, reverse for
−
1
<
x
≤
0
Both are pretty sharp around x=0, but not for large x.
lim
x
→
0
+
log
a
(
x
)
=
−
∞
if
a
>
1
lim
x
→
0
+
log
a
(
x
)
=
∞
if
a
<
1
lim
x
→
∞
log
a
(
x
)
=
∞
if
a
>
1
lim
x
→
∞
log
a
(
x
)
=
−
∞
if
a
<
1
lim
x
→
0
+
x
b
log
a
(
x
)
=
0
if
b
>
0
lim
x
→
∞
log
a
(
x
)
x
b
=
0
if
b
>
0
The last limit is often summarized as "logarithms grow more slowly than any power or root of x".
d
d
x
ln
x
=
1
x
,
d
d
x
log
b
x
=
1
x
ln
b
,
Where
x
>
0
,
b
>
0
, and
b
≠
1
.
ln
x
=
∫
1
x
1
t
d
t
∫
log
a
x
d
x
=
x
(
log
a
x
−
log
a
e
)
+
C
To remember higher integrals, it's convenient to define:
x
[
n
]
=
x
n
(
log
(
x
)
−
H
n
)
Where
H
n
is the nth Harmonic number.
x
[
0
]
=
log
x
x
[
1
]
=
x
log
(
x
)
−
x
x
[
2
]
=
x
2
log
(
x
)
−
3
2
x
2
x
[
3
]
=
x
3
log
(
x
)
−
11
6
x
3
Then,
d
d
x
x
[
n
]
=
n
x
[
n
−
1
]
∫
x
[
n
]
d
x
=
x
[
n
+
1
]
n
+
1
+
C
The identities of logarithms can be used to approximate large numbers. Note that log_{b}(a) + log_{b}(c) = log_{b}(ac), where a, b, and c are arbitrary constants. Suppose that one wants to approximate the 44th Mersenne prime, 2^{32,582,657} −1. To get the base10 logarithm, we would multiply 32,582,657 by log_{10}(2), getting 9,808,357.09543 = 9,808,357 + 0.09543. We can then get 10^{9,808,357} × 10^{0.09543} ≈ 1.25 × 10^{9,808,357}.
Similarly, factorials can be approximated by summing the logarithms of the terms.
The complex logarithm is the complex number analogue of the logarithm function. No single valued function on the complex plane can satisfy the normal rules for logarithms. However a multivalued function can be defined which satisfies most of the identities. It is usual to consider this as a function defined on a Riemann surface. A single valued version called the principal value of the logarithm can be defined which is discontinuous on the negative x axis and equals the multivalued version on a single branch cut.
The convention will be used here that a capital first letter is used for the principal value of functions and the lower case version refers to the multivalued function. The single valued version of definitions and identities is always given first followed by a separate section for the multiple valued versions.
ln(r) is the standard natural logarithm of the real number
r.
Log(z) is the principal value of the complex logarithm function and has imaginary part in the range
(π, π].
Arg(z) is the principal value of the arg function, its value is restricted to
(π, π]. It can be computed using
Arg(x+iy)= atan2(y, x).
Log
(
z
)
=
ln
(

z

)
+
i
Arg
(
z
)
e
Log
(
z
)
=
z
The multiple valued version of log(z) is a set but it is easier to write it without braces and using it in formulas follows obvious rules.
log(z) is the set of complex numbers
v which satisfy
e^{v} = z
arg(z) is the set of possible values of the arg function applied to
z.
When k is any integer:
log
(
z
)
=
ln
(

z

)
+
i
arg
(
z
)
log
(
z
)
=
Log
(
z
)
+
2
π
i
k
e
log
(
z
)
=
z
Principal value forms:
Ln
(
1
)
=
0
Ln
(
e
)
=
1
Multiple value forms, for any k an integer:
log
(
1
)
=
0
+
2
π
i
k
log
(
e
)
=
1
+
2
π
i
k
Principal value forms:
Log
(
z
1
)
+
Log
(
z
2
)
=
Log
(
z
1
z
2
)
(
mod
2
π
i
)
Log
(
z
1
)
−
Log
(
z
2
)
=
Log
(
z
1
/
z
2
)
(
mod
2
π
i
)
Multiple value forms:
log
(
z
1
)
+
log
(
z
2
)
=
log
(
z
1
z
2
)
log
(
z
1
)
−
log
(
z
2
)
=
log
(
z
1
/
z
2
)
A complex power of a complex number can have many possible values.
Principal value form:
z
1
z
2
=
e
z
2
Log
(
z
1
)
Log
(
z
1
z
2
)
=
z
2
Log
(
z
1
)
(
mod
2
π
i
)
Multiple value forms:
z
1
z
2
=
e
z
2
log
(
z
1
)
Where k_{1}, k_{2} are any integers:
log
(
z
1
z
2
)
=
z
2
log
(
z
1
)
+
2
π
i
k
2
log
(
z
1
z
2
)
=
z
2
Log
(
z
1
)
+
z
2
2
π
i
k
1
+
2
π
i
k
2