{
  "id": "logarithm",
  "title": "Logarithm",
  "lang": "en",
  "source_lang": "en",
  "summary": "A logarithm is the exponent to which a specified base must be raised to obtain a given number, converting multiplication into addition.",
  "category": "mathematics",
  "subcategory": "analysis",
  "type": "concept",
  "aliases": [
    "Logarithmic function"
  ],
  "generated_at": "2026-11-02",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/logarithm/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/logarithm/",
      "json": "https://aiwiki.page/zh/logarithm.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A logarithm is the exponent that produces a specified number when a fixed base is raised to that exponent. For positive real numbers \\(b\\) and \\(x\\), with \\(b\\ne1\\), the statement \\(\\log_b x=y\\) means precisely that \\(b^y=x\\). Thus \\(\\log_{10}1000=3\\), because \\(10^3=1000\\), and \\(\\log_2(1/8)=-3\\), because \\(2^{-3}=1/8\\). A logarithmic function is the inverse of an exponential function.\n\nLogarithms connect multiplicative relationships with additive ones. Their central identity, \\(\\log_b(xy)=\\log_b x+\\log_b y\\), originally made them powerful tools for numerical calculation and later became fundamental throughout analysis, statistics, and computer science. They describe relative change, compress quantities spanning many orders of magnitude, and measure information and algorithmic complexity.\n\nFor positive real arguments, logarithms form a family of closely related functions distinguished only by a constant scale factor. Their extension to complex numbers introduces multiple values and branch choices, while related constructions appear for matrices and finite groups. These extensions preserve some features of real logarithms but require additional algebraic or geometric conditions."
    },
    {
      "heading": "Definition and the real logarithmic function",
      "text": "Let \\(b>0\\) and \\(b\\ne1\\). The real exponential function \\(x\\mapsto b^x\\) is a continuous, one-to-one map from the real numbers onto the positive real numbers. Its inverse is the logarithmic function with base \\(b\\), written \\(\\log_b\\). Consequently,\n\n\\[\\log_b x=y\\quad\\Longleftrightarrow\\quad b^y=x.\\]\n\nThe domain is \\((0,\\infty)\\), and the range is all real numbers. The inverse identities are\n\n\\[\\log_b(b^y)=y,\\qquad b^{\\log_b x}=x,\\]\n\nfor real \\(y\\) and positive \\(x\\). In particular, \\(\\log_b1=0\\) and \\(\\log_b b=1\\).\n\nThe conditions on the base are essential. Base \\(1\\) would give a constant exponential function and therefore no inverse. Base \\(0\\) does not define exponentiation for all real exponents, and a negative base does not produce a real-valued exponential function on the whole real line. Likewise, zero and negative numbers have no real logarithm: a positive base raised to a real power is always positive. Expressions such as “the logarithm of zero is negative infinity” describe a limiting behavior, not a finite real value.\n\nWhen \\(b>1\\), the logarithm is strictly increasing. Arguments greater than \\(1\\) have positive logarithms, while arguments between \\(0\\) and \\(1\\) have negative logarithms. If \\(0<b<1\\), the function is strictly decreasing and these signs reverse. For example, \\(\\log_{1/2}8=-3\\). The graph always passes through \\((1,0)\\), and it is the reflection of the graph of \\(y=b^x\\) across the line \\(y=x\\). The vertical axis is an asymptote, never a part of the graph.\n\nLogarithms need not be integers or even rational numbers. For instance, \\(\\log_2 3\\) is irrational. If it equaled a positive rational number \\(m/n\\), then \\(2^m=3^n\\), contradicting the uniqueness of prime factorization. Nevertheless, every positive argument has a unique real logarithm to every admissible base. This extends the intuitive question “how many factors of \\(b\\) make \\(x\\)?” from whole numbers of factors to arbitrary real exponents.\n\nSolving an exponential equation is therefore a basic application. If \\(b^t=c\\), with \\(c>0\\), then \\(t=\\log_b c\\). More generally, \\(Ae^{kt}=B\\), with \\(A,B>0\\) and \\(k\\ne0\\), gives \\(t=\\ln(B/A)/k\\). Here \\(\\ln\\) denotes the natural logarithm."
    },
    {
      "heading": "Algebraic laws and change of base",
      "text": "For positive \\(x,y\\), an admissible base \\(b\\), and a real exponent \\(r\\), logarithms satisfy\n\n\\[\\log_b(xy)=\\log_b x+\\log_b y,\\]\n\n\\[\\log_b(x/y)=\\log_b x-\\log_b y, \\qquad \\log_b(x^r)=r\\log_b x.\\]\n\nThese identities follow directly from the laws of exponentiation. If \\(x=b^u\\) and \\(y=b^v\\), then \\(xy=b^{u+v}\\), so its logarithm is \\(u+v\\). Positive arguments ensure that arbitrary real powers and the logarithms involved are well defined.\n\nThe product law is the central structural property. It identifies multiplication of positive numbers with addition of their logarithms. In the language of group theory, \\(\\log_b\\) is an isomorphism from the multiplicative group of positive reals to the additive group of reals. Multiplicative inverses become additive negatives, and powers become scalar multiples. For example,\n\n\\[\\log_{10}(20\\cdot50)=\\log_{10}20+\\log_{10}50=3.\\]\n\nThis relationship explains both the historical usefulness of logarithmic tables and the modern use of logarithms to simplify products of many factors.\n\nChanging the base changes only the vertical scale:\n\n\\[\\log_b x=\\frac{\\log_a x}{\\log_a b},\\]\n\nwhere \\(a>0\\), \\(a\\ne1\\), and \\(b>0\\), \\(b\\ne1\\). To derive this formula, write \\(x=b^y\\) and take logarithms to base \\(a\\), obtaining \\(\\log_a x=y\\log_a b\\). Important consequences include\n\n\\[\\log_b a=\\frac{1}{\\log_a b}\\]\n\nwhen both bases are admissible, and\n\n\\[\\log_a b\\,\\log_b c=\\log_a c\\]\n\nwhen the expressions are defined. A calculator therefore needs only one basic logarithm implementation to evaluate logarithms in every positive real base.\n\nThere is no corresponding rule that turns a sum into the sum of logarithms. In general, \\(\\log(x+y)\\ne\\log x+\\log y\\); the latter equals \\(\\log(xy)\\). Expressions involving sums usually require other methods. A useful exception in form, rather than substance, is\n\n\\[\\ln(x+y)=\\ln x+\\ln(1+y/x),\\]\n\nfor positive \\(x,y\\). This merely factors \\(x+y\\) before applying the product rule.\n\nDomain restrictions also prevent careless rearrangement. The real expression \\(\\ln(x^2)\\) is defined for every nonzero \\(x\\), whereas \\(2\\ln x\\) requires \\(x>0\\). The universally valid real identity is \\(\\ln(x^2)=2\\ln|x|\\). Similarly, taking logarithms of both sides of an equation is an equivalent transformation only where both sides are positive."
    },
    {
      "heading": "Natural, common, and binary logarithms",
      "text": "The most important base in analysis is the number\n\n\\[e=2.718281828\\ldots,\\]\n\nusually called Euler’s number. The logarithm to base \\(e\\) is the natural logarithm, written \\(\\ln x\\), although advanced mathematical texts also commonly write \\(\\log x\\). The natural base is distinguished by differentiation: the derivative of \\(e^x\\) is \\(e^x\\), and the derivative of \\(\\ln x\\) is exactly \\(1/x\\). Other bases introduce a constant factor.\n\nOne way to define the natural logarithm without first defining exponentiation is\n\n\\[\\ln x=\\int_1^x\\frac{dt}{t},\\qquad x>0.\\]\n\nThis integral is negative when \\(0<x<1\\), zero at \\(1\\), and positive when \\(x>1\\). A change of variable proves the product law, and the resulting function is continuous, strictly increasing, and unbounded in both directions. Its inverse defines the natural exponential function. In this construction, \\(e\\) is the unique positive number satisfying \\(\\int_1^e dt/t=1\\).\n\nThe common logarithm has base \\(10\\), written \\(\\log_{10}x\\), and often simply \\(\\log x\\) in elementary science and engineering. It is adapted to decimal positional notation. If\n\n\\[x=m10^k,\\qquad 1\\le m<10,\\]\n\nthen \\(\\log_{10}x=k+\\log_{10}m\\). Thus the integer part of the logarithm identifies the decimal order of magnitude, while the fractional part records the significant digits. Historically, these portions were called the characteristic and mantissa, although “mantissa” now also has other numerical uses. For \\(0<x<1\\), floor-based decomposition requires care because the characteristic is negative while the fractional part remains nonnegative.\n\nThe binary logarithm, \\(\\log_2x\\), is natural in computing and information measurement. Since \\(2^{10}=1024\\), \\(\\log_2 1024=10\\). A positive integer \\(n\\) requires\n\n\\[\\lfloor\\log_2 n\\rfloor+1\\]\n\ndigits in binary notation, while a positive integer requires \\(\\lfloor\\log_{10}n\\rfloor+1\\) decimal digits. These formulas express how a logarithm measures the length of a positional representation rather than the magnitude represented by that string.\n\nNotation is context dependent rather than universal. In analysis, \\(\\log\\) usually means the natural logarithm; in some engineering settings it means the common logarithm; and in some algorithmic discussions it means base \\(2\\). Explicit subscripts eliminate ambiguity. The bases are related by \\(\\log_{10}x=\\ln x/\\ln10\\) and \\(\\log_2x=\\ln x/\\ln2\\), so their mathematical differences are scale differences, not differences in underlying functional behavior."
    },
    {
      "heading": "Differential and integral properties",
      "text": "The derivative of a real logarithm is\n\n\\[\\frac{d}{dx}\\log_b x=\\frac{1}{x\\ln b},\\qquad x>0.\\]\n\nThis follows either from the integral definition of \\(\\ln x\\) or by differentiating \\(b^{\\log_b x}=x\\). The sign of \\(\\ln b\\) determines monotonicity. For the natural logarithm,\n\n\\[(\\ln x)'=\\frac1x,\\qquad (\\ln x)''=-\\frac1{x^2}.\\]\n\nThus \\(\\ln x\\) is strictly increasing and strictly concave. A base between \\(0\\) and \\(1\\) reverses both properties: its logarithm is decreasing and convex.\n\nThe chain rule gives\n\n\\[\\frac{d}{dx}\\ln f(x)=\\frac{f'(x)}{f(x)}\\]\n\nwhere \\(f(x)>0\\). More generally, \\((\\ln|f(x)|)'=f'(x)/f(x)\\) wherever \\(f\\) is differentiable and nonzero. The ratio \\(f'/f\\) is called a logarithmic derivative. It measures instantaneous proportional change: if a population \\(P(t)\\) grows according to \\(P'=rP\\), then \\((\\ln P)'=r\\). Constant proportional growth therefore produces a straight line when the population’s logarithm is plotted against time.\n\nLogarithmic differentiation can simplify products, quotients, and variable powers. For \\(x>0\\), setting \\(y=x^x\\) gives \\(\\ln y=x\\ln x\\), so\n\n\\[y'=x^x(\\ln x+1).\\]\n\nFor a product \\(f=\\prod_{j=1}^n f_j\\) of positive differentiable factors,\n\n\\[\\frac{f'}{f}=\\sum_{j=1}^n\\frac{f_j'}{f_j}.\\]\n\nThis identity is useful in analysis and in optimization problems involving products, though zeros of the factors require separate treatment.\n\nThe basic antiderivative formula is\n\n\\[\\int\\frac{dx}{x}=\\ln|x|+C\\]\n\non any interval not containing zero. Integration by parts also yields\n\n\\[\\int\\ln x\\,dx=x\\ln x-x+C.\\]\n\nAlthough \\(\\ln x\\) diverges to negative infinity as \\(x\\to0^+\\), its improper integral near zero is finite:\n\n\\[\\int_0^1\\ln x\\,dx=-1.\\]\n\nThe distinction illustrates that an unbounded function can still have a convergent improper integral.\n\nConcavity produces important inequalities. The tangent at \\(x=1\\) gives\n\n\\[\\ln x\\le x-1,\\qquad x>0,\\]\n\nwith equality only at \\(x=1\\). More generally, Jensen’s inequality implies\n\n\\[\\ln\\!\\left(\\sum_j w_jx_j\\right)\\ge\\sum_jw_j\\ln x_j\\]\n\nfor positive \\(x_j\\), nonnegative weights \\(w_j\\), and \\(\\sum_jw_j=1\\). Exponentiating yields the weighted arithmetic–geometric mean inequality. Such inequalities underpin results in probability, information theory, and optimization."
    },
    {
      "heading": "Series, local approximations, and integral representations",
      "text": "The central power series for the natural logarithm is\n\n\\[\\ln(1+x)=x-\\frac{x^2}{2}+\\frac{x^3}{3}-\\frac{x^4}{4}+\\cdots.\\]\n\nIt converges for \\(-1<x\\le1\\). Within \\(|x|<1\\), it follows by integrating the geometric series for \\(1/(1+x)\\) term by term. At \\(x=1\\), it gives the alternating harmonic series\n\n\\[\\ln2=1-\\frac12+\\frac13-\\frac14+\\cdots,\\]\n\nwhich converges conditionally. At \\(x=-1\\), the series diverges, consistent with the singularity of \\(\\ln(1+x)\\).\n\nNear zero, the first few terms provide useful approximations:\n\n\\[\\ln(1+x)=x-\\frac{x^2}{2}+O(x^3).\\]\n\nIn particular, \\(\\ln(1+x)\\sim x\\) as \\(x\\to0\\). This justifies interpreting a small change in logarithm as an approximate proportional change. For example, a \\(1\\%\\) increase multiplies a quantity by \\(1.01\\) and changes its natural logarithm by \\(\\ln1.01\\approx0.00995033\\), close to but not exactly \\(0.01\\). For \\(0\\le x\\le1\\), truncating the alternating series gives an error bounded in magnitude by the first omitted term.\n\nAnother useful expansion is\n\n\\[\\ln x=2\\left(z+\\frac{z^3}{3}+\\frac{z^5}{5}+\\cdots\\right), \\qquad z=\\frac{x-1}{x+1}.\\]\n\nFor every positive \\(x\\), \\(|z|<1\\), so this series converges. It is particularly effective when \\(x\\) is near \\(1\\), since then \\(z\\) is small. It follows from subtracting the expansions of \\(\\ln(1-z)\\) and \\(\\ln(1+z)\\). Unlike the alternating series for \\(\\ln(1+x)\\), all displayed terms have the same sign when \\(z>0\\).\n\nLogarithms also admit integral representations beyond their defining area:\n\n\\[\\ln x=\\int_0^\\infty \\left(\\frac1{1+t}-\\frac1{x+t}\\right)\\,dt, \\qquad x>0.\\]\n\nThe difference inside the integral is essential: the two integrals considered separately diverge. Differentiation with respect to \\(x\\) recovers \\(1/x\\), while substitution of \\(x=1\\) fixes the constant. Such formulas connect scalar logarithms with operator functions and integral inequalities.\n\nThe Taylor series about a general positive point \\(a\\) is\n\n\\[\\ln x=\\ln a+ \\sum_{n=1}^\\infty \\frac{(-1)^{n+1}}{n} \\left(\\frac{x-a}{a}\\right)^n, \\qquad |x-a|<a.\\]\n\nIts radius of convergence is limited by the singularity at zero. In complex analysis, this reflects the impossibility of analytically extending one branch of the logarithm across a region containing a complete loop around the origin."
    },
    {
      "heading": "Growth, asymptotics, and logarithmic equations",
      "text": "A logarithm grows without bound, but more slowly than every positive power of its argument. For each \\(\\alpha>0\\),\n\n\\[\\lim_{x\\to\\infty}\\frac{\\ln x}{x^\\alpha}=0.\\]\n\nMore generally, for fixed positive \\(p,q\\),\n\n\\[(\\ln x)^p=o(x^q).\\]\n\nThese relations establish a major hierarchy of growth rates: iterated logarithms grow more slowly than logarithms, logarithms more slowly than positive powers, and fixed powers more slowly than exponentials. In asymptotic notation, changes of logarithmic base are irrelevant when the base is a fixed number greater than \\(1\\), because they introduce only a constant multiplier.\n\nDespite this slow growth, logarithmic divergence is mathematically significant. The harmonic sums satisfy\n\n\\[\\sum_{k=1}^n\\frac1k=\\ln n+\\gamma+o(1),\\]\n\nwhere \\(\\gamma\\) is the Euler–Mascheroni constant. Thus the harmonic series diverges even though its partial sums grow only logarithmically. Related integral tests give\n\n\\[\\int_e^\\infty\\frac{dx}{x(\\ln x)^p}\\]\n\nas convergent precisely when \\(p>1\\). The substitution \\(u=\\ln x\\) transforms this into an ordinary power integral and demonstrates how logarithmic factors distinguish borderline cases.\n\nLogarithms are central in number theory. The prime number theorem states that the number \\(\\pi(x)\\) of primes not exceeding \\(x\\) satisfies\n\n\\[\\pi(x)\\sim\\frac{x}{\\ln x}.\\]\n\nA more refined classical comparison uses the logarithmic integral, commonly normalized as\n\n\\[\\operatorname{Li}(x)=\\int_2^x\\frac{dt}{\\ln t}.\\]\n\nThe denominator reflects the increasingly sparse distribution of primes. Another important appearance is the logarithmic form of Stirling’s approximation:\n\n\\[\\ln(n!)=n\\ln n-n+\\tfrac12\\ln(2\\pi n)+O(1/n).\\]\n\nThis turns the rapid growth of a factorial into an additive expression.\n\nEquations combining logarithms and ordinary algebra may not have solutions expressible using elementary functions. For example, solving \\(xe^x=a\\) leads to the Lambert W function, defined by \\(W(a)e^{W(a)}=a\\). An equation such as \\(\\ln x=cx\\) can be rearranged to\n\n\\[(-cx)e^{-cx}=-c,\\]\n\ngiving \\(x=-W(-c)/c\\) when \\(c\\ne0\\), subject to branch and domain restrictions. Depending on \\(c\\), there may be no positive real solution, one, or two.\n\nNear zero, logarithms also exhibit characteristic limiting behavior:\n\n\\[\\lim_{x\\to0^+}x^\\alpha|\\ln x|=0\\]\n\nfor every \\(\\alpha>0\\). A power approaching zero dominates the logarithmic divergence. This fact explains the continuous extension \\(x\\ln x\\to0\\) at zero used in entropy formulas and in many improper integrals."
    },
    {
      "heading": "Historical development and calculation tables",
      "text": "Logarithms emerged from the need to simplify the extensive numerical calculations required in astronomy, navigation, and surveying. Their conceptual background included comparisons between arithmetic and geometric progressions: equally spaced exponents correspond to numbers related by repeated multiplication. Transforming products into sums could greatly reduce the labor and error involved in calculations with many digits, especially before mechanical and electronic computing.\n\nThe Scottish mathematician John Napier published Mirifici Logarithmorum Canonis Descriptio in 1614. It presented logarithmic tables and explained their use, particularly for trigonometric calculation. Napier’s original logarithms were based on a kinematic construction involving uniform and proportionally decreasing motions. Their normalization and direction differed from modern natural logarithms, so the claim that Napier simply introduced today’s logarithm to base \\(e\\) is historically misleading. His account of the construction, Mirifici Logarithmorum Canonis Constructio, appeared posthumously in 1619.\n\nThe English mathematician Henry Briggs helped establish decimal logarithms. After discussions with Napier, he developed tables normalized so that the logarithm of \\(1\\) was \\(0\\) and that of \\(10\\) was \\(1\\). Briggs published Logarithmorum Chilias Prima in 1617 and Arithmetica Logarithmica in 1624. The latter gave fourteen-place logarithms for the integers from \\(1\\) to \\(20{,}000\\) and from \\(90{,}000\\) to \\(100{,}000\\). Adriaan Vlacq’s tables of 1628 supplied a continuous ten-place table through \\(100{,}000\\).\n\nThe Swiss instrument maker and mathematician Jost Bürgi independently developed closely related tables, published in 1620. His work illustrates that logarithmic methods arose from a wider numerical culture rather than from a single isolated idea. During the seventeenth century, the connection between logarithms and the area under a rectangular hyperbola emerged through work including that of Grégoire de Saint-Vincent and Alphonse Antonio de Sarasa. Later developments in calculus clarified the special role of the natural logarithm, and Leonhard Euler helped establish the modern relationship among logarithms, exponentials, and complex numbers.\n\nA logarithm table allowed multiplication by looking up two logarithms, adding them, and consulting an inverse table. Powers required multiplication of a logarithm by an exponent; roots required division. Interpolation supplied values between tabulated entries. The slide rule, developed in the seventeenth century, embodied the same principle geometrically: adding distances along logarithmic scales multiplied the represented numbers. Tables and slide rules remained major computational tools until electronic calculators and computers displaced them during the twentieth century."
    },
    {
      "heading": "Numerical computation and floating-point behavior",
      "text": "Modern logarithm implementations generally combine argument reduction with carefully designed approximations. A positive binary floating-point number can be written\n\n\\[x=2^k m,\\]\n\nwhere \\(k\\) is an integer and the significand \\(m\\) lies in a bounded interval, commonly \\([1,2)\\). Then\n\n\\[\\ln x=k\\ln2+\\ln m.\\]\n\nThe difficult part has therefore been reduced from the entire positive real axis to a compact interval. Further subdivision, lookup tables, and polynomial or rational approximations can make the remaining computation both fast and accurate.\n\nNumerical analysis distinguishes approximation error from rounding error. A polynomial may closely approximate \\(\\ln m\\) in exact arithmetic, yet its evaluation in floating-point arithmetic can introduce additional error. Implementations must also handle extremely small and large inputs, subnormal values, and the final combination with \\(k\\ln2\\). High-quality mathematical libraries often split constants into several floating-point pieces to preserve significant bits during these operations. Exact implementation choices depend on the hardware and accuracy requirements.\n\nInputs near \\(1\\) require special attention. For small \\(u\\), evaluating \\(\\ln(1+u)\\) by first forming \\(1+u\\) may lose most of the meaningful digits in \\(u\\), or round the sum to exactly \\(1\\). The standard function log1p(u) computes this quantity accurately without relying on that rounded intermediate sum. Its companion expm1(u) evaluates \\(e^u-1\\) accurately near zero. These functions are important in probability calculations, financial formulas, and algorithms using small relative changes.\n\nThe conditioning of the logarithm also depends on how errors are measured. For \\(f(x)=\\ln x\\), a small absolute perturbation gives\n\n\\[\\Delta f\\approx\\frac{\\Delta x}{x}.\\]\n\nThus a small relative error in \\(x\\) produces an approximately equal absolute error in \\(\\ln x\\). The relative condition number is\n\n\\[\\left|\\frac{xf'(x)}{f(x)}\\right| =\\frac1{|\\ln x|},\\]\n\nwhich becomes large near \\(x=1\\), where the output is close to zero. This is a property of the problem, distinct from the stability of a particular algorithm.\n\nLogarithms improve numerical stability when products would underflow, but exponentiating later can reintroduce range problems. A standard identity is\n\n\\[\\ln\\sum_i e^{a_i} =m+\\ln\\sum_i e^{a_i-m}, \\qquad m=\\max_i a_i.\\]\n\nThe shifted exponentials are at most \\(1\\), preventing overflow. This “log-sum-exp” calculation is widely used in probabilistic models and in evaluating the softmax function. It preserves the exact mathematical value while changing the numerical route used to obtain it."
    },
    {
      "heading": "Logarithmic scales and physical measurements",
      "text": "A logarithmic scale places equal ratios at equal distances. If a plotted coordinate is \\(u=\\log_b x\\), multiplying \\(x\\) by \\(b\\) increases \\(u\\) by one unit. Thus the values \\(1,10,100,1000\\) are equally spaced on a base-\\(10\\) axis. Such scales are useful when values span many orders of magnitude or when relative differences matter more than absolute differences. They require positive plotted quantities unless a different, explicitly defined transformation is used.\n\nOn a semilogarithmic graph, one axis is logarithmic and the other linear. An exponential relationship \\(y=Ae^{kx}\\) becomes\n\n\\[\\ln y=\\ln A+kx,\\]\n\nso it appears as a straight line. On a log–log graph, both axes are logarithmic, and a power law \\(y=Cx^\\alpha\\) becomes\n\n\\[\\ln y=\\ln C+\\alpha\\ln x.\\]\n\nThe slope is the exponent \\(\\alpha\\). A straight-looking segment alone, however, does not establish a power law over all scales; finite ranges, measurement error, and alternative functional forms can produce similar appearances.\n\nThe decibel measures logarithmic ratios. For powers \\(P_1,P_0>0\\), the level difference is\n\n\\[L=10\\log_{10}(P_1/P_0)\\ \\text{dB}.\\]\n\nA tenfold power increase corresponds to \\(10\\) dB, and doubling corresponds to approximately \\(3.0103\\) dB. For amplitude quantities whose powers are proportional to their squares under matching conditions, the corresponding formula is \\(20\\log_{10}(A_1/A_0)\\). The factor \\(20\\) is therefore conditional on the physical relationship between amplitude and power, not a separate universal rule.\n\nThe chemical quantity pH is defined using hydrogen-ion activity:\n\n\\[\\mathrm{pH}=-\\log_{10}a_{\\mathrm{H}^+}.\\]\n\nActivity is dimensionless and accounts for nonideal behavior. Concentration-based formulas are approximations appropriate under specified conditions. A difference of one pH unit corresponds to a tenfold inverse ratio of hydrogen-ion activities. Other logarithmic measurements include astronomical magnitude differences, for which a five-magnitude difference corresponds to a factor of \\(100\\) in flux, and several earthquake magnitude scales.\n\nPhysical logarithms properly act on dimensionless numbers. An expression informally written as \\(\\ln x\\), where \\(x\\) is measured in units, usually means \\(\\ln(x/x_0)\\) for a specified reference quantity \\(x_0\\). Changing that reference adds a constant to the logarithmic value. This is why a level expressed in decibels needs a reference to describe an absolute measurement, whereas a decibel difference can directly express a ratio."
    },
    {
      "heading": "Statistical models, transformations, and relative change",
      "text": "Logarithms are widely used when observations are positive and variation is naturally multiplicative. A model\n\n\\[Y=Ae^{\\beta x}\\varepsilon,\\qquad \\varepsilon>0,\\]\n\nbecomes\n\n\\[\\ln Y=\\ln A+\\beta x+\\ln\\varepsilon.\\]\n\nThe multiplicative error has become additive. This can simplify linear regression, but it changes the statistical model and the quantity being estimated. Least squares on logarithms minimizes squared discrepancies in log space, not squared discrepancies in the original observations.\n\nIf \\(\\ln Y\\) has a normal distribution with mean \\(\\mu\\) and variance \\(\\sigma^2\\), then \\(Y\\) has a lognormal distribution. Its median is \\(e^\\mu\\), whereas its mean is\n\n\\[\\operatorname{E}[Y]=e^{\\mu+\\sigma^2/2}.\\]\n\nConsequently, exponentiating a fitted mean logarithm does not generally recover the mean on the original scale. This distinction follows from the nonlinearity of exponentiation and is important whenever transformed results are converted back to original units.\n\nLogarithmic coefficients have precise proportional interpretations. In a log-linear model \\(\\ln Y=\\alpha+\\beta x\\), increasing \\(x\\) by one unit multiplies the fitted \\(Y\\) by \\(e^\\beta\\), an exact percentage change of \\(100(e^\\beta-1)\\%\\). The approximation \\(100\\beta\\%\\) is accurate only for small \\(|\\beta|\\). In a log–log model\n\n\\[\\ln Y=\\alpha+\\beta\\ln X,\\]\n\nthe coefficient \\(\\beta\\) is an elasticity:\n\n\\[\\beta=\\frac{d\\ln Y}{d\\ln X} =\\frac{X}{Y}\\frac{dY}{dX}.\\]\n\nIt measures a local ratio of proportional changes.\n\nLogarithms also simplify maximum likelihood estimation. For independent observations with likelihood\n\n\\[L(\\theta)=\\prod_{i=1}^n p(x_i\\mid\\theta),\\]\n\nthe log-likelihood is\n\n\\[\\ell(\\theta)=\\sum_{i=1}^n\\ln p(x_i\\mid\\theta).\\]\n\nBecause the logarithm is strictly increasing, maximizing \\(L\\) and maximizing \\(\\ell\\) give the same maximizers wherever the likelihood is positive. The additive form is easier to differentiate and less prone to numerical underflow. Observations assigned probability zero require treatment through extended values or explicit domain restrictions.\n\nZeros and negative observations cannot be directly transformed by a real logarithm. Adding a constant changes ratios and can materially alter model interpretation; it is not an algebraically neutral repair. Another statistical appearance is Benford’s law, under which a decimal leading digit \\(d\\in\\{1,\\ldots,9\\}\\) has probability\n\n\\[\\log_{10}(1+1/d).\\]\n\nThis distribution follows when the fractional part of a quantity’s base-\\(10\\) logarithm is uniform. It describes certain collections of numerical data, not all positive datasets."
    },
    {
      "heading": "Information theory and algorithmic complexity",
      "text": "In information theory, the self-information of an event with probability \\(p>0\\) is\n\n\\[I(p)=-\\log_b p.\\]\n\nThe logarithm makes information additive for independent events: if the joint probability is \\(pq\\), then \\(I(pq)=I(p)+I(q)\\). Less probable events carry more information under this measure. Base \\(2\\) gives bits, base \\(e\\) gives nats, and base \\(10\\) gives decimal information units. A certain event has zero self-information because \\(-\\log_b1=0\\).\n\nFor a discrete random variable with probabilities \\(p_i\\), Shannon entropy is\n\n\\[H(X)=-\\sum_i p_i\\log_b p_i,\\]\n\nwith \\(0\\log0\\) defined by its limiting value \\(0\\). If there are \\(n\\) equally likely possibilities, then \\(H(X)=\\log_b n\\). In base \\(2\\), distinguishing among \\(2^k\\) equally likely outcomes requires \\(k\\) bits of information. Claude Shannon developed this framework in his 1948 work on communication, linking entropy with achievable coding rates.\n\nRelated measures use logarithmic ratios. For discrete probability distributions \\(P\\) and \\(Q\\), the Kullback–Leibler divergence is\n\n\\[D(P\\|Q)=\\sum_i p_i\\ln\\frac{p_i}{q_i},\\]\n\nunder the appropriate support conditions. It is nonnegative but generally asymmetric and therefore is not a distance in the metric sense. Cross-entropy is\n\n\\[H(P,Q)=-\\sum_i p_i\\ln q_i,\\]\n\nand satisfies \\(H(P,Q)=H(P)+D(P\\|Q)\\) when these quantities are finite. These expressions are fundamental in probabilistic modeling and machine learning.\n\nLogarithms also describe algorithms that repeatedly reduce a problem by a constant factor. In binary search, each comparison discards approximately half of a sorted search interval. After \\(k\\) reductions, a problem of size \\(n\\) has size about \\(n/2^k\\); reaching constant size therefore requires \\(k\\) of order \\(\\log_2n\\). Balanced search trees have logarithmic height for the same reason. Algorithms that divide a problem into subproblems at each level can have logarithmically many levels but more than constant work per level, as in the \\(O(n\\log n)\\) complexity of standard merge sort.\n\nInformation counting also proves lower bounds. A comparison between distinct keys has two possible outcomes, so a decision tree of height \\(h\\) distinguishes at most \\(2^h\\) cases. Sorting \\(n\\) distinct items must distinguish \\(n!\\) possible orders, implying a worst-case lower bound of \\(\\log_2(n!)=\\Omega(n\\log n)\\) comparisons. The argument concerns comparison-based sorting; it does not impose the same restriction on algorithms allowed to exploit additional structure in the keys."
    },
    {
      "heading": "Complex logarithms and branch structure",
      "text": "For a nonzero complex number \\(z\\), a logarithm is any complex number \\(w\\) satisfying \\(e^w=z\\). Writing\n\n\\[z=re^{i\\theta},\\qquad r=|z|>0,\\]\n\ngives all solutions:\n\n\\[w=\\ln r+i(\\theta+2\\pi k),\\qquad k\\in\\mathbb Z.\\]\n\nUnlike the real logarithm of a positive number, the unrestricted complex logarithm is therefore multivalued. The ambiguity comes from the periodicity \\(e^{w+2\\pi i}=e^w\\), not from any uncertainty in the definition.\n\nA single-valued choice is called a branch. A common principal-value convention chooses the argument in \\((-\\pi,\\pi]\\), giving\n\n\\[\\operatorname{Log}z=\\ln|z|+i\\operatorname{Arg}z.\\]\n\nThis convention assigns a value to every nonzero number but is discontinuous across the negative real axis. The corresponding analytic principal branch is usually defined on the slit plane\n\n\\[\\mathbb C\\setminus(-\\infty,0],\\]\n\nwith argument in \\((-\\pi,\\pi)\\). On this open domain,\n\n\\[\\frac{d}{dz}\\operatorname{Log}z=\\frac1z.\\]\n\nThe distinction between a pointwise principal value and an analytic branch matters at the cut.\n\nThere is no continuous logarithm on the whole punctured plane \\(\\mathbb C\\setminus\\{0\\}\\). Following a continuously chosen argument around one counterclockwise circuit of the origin increases it by \\(2\\pi\\), although the endpoint in the plane is unchanged. Equivalently,\n\n\\[\\oint_{|z|=1}\\frac{dz}{z}=2\\pi i,\\]\n\nwhereas the integral of a globally defined derivative around a closed curve would vanish. On a simply connected open domain avoiding zero, an analytic logarithm of the coordinate function does exist.\n\nThe familiar product law must be modified for principal values. In general,\n\n\\[\\operatorname{Log}(zw) =\\operatorname{Log}z+\\operatorname{Log}w+2\\pi i k\\]\n\nfor an integer determined by the argument choices. For example, under the principal-value convention, \\(\\operatorname{Log}(-1)=i\\pi\\), while \\(\\operatorname{Log}1=0\\), so the two principal logarithms of \\(-1\\) cannot simply be added to obtain the principal logarithm of their product. With multivalued logarithms, the relation is naturally understood through the full sets of possible values.\n\nComplex powers are defined using logarithms:\n\n\\[z^\\alpha=\\exp(\\alpha\\log z).\\]\n\nThey may therefore be multivalued or branch dependent. Integer powers are independent of the branch; noninteger powers generally are not. Analytic continuation organizes these values on a logarithmic covering surface, where successive turns around zero lead to different sheets. This geometry explains the branch structure of roots, fractional powers, and many other functions in complex analysis."
    },
    {
      "heading": "Matrix logarithms and discrete logarithms",
      "text": "The matrix logarithm extends the inverse-exponential idea to square matrices. A matrix \\(X\\) is a logarithm of \\(A\\) if\n\n\\[e^X=A,\\qquad e^X=\\sum_{k=0}^\\infty\\frac{X^k}{k!}.\\]\n\nEvery exponential matrix is invertible, so a singular matrix has no logarithm. Conversely, every invertible complex square matrix has at least one complex logarithm, though generally not a unique one. Branch choices for scalar eigenvalues and the structure of the matrix govern the possible values.\n\nIf \\(A\\) is diagonalizable, so that \\(A=SDS^{-1}\\), a logarithm can be constructed by choosing logarithms of the nonzero diagonal entries of \\(D\\):\n\n\\[X=S\\,\\operatorname{diag}(\\log\\lambda_1,\\ldots,\\log\\lambda_n)\\,S^{-1}.\\]\n\nMore general matrices require methods that also account for their Jordan structure. If \\(A\\) has no eigenvalues on the nonpositive real axis, it has a unique principal logarithm whose eigenvalues have imaginary parts between \\(-\\pi\\) and \\(\\pi\\). For a real symmetric positive-definite matrix, the principal logarithm is real symmetric and is obtained by applying the real natural logarithm to its positive eigenvalues.\n\nMatrix multiplication is usually noncommutative, so the scalar identity \\(\\log(AB)=\\log A+\\log B\\) does not extend without restrictions. Even when matrices commute, compatible branch choices are necessary. A real invertible matrix need not have a real logarithm: the one-by-one matrix \\([-1]\\) is the simplest example. Matrix logarithms occur in continuous-time models, transformations, and geometry, but additional requirements—such as a logarithm being a valid Markov generator—are not guaranteed merely by the existence of a matrix logarithm.\n\nA discrete logarithm is a different algebraic analogue. In a finite cyclic group generated by \\(g\\), it asks for an integer \\(k\\) such that\n\n\\[g^k=h.\\]\n\nIf \\(g\\) has order \\(n\\), the exponent is determined modulo \\(n\\). For example,\n\n\\[3^4\\equiv13\\pmod{17},\\]\n\nso the discrete logarithm of \\(13\\) to base \\(3\\) modulo \\(17\\) is \\(4\\) modulo \\(16\\), since \\(3\\) generates the multiplicative group of nonzero residues modulo \\(17\\).\n\nUnlike real logarithms, discrete logarithms in large finite groups may be computationally difficult. Their difficulty depends strongly on the group and its representation. Algorithms exploiting finite-field structure differ from generic group algorithms, and elliptic-curve groups have different computational behavior again. Discrete-logarithm problems underlie important cryptographic constructions. They retain the exponent-recovery interpretation of logarithms, but not the order, continuity, differentiation, or concavity of the real logarithmic function."
    }
  ],
  "links": [
    "inverse-function",
    "exponential-function",
    "mathematical-analysis",
    "statistics",
    "computer-science",
    "complex-number",
    "real-number",
    "domain-of-a-function",
    "fundamental-theorem-of-arithmetic",
    "group-theory",
    "isomorphism",
    "e-mathematical-constant",
    "integral",
    "positional-notation",
    "integer",
    "binary-number",
    "derivative",
    "chain-rule",
    "antiderivative",
    "integration-by-parts",
    "jensens-inequality",
    "power-series",
    "geometric-series",
    "taylor-series",
    "big-o-notation",
    "number-theory",
    "prime-number-theorem",
    "factorial",
    "leonhard-euler",
    "numerical-analysis",
    "floating-point-arithmetic",
    "condition-number",
    "numerical-stability",
    "softmax-function",
    "power-law",
    "decibel",
    "ph",
    "linear-regression",
    "normal-distribution",
    "lognormal-distribution",
    "maximum-likelihood-estimation",
    "information-theory",
    "self-information",
    "random-variable",
    "information-entropy",
    "claude-shannon",
    "kullback-leibler-divergence",
    "cross-entropy",
    "binary-search",
    "analytic-continuation",
    "complex-analysis",
    "matrix",
    "positive-definite-matrix"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}