Skip to content

Ln ​

The natural logarithm, the inverse of Exp.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaNatural logarithmMathWorldNaturalLogarithmWikidataQ204037Britannicatopic/natural-logarithmDLMF4.2.E2FungrimLog!Fungrim entryWolfram LanguageLog✓
Ln(x)the natural logarithm of x, base ee.
SageMathlog(x)✓SymPylog(x)mpmathlog(x)Juliaenumeratio_ball(log, x)Rustln(x)
Typed signatures
TypePackageApplies
(complex | infinity, base: (complex | infinity)?) -> complex | infinityanalyticreplaces compute-enginealways
(complex | infinity, base: (complex | infinity)?) -> complex | infinitycompute-enginealways

Domain: Elementary functions

Details
  • Inverse of Exp: ln⁡(ex)=x\ln(e^x) = x.
  • The natural logarithm. Note compute-engine's own Log is not a synonym: it defaults to base 10 (see that entry).
  • ln⁡(0)=−∞\ln(0) = -\infty. A negative real argument reduces to the principal value ln⁡(−q)=ln⁡(q)+iπ\ln(-q) = \ln(q) + i\pi for a positive rational qq (@enumeratio/analytic); compute-engine's own plain evaluation would otherwise leave it symbolic.

Plot

ComplexPlot
real slice

Examples

5 more kept as data, checked against the oracles
Basic #
live ↗
Inln⁡(1)\ln(1)Out00
live ↗
Inln⁡(e)\ln(e)Out11
live ↗
Inln⁡(0)\ln(0)Out−∞-∞

A machine-precision argument evaluates numerically

live ↗
Inln⁡(1.5)\ln(1.5)Out0.405 465 108 108 164 381 9780.405\,465\,108\,108\,164\,381\,978
live ↗
InSeries⁡(ln⁡(x+1),x,0,10)\operatorname{Series}(\ln(x+1), x, 0, 10)Outx−x22+x33−x44+x55−x66+x77−x88+x99−x1010+O(x11)x-\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}+\frac{x^5}{5}-\frac{x^6}{6}+\frac{x^7}{7}-\frac{x^8}{8}+\frac{x^9}{9}-\frac{x^{10}}{10}+O\left(x^{11}\right)
Scope #

Ln(−1)=iπ\mathrm{Ln}(-1) = i\pi, the principal value past the branch cut, overriding compute-engine's plain policy of leaving a negative-real Ln symbolic

live ↗
Inln⁡(−1)\ln(-1)Outiπi π

N(...) for a decimal value

live ↗
InN(ln⁡(1 000))N(\ln(1\,000))Out6.907 755 278 982 137 052 056.907\,755\,278\,982\,137\,052\,05

Arbitrary precision via N(...)

live ↗
InN(ln⁡(52))N(\ln(\frac{5}{2}))Out0.916 290 731 874 155 065 1840.916\,290\,731\,874\,155\,065\,184

Evaluates at a complex argument

live ↗
Inln⁡(2.5+i)\ln(2.5+i)Out0.990 500 734 433 291 704 176+0.380 506 377 112 364 9i0.990\,500\,734\,433\,291\,704\,176+0.380\,506\,377\,112\,364\,9i

A negative float gives the principal complex value

live ↗
Inln⁡(−2.5)\ln(-2.5)Out0.916 290 731 874 155 065 184+3.141 592 653 589 793i0.916\,290\,731\,874\,155\,065\,184+3.141\,592\,653\,589\,793i

Threads element-wise over a list

live ↗
Inln⁡([1,2.1,3.1,4.1])\ln(\bigl\lbrack1, 2.1, 3.1, 4.1\bigr\rbrack)Out[0,0.741 937 344 729 377 312 483,1.131 402 111 491 100 561 91,1.410 986 973 710 262 119 85]\bigl\lbrack0, 0.741\,937\,344\,729\,377\,312\,483, 1.131\,402\,111\,491\,100\,561\,91, 1.410\,986\,973\,710\,262\,119\,85\bigr\rbrack

An integer power is pulled out: ln⁡1000=3ln⁡10\ln 1000 = 3\ln 10

live ↗
Inln⁡(1 000)\ln(1\,000)Out3ln⁡(10)3\ln(10)
live ↗
Inln⁡(e3)\ln(e^3)Out33
live ↗
Inln⁡(∞)\ln(∞)Out∞∞

∣ln⁡z∣→∞|\ln z| \to \infty and its real part goes to +∞+\infty: ln⁡(∞~)=+∞\ln(\tilde\infty) = +\infty

live ↗
Inln⁡(∞~)\ln(\tilde∞)Out∞∞

ln⁡i=iπ/2\ln i = i\pi/2 exactly

live ↗
Inln⁡(i)\ln(i)Out12iπ\frac{1}{2}i π

A unit fraction becomes a negated logarithm: ln⁡12=−ln⁡2\ln\tfrac12 = -\ln 2

live ↗
Inln⁡(12)\ln(\frac{1}{2})Out−ln⁡(2)-\ln(2)

Interval arithmetic: ln⁡\ln is increasing, so ln⁡[13,e]\ln[\tfrac13, e] is the interval of the endpoint values -- ln⁡(1/3)\ln(1/3) folds to −ln⁡3-\ln 3 (see the unit-fraction example above)

live ↗
Inln⁡(Interval(13,e))\ln(\mathrm{Interval}(\frac{1}{3}, e))OutInterval(−ln⁡(3),1)\mathrm{Interval}(-\ln(3), 1)

Uncertainty propagation: ln⁡(2±0.01)≈0.693±0.005\ln(2 \pm 0.01) \approx 0.693 \pm 0.005

live ↗
Inln⁡(Around(2,0.01))\ln(\mathrm{Around}(2, 0.01))OutAround(0.693 147 180 559 945 3,0.005)\mathrm{Around}(0.693\,147\,180\,559\,945\,3, 0.005)
live ↗
Inln⁡(ex)\ln(e^{x})Outxx

Derivative: 1/x1/x

live ↗
Indln⁡(x)dx\frac{\mathrm{d}\ln(x)}{\mathrm{d}x}Out1x\frac{1}{x}

Antiderivative: xln⁡x−xx\ln x - x

live ↗
In∫ ⁣ln⁡(x) dx\int\!\ln(x)\, \mathrm{d}xOutxln⁡(x)−xx\ln(x)-x

Mercator series for ln⁡(1+x)\ln(1 + x)

live ↗
InSeries⁡(ln⁡(1+x),x,0,4)\operatorname{Series}(\ln(1+x), x, 0, 4)Outx−x22+x33−x44+O(x5)x-\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}+O\left(x^5\right)

To 40 significant digits, every one correctly rounded

live ↗
InN(ln⁡(2),40)N(\ln(2), 40)Out0.693 147 180 559 945 309 417 232 121 458 176 568 075 50.693\,147\,180\,559\,945\,309\,417\,232\,121\,458\,176\,568\,075\,5

ln⁡(−12)=iπ−ln⁡2\ln(-\tfrac12) = i\pi - \ln 2 — a negative rational, folded through the unit-fraction rule too.

live ↗
Inln⁡(−12)\ln(-\frac{1}{2})Outiπ−ln⁡(2)i π-\ln(2)

N(...) decimalizes ln⁡(i)\ln(i), not just the exact iπ/2i\pi/2 form

live ↗
InN(ln⁡(i))N(\ln(i))Out1.570 796 326 794 896 6i1.570\,796\,326\,794\,896\,6i

Ln(-Infinity) is +Infinity: ln⁡(−x)=ln⁡(x)+iπ\ln(-x) = \ln(x) + i\pi, and the magnitude alone diverges as x→+∞x \to +\infty

live ↗
Inln⁡(−∞)\ln(-∞)Out∞∞

Known value · DLMF 4.2.5

A 50-digit value of ln⁡52\ln\frac52

live ↗
InN(ln⁡(52),50)N(\ln(\frac{5}{2}), 50)Out0.916 290 731 874 155 065 183 527 211 768 011 071 450 101 219 908 260.916\,290\,731\,874\,155\,065\,183\,527\,211\,768\,011\,071\,450\,101\,219\,908\,26

The domain is the positive reals

live ↗
InFunctionDomain(ln⁡(x),x)\mathrm{FunctionDomain}(\ln(x), x)Out0<x0\lt x

The range is all of the reals

live ↗
InFunctionRange(ln⁡(x),x,y)\mathrm{FunctionRange}(\ln(x), x, y)OutTrue\mathrm{True}

The logarithm is not analytic on the whole real line

live ↗
InFunctionAnalytic(ln⁡(x),x)\mathrm{FunctionAnalytic}(\ln(x), x)OutFalse\mathrm{False}

Not meromorphic either

live ↗
InFunctionMeromorphic(ln⁡(x),x)\mathrm{FunctionMeromorphic}(\ln(x), x)OutFalse\mathrm{False}

Strictly increasing, so one-to-one

live ↗
InFunctionInjective(ln⁡(x),x)\mathrm{FunctionInjective}(\ln(x), x)OutTrue\mathrm{True}

Onto the real line

live ↗
InFunctionSurjective(ln⁡(x),x)\mathrm{FunctionSurjective}(\ln(x), x)OutTrue\mathrm{True}

Derivative 1z\frac1z

live ↗
Indln⁡(z)dz\frac{\mathrm{d}\ln(z)}{\mathrm{d}z}Out1z\frac{1}{z}

Chain rule: ddxln⁡ln⁡x=1xln⁡x\frac{d}{dx}\ln\ln x = \frac{1}{x\ln x}

live ↗
Indln⁡(ln⁡(x))dx\frac{\mathrm{d}\ln(\ln(x))}{\mathrm{d}x}Out1xln⁡(x)\frac{1}{x\ln(x)}

Ln undoes the exponential: ln⁡en=n\ln e^n = n

live ↗
Inln⁡(en)\ln(e^{n})Outnn
live ↗
InSeries⁡(ln⁡(x),x,1,4)\operatorname{Series}(\ln(x), x, 1, 4)Out−1+x−(x−1)22+(x−1)33−(x−1)44+O((x−1)5)-1+x-\frac{(x-1)^2}{2}+\frac{(x-1)^3}{3}-\frac{(x-1)^4}{4}+O\left((x-1)^5\right)
live ↗
InSeries⁡(ln⁡(x),x,−2,3)\operatorname{Series}(\ln(x), x, -2, 3)Outiπ+ln⁡(2)−x+22−(x+2)28−(x+2)324+O((x+2)4)i π+\ln(2)-\frac{x+2}{2}-\frac{(x+2)^2}{8}-\frac{(x+2)^3}{24}+O\left((x+2)^4\right)
Properties #

Inverse of Exp: ln⁡(ex)=x\ln(e^x) = x

live ↗
Inln⁡(e5)=5\ln(e^5)=5OutTrue\mathrm{True}

Product rule: ln⁡(ab)=ln⁡a+ln⁡b\ln(ab) = \ln a + \ln b

live ↗
Inln⁡(2)+ln⁡(3)=ln⁡(6)\ln(2)+\ln(3)=\ln(6)OutTrue\mathrm{True}

PowerExpand splits a logarithm of a product, assuming positive factors

live ↗
InPowerExpand(ln⁡(xy))\mathrm{PowerExpand}(\ln(xy))Outln⁡(x)+ln⁡(y)\ln(x)+\ln(y)
live ↗
InN(ln⁡(2)2)N(\ln(2)^2)Out0.480 453 013 918 201 424 6670.480\,453\,013\,918\,201\,424\,667

Known value · Wolfram MathematicalFunctionData, Log:Natural, Bailey-Borwein-Plouffe formula

live ↗
InN(ln⁡(2)3)N(\ln(2)^3)Out0.333 024 651 988 929 479 7190.333\,024\,651\,988\,929\,479\,719

Known value · Wolfram MathematicalFunctionData, Log:Natural, Bailey-Borwein-Plouffe formula

live ↗
InN(ln⁡(2)4)N(\ln(2)^4)Out0.230 835 098 583 083 451 8870.230\,835\,098\,583\,083\,451\,887

Known value · Wolfram MathematicalFunctionData, Log:Natural, Bailey-Borwein-Plouffe formula

live ↗
InN(ln⁡(2)5)N(\ln(2)^5)Out0.160 002 697 757 141 321 0810.160\,002\,697\,757\,141\,321\,081

Known value · Wolfram MathematicalFunctionData, Log:Natural, Bailey-Borwein-Plouffe formula

live ↗
InN(ln⁡(2)2)N(\ln(2)^2)Out0.480 453 013 918 201 424 6670.480\,453\,013\,918\,201\,424\,667

Known value · Wolfram MathematicalFunctionData, Log:Natural, Bailey-Borwein-Plouffe formula

live ↗
InN(ln⁡(2)3)N(\ln(2)^3)Out0.333 024 651 988 929 479 7190.333\,024\,651\,988\,929\,479\,719

Known value · Wolfram MathematicalFunctionData, Log:Natural, Bailey-Borwein-Plouffe formula

live ↗
InN(ln⁡(2)4)N(\ln(2)^4)Out0.230 835 098 583 083 451 8870.230\,835\,098\,583\,083\,451\,887

Known value · Wolfram MathematicalFunctionData, Log:Natural, Bailey-Borwein-Plouffe formula

live ↗
InN(ln⁡(2)5)N(\ln(2)^5)Out0.160 002 697 757 141 321 0810.160\,002\,697\,757\,141\,321\,081

Known value · Wolfram MathematicalFunctionData, Log:Natural, Bailey-Borwein-Plouffe formula

live ↗
InN(∫12 ⁣ln⁡(t)2t−1 dt)N(\int_{1}^{2}\!\frac{\ln(t)^2}{t-1}\, \mathrm{d}t)Out0.30051422578989856±1.1233763348977733e−200.30051422578989856±1.1233763348977733e-20

Known value · Wolfram MathematicalFunctionData, Log:Natural, Nielsen‐Ramanujan constants

live ↗
InN(∫0∞ ⁣ln⁡(t)2et dt)N(\int_{0}^{∞}\!\frac{\ln(t)^2}{e^{t}}\, \mathrm{d}t)Out1.978111990655945±4.2166270475263445e−131.978111990655945±4.2166270475263445e-13

Known value · Wolfram MathematicalFunctionData, Log:Natural, Euler-Mascheroni integral

live ↗
InN(∫01∫01 ⁣ln⁡(xy)1−xy dxdy)N(\int_{0}^{1}\int_{0}^{1}\!\frac{\ln(xy)}{1-xy}\, \mathrm{d}x \mathrm{d}y)Out−2.4041138063191885±6.4377781180246115e−12-2.4041138063191885±6.4377781180246115e-12

Known value · Wolfram MathematicalFunctionData, Log:Natural, Beukers's formula

live ↗
InN(∫12 ⁣ln⁡(t)3t−1 dt)N(\int_{1}^{2}\!\frac{\ln(t)^3}{t-1}\, \mathrm{d}t)Out0.14251419793571093±1.4339268116254447e−210.14251419793571093±1.4339268116254447e-21

Known value · Wolfram MathematicalFunctionData, Log:Natural, Nielsen‐Ramanujan constants

About
Examples59
Checked againstWolfram Language 59 agreeSageMath 48 agree2 errorSymPy 46 agree2 differ3 unevaluatedmpmath 33 agree1 differJulia 32 agree3 errorRust 21 agree9 error
CrosswalkWikipediaMathWorldWikidataBritannicaDLMFFungrimFungrim entry ×93Wolfram LanguageSageMathSymPympmathJuliaRust

Implementation

mappedsympypackages/oracle/src/mappings.ts
mappedmpmathpackages/oracle/src/mappings.ts
mappedsagepackages/oracle/src/mappings.ts
mappedrustpackages/oracle/src/mappings.ts
mappedjuliapackages/oracle/src/mappings.ts

See also: Exp, Log, Log2