Skip to content

Cot ​

Cotangent, the reciprocal of Tan.

✓ checked against that system · ! checked, with disagreements (hover a chip)DLMF4.14.E7FungrimCot✓Fungrim entryWolfram LanguageCot!
Cot(x)the cotangent of x, 1tan⁡(x)\frac{1}{\tan(x)}.
SageMathcot(x)SymPycot(x)mpmathcot(x)Juliaenumeratio_ball(cot, x)
Typed signatures
TypePackageApplies
(complex | quantity) -> numberanalyticreplaces compute-enginealways
(complex | quantity) -> numbercompute-enginealways

Domain: Elementary functions

Details
  • cot⁡(x)=cos⁡(x)sin⁡(x)=1tan⁡(x)\cot(x) = \frac{\cos(x)}{\sin(x)} = \frac{1}{\tan(x)}.
  • Period π\pi, same as Tan.
  • Undefined wherever sin⁡(x)=0\sin(x) = 0, i.e. at multiples of π\pi -- not the same poles as Tan.

Examples

6 more kept as data, checked against the oracles
Basic #
live ↗
Incot⁡(π6)\cot(\frac{π}{6})Out3\sqrt{3}
live ↗
Incot⁡(π4)\cot(\frac{π}{4})Out11
live ↗
Incot⁡(π3)\cot(\frac{π}{3})Out33\frac{\sqrt{3}}{3}

cot⁡60∘=33\cot 60^\circ = \frac{\sqrt3}{3}, exactly

live ↗
Incot⁡(60∘)\cot(60^{∘})Out33\frac{\sqrt{3}}{3}

A machine-precision argument evaluates numerically

live ↗
Incot⁡(1.2)\cot(1.2)Out0.388 779 569 368 204 911 6340.388\,779\,569\,368\,204\,911\,634
live ↗
InSeries⁡(cot⁡(x),x,0,10)\operatorname{Series}(\cot(x), x, 0, 10)Out1x−x3−x345−2x5945−x74 725−2x993 555+O(x11)\frac{1}{x}-\frac{x}{3}-\frac{x^3}{45}-\frac{2x^5}{945}-\frac{x^7}{4\,725}-\frac{2x^9}{93\,555}+O\left(x^{11}\right)
live ↗
InSeries⁡(cot⁡(x),x,−π,5)\operatorname{Series}(\cot(x), x, -π, 5)Out1x+π−x+π3−(x+π)345−1945×2(x+π)5+O((x+π)7)\frac{1}{x+π}-\frac{x+π}{3}-\frac{(x+π)^3}{45}-\frac{1}{945}×2(x+π)^5+O\left((x+π)^7\right)
Scope #

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

live ↗
InN(cot⁡(65))N(\cot(\frac{6}{5}))Out0.388 779 569 368 204 911 6340.388\,779\,569\,368\,204\,911\,634

Evaluates at a complex argument

live ↗
Incot⁡(2.5+i)\cot(2.5+i)Out−0.275 669 121 229 899 45−1.042 640 642 094 421 6i-0.275\,669\,121\,229\,899\,45-1.042\,640\,642\,094\,421\,6i

Threads element-wise over a matrix

live ↗
Incot⁡([[5π6,π2],[3π2,−π/6]])\cot(\bigl\lbrack\bigl\lbrack\frac{5π}{6}, \frac{π}{2}\bigr\rbrack, \bigl\lbrack\frac{3π}{2}, -π/6\bigr\rbrack\bigr\rbrack)Out[[−3,0],[0,−3]]\bigl\lbrack\bigl\lbrack-\sqrt{3}, 0\bigr\rbrack, \bigl\lbrack0, -\sqrt{3}\bigr\rbrack\bigr\rbrack

cot⁡(π/8)=1+2\cot(\pi/8) = 1 + \sqrt2

live ↗
Incot⁡(π8)\cot(\frac{π}{8})Out1+21+\sqrt{2}

cot⁡(π/12)=2+3\cot(\pi/12) = 2 + \sqrt3

live ↗
Incot⁡(π12)\cot(\frac{π}{12})Out2+32+\sqrt{3}
live ↗
Incot⁡(π5)\cot(\frac{π}{5})Out1555+25\frac{1}{5}\sqrt{5}\sqrt{5+2\sqrt{5}}

Across the pole at 0 the image comes in two unbounded pieces: cot⁡[−π4,π4]=(−∞,−1]∪[1,∞)\cot[-\tfrac\pi4, \tfrac\pi4] = (-\infty, -1] \cup [1, \infty), a Union of intervals

live ↗
Incot⁡(Interval(−π4,π4))\cot(\mathrm{Interval}(-\frac{π}{4}, \frac{π}{4}))Out[−∞,−1]∪[1,∞]\lbrack-∞, -1\rbrack∪\lbrack1, ∞\rbrack

Uncertainty propagation near a pole grows fast: cot⁡(3±0.01)≈−7.02±0.50\cot(3 \pm 0.01) \approx -7.02 \pm 0.50

live ↗
Incot⁡(Around(3,0.01))\cot(\mathrm{Around}(3, 0.01))OutAround(−7.015 252 551 434 534,0.502 137 683 604 087 3)\mathrm{Around}(-7.015\,252\,551\,434\,534, 0.502\,137\,683\,604\,087\,3)

Oddness pulls the sign out of a symbolic argument: cot⁡(−x)=−cot⁡x\cot(-x) = -\cot x

live ↗
Incot⁡(−x)\cot(-x)Out−cot⁡(x)-\cot(x)

Derivative: −csc⁡2x-\csc^2 x

live ↗
Indcot⁡(x)dx\frac{\mathrm{d}\cot(x)}{\mathrm{d}x}Out−csc⁡(x)2-\csc(x)^2

Antiderivative: ln⁡∣sin⁡x∣\ln|\sin x|

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

Fifty digits of a rational argument

live ↗
InN(cot⁡(65),50)N(\cot(\frac{6}{5}), 50)Out0.388 779 569 368 204 911 634 191 504 971 903 409 594 984 925 940 980.388\,779\,569\,368\,204\,911\,634\,191\,504\,971\,903\,409\,594\,984\,925\,940\,98

Matrix function giving exact entries

live ↗
InMatrixFunction(_1⁡↦cot⁡(_1⁡),[[5π6,π2],[3π2,−π6]])\mathrm{MatrixFunction}(\operatorname{\_1}↦\cot(\operatorname{\_1}), \bigl\lbrack\bigl\lbrack\frac{5π}{6}, \frac{π}{2}\bigr\rbrack, \bigl\lbrack\frac{3π}{2}, -\frac{π}{6}\bigr\rbrack\bigr\rbrack)Out[[33,0],[0,33]]\bigl\lbrack\bigl\lbrack\frac{\sqrt{3}}{3}, 0\bigr\rbrack, \bigl\lbrack0, \frac{\sqrt{3}}{3}\bigr\rbrack\bigr\rbrack

cot⁡(∞)\cot(\infty) is a type error at boxing; Wolfram gives the oscillation range, all of (−∞,∞)(-\infty, \infty)

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

Reciprocal of Tan: cot⁡(x)=1tan⁡(x)\cot(x) = \frac{1}{\tan(x)}

live ↗
Incot⁡(π4)=1tan⁡(π4)\cot(\frac{π}{4})=\frac{1}{\tan(\frac{π}{4})}OutTrue\mathrm{True}

Pythagorean identity: 1+cot⁡2x=csc⁡2x1 + \cot^2 x = \csc^2 x

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

cot⁡(π/10)\cot(\pi/10) as a nested radical

live ↗
Incot⁡(π10)\cot(\frac{π}{10})Out5+25\sqrt{5+2\sqrt{5}}

Known value · Wolfram MathematicalFunctionData, Cot

cot⁡(3π/10)\cot(3\pi/10) with the sign flipped under the root

live ↗
Incot⁡(3π10)\cot(\frac{3π}{10})Out5−25\sqrt{5-2\sqrt{5}}

Known value · Wolfram MathematicalFunctionData, Cot

cot⁡(3π/8)=2−1\cot(3\pi/8) = \sqrt2 - 1

live ↗
Incot⁡(3π8)\cot(\frac{3π}{8})Out2−1\sqrt{2}-1

Known value · Wolfram MathematicalFunctionData, Cot

live ↗
InN(cot⁡(1)cot⁡(12))N(\cot(1)\cot(\frac{1}{2}))Out1.175 342 649 670 021 410 775 459 195 243 800 606 406 351.175\,342\,649\,670\,021\,410\,775\,459\,195\,243\,800\,606\,406\,35

Known value · Wolfram MathematicalFunctionData, Cot, FunctionalEquations

live ↗
InN(cot⁡(12+π2))N(\cot(\frac{1}{2}+\frac{π}{2}))Out−0.546 302 489 843 790 513 255-0.546\,302\,489\,843\,790\,513\,255

Known value · Wolfram MathematicalFunctionData, Cot, FunctionalEquations

live ↗
InN(cot⁡(2)cot⁡(4))N(\cot(2)\cot(4))Out−0.395 274 781 468 481 040 556 054 300 098 063 842 107 695-0.395\,274\,781\,468\,481\,040\,556\,054\,300\,098\,063\,842\,107\,695

Known value · Wolfram MathematicalFunctionData, Cot, FunctionalEquations

live ↗
InN(cot⁡(2+π2))N(\cot(2+\frac{π}{2}))Out2.185 039 863 261 518 991 642.185\,039\,863\,261\,518\,991\,64

Known value · Wolfram MathematicalFunctionData, Cot, FunctionalEquations

Possible issues #

A pole: sin⁡(0)=0\sin(0) = 0

live ↗
Incot⁡(0)\cot(0)Out∞~\tilde∞

Not a pole here -- Tan's pole at π/2\pi/2 is Cot's zero instead

live ↗
Incot⁡(π2)\cot(\frac{π}{2})Out00

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

live ↗

Known value · DLMF 4.14.10

About
Examples42
Checked againstWolfram Language 31 agree10 differ1 unevaluatedSageMath 32 agree1 unevaluated2 errorSymPy 32 agree4 differ1 unevaluatedmpmath 26 agree2 differ1 errorJulia 27 agree2 errorRust 19 agree7 differ1 error
CrosswalkDLMFFungrimFungrim entry ×7Wolfram 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 tan.

See also: Tan, Sin, Cos