Skip to content

Arcsec ​

Arcsecant, the inverse of Sec.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageArcSec✓
Arcsec(x)the value yy with sec⁡(y)=x\sec(y) = x.
SageMatharcsec(x)SymPyasec(x)mpmathasec(x)Juliaenumeratio_ball(_asec, x)Rustacos(n(1) / x)
Typed signatures
TypePackageApplies
(complex | infinity | quantity) -> numberanalyticreplaces compute-enginealways
(complex | infinity | quantity) -> numbercompute-enginealways

Domain: Elementary functions

Details
  • 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. For 0<∣x∣<10<|x|<1, arcsec⁡(x)=arccos⁡(1/x)\operatorname{arcsec}(x) = \arccos(1/x), so arcsec⁡(1/2)=iln⁡(2+3)\operatorname{arcsec}(1/2) = i\ln(2+\sqrt3) (mpmath asec(0.5)).

Examples

Basic #
live ↗
Inarcsec(1)\mathrm{arcsec}(1)Out00
live ↗
Inarcsec(2)\mathrm{arcsec}(2)Outπ3\frac{π}{3}
Scope #

arcsec⁡2=π/4\operatorname{arcsec}\sqrt2 = \pi/4

live ↗
Inarcsec(2)\mathrm{arcsec}(\sqrt{2})Outπ4\frac{π}{4}
live ↗
Inarcsec(−1)\mathrm{arcsec}(-1)Outππ

arcsec⁡(−2)=2π/3\operatorname{arcsec}(-2) = 2\pi/3

live ↗
Inarcsec(−2)\mathrm{arcsec}(-2)Out2π3\frac{2π}{3}

Inside (−1,1)(-1, 1) the value is purely imaginary

live ↗
Inarcsec(0.5)\mathrm{arcsec}(0.5)Out1.316 957 896 924 816 6i1.316\,957\,896\,924\,816\,6i
live ↗
Inarcsec(∞)\mathrm{arcsec}(∞)Outπ2\frac{π}{2}

A pole: arcsec⁡0\operatorname{arcsec} 0 is complex infinity

live ↗
Inarcsec(0)\mathrm{arcsec}(0)Out∞~\tilde∞

Derivative, for real ∣x∣>1|x| > 1

live ↗
Indarcsec(x)dx\frac{\mathrm{d}\mathrm{arcsec}(x)}{\mathrm{d}x}Out1∣x∣x2−1\frac{1}{\vert x\vert\sqrt{x^2-1}}

Fifty digits of an inverse secant

live ↗
InN(arcsec(5),50)N(\mathrm{arcsec}(5), 50)Out1.369 438 406 004 565 827 776 196 139 422 128 031 858 546 618 285 31.369\,438\,406\,004\,565\,827\,776\,196\,139\,422\,128\,031\,858\,546\,618\,285\,3

Threads over a matrix; zero gives complex infinity

live ↗
Inarcsec([[2,−21/2],[0,−21/2]])\mathrm{arcsec}(\bigl\lbrack\bigl\lbrack\sqrt{2}, -2^{1/2}\bigr\rbrack, \bigl\lbrack0, -2^{1/2}\bigr\rbrack\bigr\rbrack)Out[[π4,3π4],[∞~,3π4]]\bigl\lbrack\bigl\lbrack\frac{π}{4}, \frac{3π}{4}\bigr\rbrack, \bigl\lbrack\tilde∞, \frac{3π}{4}\bigr\rbrack\bigr\rbrack

sec⁡(π/6)=23\sec(\pi/6) = \frac{2}{\sqrt3}

live ↗
Inarcsec(233)\mathrm{arcsec}(\frac{2\sqrt{3}}{3})Outπ6\frac{π}{6}

At complex infinity 1/z→01/z \to 0, so the value is π/2\pi/2

live ↗
Inarcsec(∞~)\mathrm{arcsec}(\tilde∞)Outπ2\frac{π}{2}

As a matrix function the zero entry becomes 0, unlike entrywise

live ↗
InMatrixFunction(_1⁡↦arcsec(_1⁡),[[2,−21/2],[0,−21/2]])\mathrm{MatrixFunction}(\operatorname{\_1}↦\mathrm{arcsec}(\operatorname{\_1}), \bigl\lbrack\bigl\lbrack\sqrt{2}, -2^{1/2}\bigr\rbrack, \bigl\lbrack0, -2^{1/2}\bigr\rbrack\bigr\rbrack)Out[[π4,π4],[0,3π4]]\bigl\lbrack\bigl\lbrack\frac{π}{4}, \frac{π}{4}\bigr\rbrack, \bigl\lbrack0, \frac{3π}{4}\bigr\rbrack\bigr\rbrack

For 0<∣x∣<10<|x|<1 the value is arccos⁡(1/x)\arccos(1/x): arcsec⁡(1/2)=iln⁡(2+3)\operatorname{arcsec}(1/2) = i\ln(2+\sqrt3)

live ↗
Inarcsec(12)\mathrm{arcsec}(\frac{1}{2})Outiln⁡(2+3)i\ln(2+\sqrt{3})

And arcsec⁡(−1/2)=π−iln⁡(2+3)\operatorname{arcsec}(-1/2) = \pi - i\ln(2+\sqrt3)

live ↗
Inarcsec(−12)\mathrm{arcsec}(-\frac{1}{2})Outπ−iln⁡(2+3)π-i\ln(2+\sqrt{3})
Properties #

Undoes Sec: sec⁡(arcsec(x))=x\sec(\text{arcsec}(x)) = x

live ↗
Insec⁡(arcsec(2))=2\sec(\mathrm{arcsec}(2))=2OutTrue\mathrm{True}

A difference of radicals giving π/12\pi/12

live ↗
Inarcsec(6−2)\mathrm{arcsec}(\sqrt{6}-\sqrt{2})Outπ12\frac{π}{12}

Known value · Wolfram MathematicalFunctionData, ArcSec

Swapping the terms gives 11π/1211\pi/12

live ↗
Inarcsec(2−6)\mathrm{arcsec}(\sqrt{2}-\sqrt{6})Out11π12\frac{11π}{12}

Known value · Wolfram MathematicalFunctionData, ArcSec

Stays unevaluated; the radical is not matched to a multiple of π\pi

live ↗
Inarcsec(212+2)\mathrm{arcsec}(2\sqrt{\frac{1}{2+\sqrt{2}}})Outarcsec(22+2)\mathrm{arcsec}(\frac{2}{\sqrt{2+\sqrt{2}}})

Known value · Wolfram MathematicalFunctionData, ArcSec

The negated argument stays unevaluated too

live ↗
Inarcsec(−212+2)\mathrm{arcsec}(-2\sqrt{\frac{1}{2+\sqrt{2}}})Outarcsec(−22+2)\mathrm{arcsec}(-\frac{2}{\sqrt{2+\sqrt{2}}})

Known value · Wolfram MathematicalFunctionData, ArcSec

Negative argument lands in (π/2,π](\pi/2, \pi], giving 5π/65\pi/6

live ↗
Inarcsec(−233)\mathrm{arcsec}(-\frac{2\sqrt{3}}{3})Out5π6\frac{5π}{6}

Known value · Wolfram MathematicalFunctionData, ArcSec

sec⁡(π/5)=−1+5\sec(\pi/5) = -1 + \sqrt5

live ↗
Inarcsec(5−1)\mathrm{arcsec}(\sqrt{5}-1)Outπ5\frac{π}{5}

Known value · Wolfram MathematicalFunctionData, ArcSec

The negative counterpart gives 4π/54\pi/5

live ↗
Inarcsec(1−5)\mathrm{arcsec}(1-\sqrt{5})Out4π5\frac{4π}{5}

Known value · Wolfram MathematicalFunctionData, ArcSec

sec⁡(3π/4)=−2\sec(3\pi/4) = -\sqrt2

live ↗
Inarcsec(−2)\mathrm{arcsec}(-\sqrt{2})Out3π4\frac{3π}{4}

Known value · Wolfram MathematicalFunctionData, ArcSec

live ↗
Inarcsec(2−255)\mathrm{arcsec}(\sqrt{2-\frac{2\sqrt{5}}{5}})Outπ10\frac{π}{10}

Known value · Wolfram MathematicalFunctionData, ArcSec

live ↗
Inarcsec(−2−2×51/25)\mathrm{arcsec}(-\sqrt{2-\frac{2×5^{1/2}}{5}})Out9π10\frac{9π}{10}

Known value · Wolfram MathematicalFunctionData, ArcSec

live ↗
Inarcsec(2+255)\mathrm{arcsec}(\sqrt{2+\frac{2\sqrt{5}}{5}})Out3π10\frac{3π}{10}

Known value · Wolfram MathematicalFunctionData, ArcSec

live ↗
Inarcsec(−2+2×51/25)\mathrm{arcsec}(-\sqrt{2+\frac{2×5^{1/2}}{5}})Out7π10\frac{7π}{10}

Known value · Wolfram MathematicalFunctionData, ArcSec

About
Examples29
Checked againstWolfram Language 29 agreeSageMath 25 agree2 differ1 unevaluatedSymPy 28 agree1 unevaluatedmpmath 24 agree2 errorJulia 23 agree3 errorRust 20 agree5 error
CrosswalkWolfram 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

acos of the reciprocal, the principal value off 0.

See also: Sec, Arccos