Skip to content

Arctan ​

Arctangent, the inverse of Tan restricted to (−π/2,π/2)(-\pi/2, \pi/2).

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaInverse trigonometric functionsArctangentMathWorldInverseTangentWikidataQ2257242nLabarctangentDLMF4.23.ii.p1FungrimAtan✓Fungrim entryWolfram LanguageArcTan!
Arctan(x)the principal value y∈(−π/2,π/2)y \in (-\pi/2, \pi/2) with tan⁡(y)=x\tan(y) = x.
SageMatharctan(x)SymPyatan(x)mpmathatan(x)Juliaenumeratio_ball(atan, x)Rustatan(x)
Typed signatures
TypePackageApplies
(complex | quantity | signed_infinity) -> numberanalyticreplaces compute-enginealways
(complex | quantity | signed_infinity) -> numbercompute-enginealways

Domain: Elementary functions

Details
  • Defined for every real x, unlike Arcsin and Arccos.
  • Odd function: arctan⁡(−x)=−arctan⁡(x)\arctan(-x) = -\arctan(x).
  • Horizontal asymptotes at ±π/2\pm\pi/2 as x→±∞x \to \pm\infty.
  • The two-argument atan2 form is a separate compute-engine function, Arctan2(x,y)\mathrm{Arctan2}(x, y), rather than an overload of Arctan.

Examples

Basic #
live ↗
Inarctan⁡(0)\arctan(0)Out00
live ↗
Inarctan⁡(1)\arctan(1)Outπ4\frac{π}{4}
live ↗
Inarctan⁡(3)\arctan(\sqrt{3})Outπ3\frac{π}{3}

A machine-precision argument evaluates numerically

live ↗
Inarctan⁡(0.5)\arctan(0.5)Out0.463 647 609 000 806 116 2140.463\,647\,609\,000\,806\,116\,214
live ↗
InSeries⁡(arctan⁡(x),x,∞,5)\operatorname{Series}(\arctan(x), x, ∞, 5)Outπ2−1x+13x3−15x5+O(1x7)\frac{π}{2}-\frac{1}{x}+\frac{1}{3x^3}-\frac{1}{5x^5}+O\left(\frac{1}{x^7}\right)
Scope #

Arbitrary precision via N(...)

live ↗
InN(arctan⁡(12))N(\arctan(\frac{1}{2}))Out0.463 647 609 000 806 116 2140.463\,647\,609\,000\,806\,116\,214

Evaluates at a complex argument

live ↗
Inarctan⁡(2.5+i)\arctan(2.5+i)Out1.233 425 855 683 120 4+0.123 674 060 459 026 79i1.233\,425\,855\,683\,120\,4+0.123\,674\,060\,459\,026\,79i

Wolfram's two-argument ArcTan[x, y] is compute-engine's Arctan2(y,x)\mathrm{Arctan2}(y, x): the angle of the point (−1,−1)(-1, -1) is −3π/4-3\pi/4

live ↗
Inarctan⁡(−1,−1)\arctan(-1, -1)Out−3π4-\frac{3π}{4}

Arctan2 takes yy first: the angle of the point (0.5,2)(0.5, 2) is arctan⁡4≈1.3258\arctan 4 \approx 1.3258, evaluated numerically for the float input

live ↗
Inarctan⁡(2,0.5)\arctan(2, 0.5)Out1.325 817 663 668 032 465 061.325\,817\,663\,668\,032\,465\,06

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

live ↗
Inarctan⁡(2+3)\arctan(2+\sqrt{3})Out5π12\frac{5π}{12}

arctan⁡(2−3)=π/12\arctan(2 - \sqrt3) = \pi/12

live ↗
Inarctan⁡(2−3)\arctan(2-\sqrt{3})Outπ12\frac{π}{12}

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

live ↗
Inarctan⁡(2−1)\arctan(\sqrt{2}-1)Outπ8\frac{π}{8}
live ↗
Inarctan⁡(13)\arctan(\frac{1}{\sqrt{3}})Outπ6\frac{π}{6}
live ↗
Inarctan⁡(−1)\arctan(-1)Out−π4-\frac{π}{4}

Threads element-wise over a matrix

live ↗
Inarctan⁡([[0,1],[−1,3]])\arctan(\bigl\lbrack\bigl\lbrack0, 1\bigr\rbrack, \bigl\lbrack-1, \sqrt{3}\bigr\rbrack\bigr\rbrack)Out[[0,π4],[−π4,π3]]\bigl\lbrack\bigl\lbrack0, \frac{π}{4}\bigr\rbrack, \bigl\lbrack-\frac{π}{4}, \frac{π}{3}\bigr\rbrack\bigr\rbrack

Interval arithmetic: arctan⁡[−1,3]=[−π4,arctan⁡3]\arctan[-1, 3] = [-\tfrac{\pi}{4}, \arctan 3]

live ↗
Inarctan⁡(Interval(−1,3))\arctan(\mathrm{Interval}(-1, 3))OutInterval(−π4,arctan⁡(3))\mathrm{Interval}(-\frac{π}{4}, \arctan(3))

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

live ↗
Inarctan⁡(−x)\arctan(-x)Out−arctan⁡(x)-\arctan(x)

Derivative: 11+x2\frac{1}{1 + x^2}

live ↗
Indarctan⁡(x)dx\frac{\mathrm{d}\arctan(x)}{\mathrm{d}x}Out1x2+1\frac{1}{x^2+1}

Antiderivative

live ↗
In∫ ⁣arctan⁡(x) dx\int\!\arctan(x)\, \mathrm{d}xOutxarctan⁡(x)−12ln⁡(x2+1)x\arctan(x)-\frac{1}{2}\ln(x^2+1)

Gregory's series about 0

live ↗
InSeries⁡(arctan⁡(x),x,0,7)\operatorname{Series}(\arctan(x), x, 0, 7)Outx−x33+x55−x77+O(x9)x-\frac{x^3}{3}+\frac{x^5}{5}-\frac{x^7}{7}+O\left(x^9\right)

The limit at +∞+\infty

live ↗
Inlim⁡x→∞arctan⁡(x)\lim_{x→∞}\arctan(x)Outπ2\frac{π}{2}

To 30 significant digits, every one correctly rounded

live ↗
InN(arctan⁡(12),30)N(\arctan(\frac{1}{2}), 30)Out0.463 647 609 000 806 116 214 256 231 4610.463\,647\,609\,000\,806\,116\,214\,256\,231\,461

Fifty digits of an inverse tangent

live ↗
InN(arctan⁡(12),50)N(\arctan(\frac{1}{2}), 50)Out0.463 647 609 000 806 116 214 256 231 461 214 402 028 537 054 286 120.463\,647\,609\,000\,806\,116\,214\,256\,231\,461\,214\,402\,028\,537\,054\,286\,12

Threads over a matrix with exact angles

live ↗
Inarctan⁡([[1,3],[0,3]])\arctan(\bigl\lbrack\bigl\lbrack1, \sqrt{3}\bigr\rbrack, \bigl\lbrack0, \sqrt{3}\bigr\rbrack\bigr\rbrack)Out[[π4,π3],[0,π3]]\bigl\lbrack\bigl\lbrack\frac{π}{4}, \frac{π}{3}\bigr\rbrack, \bigl\lbrack0, \frac{π}{3}\bigr\rbrack\bigr\rbrack
Properties #

tan⁡(arctan⁡(x))=x\tan(\arctan(x)) = x

live ↗
Intan⁡(arctan⁡(1))=1\tan(\arctan(1))=1OutTrue\mathrm{True}

As logarithms: arctan⁡x=i2ln⁡(1−ix)−i2ln⁡(1+ix)\arctan x = \tfrac{i}{2}\ln(1 - ix) - \tfrac{i}{2}\ln(1 + ix)

live ↗
InTrigToExp(arctan⁡(x))\mathrm{TrigToExp}(\arctan(x))Out(−12i)ln⁡(ix+1)+12iln⁡(1−ix)(-\frac{1}{2}i)\ln(i x+1)+\frac{1}{2}i\ln(1-i x)

tan⁡(π/12)=2−3\tan(\pi/12) = 2-\sqrt3, so the negation gives −π/12-\pi/12

live ↗
Inarctan⁡(3−2)\arctan(\sqrt{3}-2)Out−π12-\frac{π}{12}

Known value · Wolfram MathematicalFunctionData, ArcTan

The radical is tan⁡(π/10)\tan(\pi/10); with the sign, −π/10-\pi/10

live ↗
Inarctan⁡(−1−2×51/25)\arctan(-\sqrt{1-\frac{2×5^{1/2}}{5}})Out−π10-\frac{π}{10}

Known value · Wolfram MathematicalFunctionData, ArcTan

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

live ↗
Inarctan⁡(1−2)\arctan(1-\sqrt{2})Out−π8-\frac{π}{8}

Known value · Wolfram MathematicalFunctionData, ArcTan

tan⁡(−π/6)=−13\tan(-\pi/6) = -\frac{1}{\sqrt3}

live ↗
Inarctan⁡(−33)\arctan(-\frac{\sqrt{3}}{3})Out−π6-\frac{π}{6}

Known value · Wolfram MathematicalFunctionData, ArcTan

A pentagon tangent giving π/5\pi/5

live ↗
Inarctan⁡(5−25)\arctan(\sqrt{5-2\sqrt{5}})Outπ5\frac{π}{5}

Known value · Wolfram MathematicalFunctionData, ArcTan

Odd symmetry gives −π/5-\pi/5

live ↗
Inarctan⁡(−5−25)\arctan(-\sqrt{5-2\sqrt{5}})Out−π5-\frac{π}{5}

Known value · Wolfram MathematicalFunctionData, ArcTan

The radical is tan⁡(3π/10)\tan(3\pi/10); with the sign, −3π/10-3\pi/10

live ↗
Inarctan⁡(−1+2×51/25)\arctan(-\sqrt{1+\frac{2×5^{1/2}}{5}})Out−3π10-\frac{3π}{10}

Known value · Wolfram MathematicalFunctionData, ArcTan

tan⁡(−π/3)=−3\tan(-\pi/3) = -\sqrt3

live ↗
Inarctan⁡(−3)\arctan(-\sqrt{3})Out−π3-\frac{π}{3}

Known value · Wolfram MathematicalFunctionData, ArcTan

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

live ↗
Inarctan⁡(1+2)\arctan(1+\sqrt{2})Out3π8\frac{3π}{8}

Known value · Wolfram MathematicalFunctionData, ArcTan

live ↗
InN(arctan⁡(13)+arctan⁡(12))N(\arctan(\frac{1}{3})+\arctan(\frac{1}{2}))Out0.785 398 163 397 448 309 6150.785\,398\,163\,397\,448\,309\,615

Known value · Wolfram MathematicalFunctionData, ArcTan, Euler's Machin-like formula

live ↗
InN(2arctan⁡(12)−arctan⁡(17))N(2\arctan(\frac{1}{2})-\arctan(\frac{1}{7}))Out0.785 398 163 397 448 309 6150.785\,398\,163\,397\,448\,309\,615

Known value · Wolfram MathematicalFunctionData, ArcTan, Hermann's formula

live ↗
InN(2arctan⁡(13)+arctan⁡(17))N(2\arctan(\frac{1}{3})+\arctan(\frac{1}{7}))Out0.785 398 163 397 448 309 6150.785\,398\,163\,397\,448\,309\,615

Known value · Wolfram MathematicalFunctionData, ArcTan, Hutton's formula

live ↗
InN(4arctan⁡(15)−arctan⁡(1239))N(4\arctan(\frac{1}{5})-\arctan(\frac{1}{239}))Out0.785 398 163 397 448 309 615 470.785\,398\,163\,397\,448\,309\,615\,47

Known value · Wolfram MathematicalFunctionData, ArcTan, Machin's formula

live ↗
Inarctan⁡(1−255)\arctan(\sqrt{1-\frac{2\sqrt{5}}{5}})Outπ10\frac{π}{10}

Known value · Wolfram MathematicalFunctionData, ArcTan

live ↗
Inarctan⁡(1+255)\arctan(\sqrt{1+\frac{2\sqrt{5}}{5}})Out3π10\frac{3π}{10}

Known value · Wolfram MathematicalFunctionData, ArcTan

Possible issues #

compute-engine's Arctan takes only one argument and errors on a second; the two-argument atan2 form is the separate Arctan2(x,y)\mathrm{Arctan2}(x, y) function

live ↗

Arctan(ComplexInfinity) is Indeterminate -- z=Reiπ/4z = Re^{i\pi/4} and z=−Reiπ/4z = -Re^{i\pi/4} converge to +π/2+\pi/2 and −π/2-\pi/2 as R→∞R \to \infty

live ↗

Known value · DLMF 4.23.26

Neat examples #

The horizontal asymptote as x→+∞x \to +\infty

live ↗
Inarctan⁡(∞)\arctan(∞)Outπ2\frac{π}{2}

And as x→−∞x \to -\infty

live ↗
Inarctan⁡(−∞)\arctan(-∞)Out−π2-\frac{π}{2}

Euler's Machin-like identity arctan⁡12+arctan⁡13=π4\arctan\tfrac12 + \arctan\tfrac13 = \tfrac{\pi}{4}, by FullSimplify; the bare sum stays as written, as in Wolfram

live ↗
InFullSimplify(arctan⁡(12)+arctan⁡(13))\mathrm{FullSimplify}(\arctan(\frac{1}{2})+\arctan(\frac{1}{3}))Outπ4\frac{π}{4}

Machin's formula 4arctan⁡15−arctan⁡1239=π44\arctan\tfrac15 - \arctan\tfrac1{239} = \tfrac{\pi}{4}, by FullSimplify

live ↗
InFullSimplify(4arctan⁡(15)−arctan⁡(1239))\mathrm{FullSimplify}(4\arctan(\frac{1}{5})-\arctan(\frac{1}{239}))Outπ4\frac{π}{4}
About
Examples47
Checked againstWolfram Language 45 agree2 differSageMath 42 agree1 unevaluated1 errorSymPy 40 agree2 differmpmath 35 agreeJulia 33 agree2 errorRust 32 agree
CrosswalkWikipedia ×2MathWorldWikidatanLabDLMFFungrimFungrim entry ×46Wolfram 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: Tan, Arcsin, Arccos