Skip to content

Arccos ​

Arccosine, the inverse of Cos restricted to [0,π][0, \pi].

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaInverse trigonometric functionsMathWorldInverseCosineInverseTrigonometricFunctionsWikidataQ674533nLabinverse trigonometric functionBritannicatopic/arc-sineDLMF4.23.ii.p1FungrimAcos✓Fungrim entry33e034✓718f3a✓b8fdcd✓ec7f2d✓fda800✓Wolfram LanguageArcCos!
Arccos(x)the principal value y∈[0,π]y \in [0, \pi] with cos⁡(y)=x\cos(y) = x.
SageMatharccos(x)SymPyacos(x)mpmathacos(x)Juliaenumeratio_ball(_acos, x)Rustacos(x)
Typed signatures
TypePackageApplies
(complex | quantity) -> numberanalyticreplaces compute-enginealways
(complex | quantity) -> numbercompute-enginealways

Domain: Elementary functions

Details
  • Real-valued only for x∈[−1,1]x \in [-1, 1]; outside that range the result is complex.
  • Co-function with Arcsin: arccos⁡(x)=π/2−arcsin⁡(x)\arccos(x) = \pi/2 - \arcsin(x).
  • Undoes Cos on its principal branch: cos⁡(arccos⁡(x))=x\cos(\arccos(x)) = x for x∈[−1,1]x \in [-1, 1].
  • Differs from Wolfram: past its real domain a rational argument reduces to the exact principal value, on every inverse trigonometric and hyperbolic head alike (Arcsin, Arccos, Arcsec, Arccsc, Arcosh, Artanh, Arcoth, Arsech); Wolfram leaves the exact call unevaluated and gives the same number from N[...]. Checked against mpmath and wolframscript on a grid of rationals to double precision. A float and N(...) already took the same branch. Compiled code is separate: the JavaScript target is real-valued (NaN past the domain), the WGSL target returns a complex pair, and Arcsin and Arccos decline to compile. Principal branch, same cuts as Arcsin: for x>1x>1, arccos⁡(x)=iln⁡(x+x2−1)\arccos(x) = i\ln(x+\sqrt{x^2-1}) (mpmath acos(2) is 1.317i1.317i), and for x<−1x<-1, π−iln⁡(∣x∣+x2−1)\pi - i\ln(|x|+\sqrt{x^2-1}).

Examples

1 more kept as data, checked against the oracles
Basic #
live ↗
Inarccos⁡(1)\arccos(1)Out00
live ↗
Inarccos⁡(12)\arccos(\frac{1}{2})Outπ3\frac{π}{3}
live ↗
Inarccos⁡(0)\arccos(0)Outπ2\frac{π}{2}

The top of the principal range

live ↗
Inarccos⁡(−1)\arccos(-1)Outππ

A machine-precision argument evaluates numerically

live ↗
Inarccos⁡(0.4)\arccos(0.4)Out1.159 279 480 727 408 599 851.159\,279\,480\,727\,408\,599\,85

Outside [−1,1][-1, 1] the value is purely imaginary

live ↗
Inarccos⁡(1.5)\arccos(1.5)Out0.962 423 650 119 206 9i0.962\,423\,650\,119\,206\,9i
Scope #

Arbitrary precision via N(...)

live ↗
InN(arccos⁡(13))N(\arccos(\frac{1}{3}))Out1.230 959 417 340 774 682 141.230\,959\,417\,340\,774\,682\,14

Evaluates at a complex argument

live ↗
Inarccos⁡(2.5+i)\arccos(2.5+i)Out0.406 172 816 505 511 85−1.658 693 298 856 434 7i0.406\,172\,816\,505\,511\,85-1.658\,693\,298\,856\,434\,7i

Threads element-wise over a matrix

live ↗
Inarccos⁡([[1,121/2],[0,121/2]])\arccos(\bigl\lbrack\bigl\lbrack1, \frac{1}{2^{1/2}}\bigr\rbrack, \bigl\lbrack0, \frac{1}{2^{1/2}}\bigr\rbrack\bigr\rbrack)Out[[0,π4],[π2,π4]]\bigl\lbrack\bigl\lbrack0, \frac{π}{4}\bigr\rbrack, \bigl\lbrack\frac{π}{2}, \frac{π}{4}\bigr\rbrack\bigr\rbrack

Exact inverse of a special value

live ↗
Inarccos⁡(32)\arccos(\frac{\sqrt{3}}{2})Outπ6\frac{π}{6}
live ↗
Inarccos⁡(−22)\arccos(-\frac{\sqrt{2}}{2})Out3π4\frac{3π}{4}

Recognizes cos⁡(π/5)=1+54\cos(\pi/5) = \frac{1 + \sqrt5}{4}

live ↗
Inarccos⁡(1+54)\arccos(\frac{1+\sqrt{5}}{4})Outπ5\frac{π}{5}

Interval arithmetic: decreasing, so arccos⁡[13,12]=[π3,arccos⁡13]\arccos[\tfrac13, \tfrac12] = [\tfrac{\pi}{3}, \arccos\tfrac13]

live ↗
Inarccos⁡(Interval(13,12))\arccos(\mathrm{Interval}(\frac{1}{3}, \frac{1}{2}))OutInterval(π3,arccos⁡(13))\mathrm{Interval}(\frac{π}{3}, \arccos(\frac{1}{3}))

Uncertainty propagation: arccos⁡(0.9±0.1)≈0.451±0.229\arccos(0.9 \pm 0.1) \approx 0.451 \pm 0.229

live ↗
Inarccos⁡(Around(0.9,0.1))\arccos(\mathrm{Around}(0.9, 0.1))OutAround(0.451 026 811 796 262 36,0.229 415 733 870 561 8)\mathrm{Around}(0.451\,026\,811\,796\,262\,36, 0.229\,415\,733\,870\,561\,8)

Derivative: −11−x2-\frac{1}{\sqrt{1 - x^2}}

live ↗
Indarccos⁡(x)dx\frac{\mathrm{d}\arccos(x)}{\mathrm{d}x}Out−11−x2-\frac{1}{\sqrt{1-x^2}}

Antiderivative

live ↗
In∫ ⁣arccos⁡(x) dx\int\!\arccos(x)\, \mathrm{d}xOutxarccos⁡(x)−1−x2x\arccos(x)-\sqrt{1-x^2}

Not simply 4: 44 is outside the principal range [0,π][0, \pi], so arccos⁡(cos⁡4)=2π−4\arccos(\cos 4) = 2\pi - 4

live ↗
Inarccos⁡(cos⁡(4))\arccos(\cos(4))Out2π−42π-4

Arccos(+Infinity) is a directed infinity along the positive imaginary axis: arccos⁡=π/2−arcsin⁡\arccos = \pi/2 - \arcsin

live ↗

Known value · DLMF 4.23.22

Arccos(-Infinity) is the opposite directed infinity

live ↗

Known value · DLMF 4.23.22

Fifty digits of an algebraic argument

live ↗
InN(arccos⁡(13),50)N(\arccos(\frac{1}{3}), 50)Out1.230 959 417 340 774 682 134 929 178 247 987 375 710 340 009 355 11.230\,959\,417\,340\,774\,682\,134\,929\,178\,247\,987\,375\,710\,340\,009\,355\,1

The integral of arccos⁡\arccos over [−1,1][-1,1] is exactly π\pi

live ↗
In∫−11 ⁣arccos⁡(x) dx\int_{-1}^{1}\!\arccos(x)\, \mathrm{d}xOutππ

Past [−1,1][-1, 1] the same reduction as Arcsin: arccos⁡(2)=iln⁡(2+3)\arccos(2) = i\ln(2+\sqrt3), the co-function π2−arcsin⁡(2)\frac{\pi}{2} - \arcsin(2)

live ↗
Inarccos⁡(2)\arccos(2)Outiln⁡(2+3)i\ln(2+\sqrt{3})

The mirror past −1-1: arccos⁡(−2)=π−iln⁡(2+3)\arccos(-2) = \pi - i\ln(2+\sqrt3)

live ↗
Inarccos⁡(−2)\arccos(-2)Outπ−iln⁡(2+3)π-i\ln(2+\sqrt{3})
Properties #

cos⁡(arccos⁡(x))=x\cos(\arccos(x)) = x on the principal branch

live ↗
Incos⁡(arccos⁡(12))=12\cos(\arccos(\frac{1}{2}))=\frac{1}{2}OutTrue\mathrm{True}

Reflection: arccos⁡(−x)=π−arccos⁡x\arccos(-x) = \pi - \arccos x

live ↗
Inarccos⁡(−x)\arccos(-x)Outπ−arccos⁡(x)π-\arccos(x)

A nested radical that lands on 5π/125\pi/12

live ↗
Inarccos⁡(142(3−1))\arccos(\frac{1}{4}\sqrt{2}(\sqrt{3}-1))Out5π12\frac{5π}{12}

Known value · Wolfram MathematicalFunctionData, ArcCos

Negating the argument gives π\pi minus the previous angle

live ↗
Inarccos⁡(−24(3−1))\arccos(-\frac{\sqrt{2}}{4}(\sqrt{3}-1))Out7π12\frac{7π}{12}

Known value · Wolfram MathematicalFunctionData, ArcCos

The golden-ratio cosine gives 2π/52\pi/5

live ↗
Inarccos⁡(5−14)\arccos(\frac{\sqrt{5}-1}{4})Out2π5\frac{2π}{5}

Known value · Wolfram MathematicalFunctionData, ArcCos

Negative golden-ratio cosine gives 3π/53\pi/5

live ↗
Inarccos⁡(1−54)\arccos(\frac{1-\sqrt{5}}{4})Out3π5\frac{3π}{5}

Known value · Wolfram MathematicalFunctionData, ArcCos

A nested radical for cos⁡(3π/8)\cos(3\pi/8)

live ↗
Inarccos⁡(2−21/22)\arccos(\frac{\sqrt{2-2^{1/2}}}{2})Out3π8\frac{3π}{8}

Known value · Wolfram MathematicalFunctionData, ArcCos

Negation reflects it to 5π/85\pi/8

live ↗
Inarccos⁡(−2−21/22)\arccos(-\frac{\sqrt{2-2^{1/2}}}{2})Out5π8\frac{5π}{8}

Known value · Wolfram MathematicalFunctionData, ArcCos

cos⁡(2π/3)=−12\cos(2\pi/3) = -\frac12

live ↗
Inarccos⁡(−12)\arccos(-\frac{1}{2})Out2π3\frac{2π}{3}

Known value · Wolfram MathematicalFunctionData, ArcCos

The nested radical is cos⁡(3π/10)\cos(3\pi/10)

live ↗
Inarccos⁡(125−51/22)\arccos(\frac{1}{2}\sqrt{\frac{5-5^{1/2}}{2}})Out3π10\frac{3π}{10}

Known value · Wolfram MathematicalFunctionData, ArcCos

Its negative is cos⁡(7π/10)\cos(7\pi/10)

live ↗
Inarccos⁡(−125−51/22)\arccos(-\frac{1}{2}\sqrt{\frac{5-5^{1/2}}{2}})Out7π10\frac{7π}{10}

Known value · Wolfram MathematicalFunctionData, ArcCos

cos⁡(π/4)=22\cos(\pi/4) = \frac{\sqrt2}{2}

live ↗
Inarccos⁡(22)\arccos(\frac{\sqrt{2}}{2})Outπ4\frac{π}{4}

Known value · Wolfram MathematicalFunctionData, ArcCos

Cosine of 4π/54\pi/5 is a negative golden-ratio value

live ↗
Inarccos⁡(−51/2−14)\arccos(\frac{-5^{1/2}-1}{4})Out4π5\frac{4π}{5}

Known value · Wolfram MathematicalFunctionData, ArcCos

cos⁡(5π/6)=−32\cos(5\pi/6) = -\frac{\sqrt3}{2}

live ↗
Inarccos⁡(−32)\arccos(-\frac{\sqrt{3}}{2})Out5π6\frac{5π}{6}

Known value · Wolfram MathematicalFunctionData, ArcCos

A nested radical for cos⁡(π/8)\cos(\pi/8)

live ↗
Inarccos⁡(2+22)\arccos(\frac{\sqrt{2+\sqrt{2}}}{2})Outπ8\frac{π}{8}

Known value · Wolfram MathematicalFunctionData, ArcCos

Possible issues #

Arccos(ComplexInfinity) is ComplexInfinity, unbounded in every direction as Arcsin is

live ↗

Known value · DLMF 4.23.22

About
Examples40
Checked againstWolfram Language 37 agree3 differSageMath 34 agree2 differ2 errorSymPy 35 agree4 differmpmath 31 agree2 differJulia 30 agree2 errorRust 27 agree3 error
CrosswalkWikipediaMathWorld ×2WikidatanLabBritannicaDLMFFungrimFungrim entry ×5Wolfram LanguageSageMathSymPympmathJuliaRust

Implementation

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

See also: Cos, Arcsin, Arctan