Skip to content

Sec ​

Secant, the reciprocal of Cos.

✓ checked against that system · ! checked, with disagreements (hover a chip)DLMF4.14.E6FungrimSecWolfram LanguageSec!
Sec(x)the secant of x, 1cos⁡(x)\frac{1}{\cos(x)}.
SageMathsec(x)SymPysec(x)mpmathsec(x)Juliaenumeratio_ball(_sec, x)
Typed signatures
TypePackageApplies
(complex | quantity) -> numberanalyticreplaces compute-enginealways
(complex | quantity) -> numbercompute-enginealways

Domain: Elementary functions

Details
  • sec⁡(x)=1cos⁡(x)\sec(x) = \frac{1}{\cos(x)}.
  • Even function, period 2π2\pi, same as Cos.
  • Undefined wherever cos⁡(x)=0\cos(x) = 0, the same poles as Tan.

Examples

6 more kept as data, checked against the oracles
Basic #
live ↗
Insec⁡(0)\sec(0)Out11
live ↗
Insec⁡(π4)\sec(\frac{π}{4})Out2\sqrt{2}
live ↗
Insec⁡(π3)\sec(\frac{π}{3})Out22
live ↗
Insec⁡(π)\sec(π)Out−1-1

sec⁡30∘=233\sec 30^\circ = \frac{2\sqrt3}{3}, exactly

live ↗
Insec⁡(30∘)\sec(30^{∘})Out233\frac{2\sqrt{3}}{3}

A machine-precision argument evaluates numerically

live ↗
Insec⁡(1.2)\sec(1.2)Out2.759 703 601 332 406 456 892.759\,703\,601\,332\,406\,456\,89
live ↗
InSeries⁡(sec⁡(x),x,0,10)\operatorname{Series}(\sec(x), x, 0, 10)Out1+x22+5x424+61x6720+277x88 064+50 521x103 628 800+O(x12)1+\frac{x^2}{2}+\frac{5x^4}{24}+\frac{61x^6}{720}+\frac{277x^8}{8\,064}+\frac{50\,521x^{10}}{3\,628\,800}+O\left(x^{12}\right)
live ↗
InSeries⁡(sec⁡(x),x,3π2,5)\operatorname{Series}(\sec(x), x, \frac{3π}{2}, 5)Out1x−3π2+16(x−3π2)+1360×7(x−3π2)3+115 120×31(x−3π2)5+O((x−3π2)7)\frac{1}{x-\frac{3π}{2}}+\frac{1}{6}(x-\frac{3π}{2})+\frac{1}{360}×7(x-\frac{3π}{2})^3+\frac{1}{15\,120}×31(x-\frac{3π}{2})^5+O\left((x-\frac{3π}{2})^7\right)
Scope #

N(...) of an exact argument gives an arbitrary-precision value

live ↗
InN(sec⁡(65))N(\sec(\frac{6}{5}))Out2.759 703 601 332 406 456 892.759\,703\,601\,332\,406\,456\,89

Evaluates at a complex argument

live ↗
Insec⁡(2.5+i)\sec(2.5+i)Out−0.611 108 564 155 231 6+0.347 676 660 710 495 97i-0.611\,108\,564\,155\,231\,6+0.347\,676\,660\,710\,495\,97i

Threads element-wise over a matrix

live ↗
Insec⁡([[5π6,0],[π6,−π/4]])\sec(\bigl\lbrack\bigl\lbrack\frac{5π}{6}, 0\bigr\rbrack, \bigl\lbrack\frac{π}{6}, -π/4\bigr\rbrack\bigr\rbrack)Out[[−233,1],[233,2]]\bigl\lbrack\bigl\lbrack-\frac{2\sqrt{3}}{3}, 1\bigr\rbrack, \bigl\lbrack\frac{2\sqrt{3}}{3}, \sqrt{2}\bigr\rbrack\bigr\rbrack

sec⁡(π/12)=6−2\sec(\pi/12) = \sqrt6 - \sqrt2

live ↗
Insec⁡(π12)\sec(\frac{π}{12})Out6−2\sqrt{6}-\sqrt{2}

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

live ↗
Insec⁡(π5)\sec(\frac{π}{5})Out5−1\sqrt{5}-1

sec⁡(π/8)=4−22\sec(\pi/8) = \sqrt{4 - 2\sqrt2}

live ↗
Insec⁡(π8)\sec(\frac{π}{8})Out4−22\sqrt{4-2\sqrt{2}}

Interval arithmetic: the image of [π/6,π/3][\pi/6, \pi/3] is [23,2][\tfrac{2}{\sqrt3}, 2]

live ↗
Insec⁡(Interval(π6,π3))\sec(\mathrm{Interval}(\frac{π}{6}, \frac{π}{3}))OutInterval(233,2)\mathrm{Interval}(\frac{2\sqrt{3}}{3}, 2)

Uncertainty propagation: sec⁡(2±0.01)≈−2.403±0.053\sec(2 \pm 0.01) \approx -2.403 \pm 0.053

live ↗
Insec⁡(Around(2,0.01))\sec(\mathrm{Around}(2, 0.01))OutAround(−2.402 997 961 722 381,0.052 506 463 376 995 806)\mathrm{Around}(-2.402\,997\,961\,722\,381, 0.052\,506\,463\,376\,995\,806)

Evenness drops the sign of a symbolic argument: sec⁡(−x)=sec⁡x\sec(-x) = \sec x

live ↗
Insec⁡(−x)\sec(-x)Outsec⁡(x)\sec(x)

Derivative: sec⁡xtan⁡x\sec x \tan x

live ↗
Indsec⁡(x)dx\frac{\mathrm{d}\sec(x)}{\mathrm{d}x}Outtan⁡(x)sec⁡(x)\tan(x)\sec(x)

Antiderivative: ln⁡∣sec⁡x+tan⁡x∣\ln|\sec x + \tan x|

live ↗
In∫ ⁣sec⁡(x) dx\int\!\sec(x)\, \mathrm{d}xOutln⁡(∣tan⁡(x)+sec⁡(x)∣)\ln(\vert\tan(x)+\sec(x)\vert)

A 50-digit value of sec⁡65\sec\frac65

live ↗
InN(sec⁡(65),50)N(\sec(\frac{6}{5}), 50)Out2.759 703 601 332 406 456 883 432 939 237 783 860 073 115 323 0112.759\,703\,601\,332\,406\,456\,883\,432\,939\,237\,783\,860\,073\,115\,323\,011

A triangular matrix with exact entries from eigenvalues 5π6\frac{5\pi}6 and −π4-\frac\pi4

live ↗
InMatrixFunction(_1⁡↦sec⁡(_1⁡),[[5π6,0],[π6,−π4]])\mathrm{MatrixFunction}(\operatorname{\_1}↦\sec(\operatorname{\_1}), \bigl\lbrack\bigl\lbrack\frac{5π}{6}, 0\bigr\rbrack, \bigl\lbrack\frac{π}{6}, -\frac{π}{4}\bigr\rbrack\bigr\rbrack)Out[[−233,0],[−2213−4339,2]]\bigl\lbrack\bigl\lbrack-\frac{2\sqrt{3}}{3}, 0\bigr\rbrack, \bigl\lbrack-\frac{2\sqrt{2}}{13}-\frac{4\sqrt{3}}{39}, \sqrt{2}\bigr\rbrack\bigr\rbrack

sec⁡(∞)\sec(\infty) is a type error at boxing; Wolfram gives the oscillation range, (−∞,−1]∪[1,∞)(-\infty, -1] \cup [1, \infty)

live ↗
live ↗
InAssuming(m∈Z,Refine(sec⁡(π(12+m))))\mathrm{Assuming}(m∈ℤ, \mathrm{Refine}(\sec(π(\frac{1}{2}+m))))Outsec⁡(π(m+12))\sec(π(m+\frac{1}{2}))
live ↗
InAssuming(m∈Z,FullSimplify(Refine(sec⁡(πm))))\mathrm{Assuming}(m∈ℤ, \mathrm{FullSimplify}(\mathrm{Refine}(\sec(πm))))Outsec⁡(πm)\sec(πm)
live ↗
InFunctionMeromorphic(sec⁡(x),x)\mathrm{FunctionMeromorphic}(\sec(x), x)OutTrue\mathrm{True}
Properties #

Reciprocal of Cos: sec⁡(x)=1cos⁡(x)\sec(x) = \frac{1}{\cos(x)}

live ↗
Insec⁡(π3)=1cos⁡(π3)\sec(\frac{π}{3})=\frac{1}{\cos(\frac{π}{3})}OutTrue\mathrm{True}

Pythagorean identity: 1+tan⁡2x=sec⁡2x1 + \tan^2 x = \sec^2 x

live ↗
In1+tan⁡(π/6)2=sec⁡(π/6)21+\tan(π/6)^2=\sec(π/6)^2OutTrue\mathrm{True}

sec⁡(π/10)\sec(\pi/10) in nested radicals

live ↗
Insec⁡(π10)\sec(\frac{π}{10})Out15105−5\frac{1}{5}\sqrt{10}\sqrt{5-\sqrt{5}}

Known value · Wolfram MathematicalFunctionData, Sec

sec⁡(3π/10)\sec(3\pi/10), the conjugate nested radical

live ↗
Insec⁡(3π10)\sec(\frac{3π}{10})Out15105+5\frac{1}{5}\sqrt{10}\sqrt{5+\sqrt{5}}

Known value · Wolfram MathematicalFunctionData, Sec

live ↗
InN((2−sec⁡(1/2)2)sec⁡(1))N((2-\sec(1/2)^2)\sec(1))Out1.298 446 410 409 524 836 889 507 601 337 994 043 479 21.298\,446\,410\,409\,524\,836\,889\,507\,601\,337\,994\,043\,479\,2

Known value · Wolfram MathematicalFunctionData, Sec, FunctionalEquations

live ↗
InN(2sec⁡(1)sec⁡(1/2)2+(sec⁡(12)4−2sec⁡(1/2)2)sec⁡(1)2−sec⁡(12)4)N(2\sec(1)\sec(1/2)^2+(\sec(\frac{1}{2})^4-2\sec(1/2)^2)\sec(1)^2-\sec(\frac{1}{2})^4)Out−4.654 804 648 704 176 015 24⋅10−20-4.654\,804\,648\,704\,176\,015\,24\cdot10^{-20}

Known value · Wolfram MathematicalFunctionData, Sec, FunctionalEquations

live ↗
InN(sec⁡(1/2+π/2)2)N(\sec(1/2+π/2)^2)Out4.350 685 299 340 042 821 544.350\,685\,299\,340\,042\,821\,54

Known value · Wolfram MathematicalFunctionData, Sec, FunctionalEquations

live ↗
InN((2−sec⁡(2)2)sec⁡(4))N((2-\sec(2)^2)\sec(4))Out5.774 399 204 041 917 612 379 781 745 112 976 437 665 75.774\,399\,204\,041\,917\,612\,379\,781\,745\,112\,976\,437\,665\,7

Known value · Wolfram MathematicalFunctionData, Sec, FunctionalEquations

Possible issues #

A pole: cos⁡(π/2)=0\cos(\pi/2) = 0

live ↗
Insec⁡(π2)\sec(\frac{π}{2})Out∞~\tilde∞

Sec(ComplexInfinity) is Indeterminate, for the same recurring poles as Tan

live ↗

Known value · DLMF 4.14.10

About
Examples41
Checked againstWolfram Language 31 agree9 differ1 unevaluatedSageMath 31 agree1 unevaluated2 errorSymPy 33 agree3 differmpmath 25 agree2 differ1 unevaluatedJulia 26 agree2 errorRust 19 agree6 differ1 unevaluated
CrosswalkDLMFFungrimWolfram LanguageSageMathSymPympmathJulia

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

The reciprocal of cos.

See also: Cos, Csc, Cot