gives the tangent of z.


  • Mathematical function, suitable for both symbolic and numerical manipulation.
  • The argument of Tan is assumed to be in radians. (Multiply by Degree to convert from degrees.)
  • Sin[z]/Cos[z] is automatically converted to Tan[z]. TrigFactorList[expr] does decomposition.
  • Tan is automatically evaluated when its argument is a simple rational multiple of ; for more complicated rational multiples, FunctionExpand can sometimes be used.
  • For certain special arguments, Tan automatically evaluates to exact values.
  • Tan can be evaluated to arbitrary numerical precision.
  • Tan can be used with Interval and CenteredInterval objects. »
  • Tan automatically threads over lists.

Background & Context

  • Tan is the tangent function, which is one of the basic functions encountered in trigonometry. Tan[x] is defined as the ratio of the corresponding sine and cosine functions: . The equivalent schoolbook definition of the tangent of an angle in a right triangle is the ratio of the length of the leg opposite to the length of the leg adjacent to it.
  • Tan automatically evaluates to exact values when its argument is a simple rational multiple of . For more complicated rational multiples, FunctionExpand can sometimes be used to obtain an explicit exact value. TrigFactorList can be used to factor expressions involving Tan into terms containing Sin and Cos. To specify an argument using an angle measured in degrees, the symbol Degree can be used as a multiplier (e.g. Tan[30 Degree]). When given exact numeric expressions as arguments, Tan may be evaluated to arbitrary numeric precision. Other operations useful for manipulation of symbolic expressions involving Tan include TrigToExp, TrigExpand, Simplify, and FullSimplify.
  • Tan threads element-wise over lists and matrices. In contrast, MatrixFunction can be used to give the tangent of a square matrix (i.e. the power series for the tangent function with ordinary powers replaced by matrix powers) as opposed to the tangent of the individual matrix elements.
  • Tan is periodic with period , as reported by FunctionPeriod. Tan satisfies the identity , which is equivalent to the Pythagorean theorem. The definition of the tangent function is extended to complex arguments using the definition , where is the base of the natural logarithm. Tan has poles at values for an integer and evaluates to ComplexInfinity at these points. Tan[z] has series expansion sum_(k=0)^infty((-1)^(k-1) 2^(2 k)(2^(2k)-1) TemplateBox[{{2,  , k}}, BernoulliB] )/((2 k)!)z^(2 k-1) about the origin that may be expressed in terms of the Bernoulli numbers BernoulliB.
  • The inverse function of Tan is ArcTan. The hyperbolic tangent is given by Tanh. Other related mathematical functions include Cot.


open allclose all

Basic Examples  (6)

The argument is given in radians:

Use Degree to specify an argument in degrees:

Plot over a subset of the reals:

Plot over a subset of the complexes:

Series expansion at 0:

Asymptotic expansion at a singular point:

Scope  (46)

Numerical Evaluation  (6)

Evaluate numerically:

Evaluate to high precision:

The precision of the output tracks the precision of the input:

Tan can take complex number inputs:

Evaluate Tan efficiently at high precision:

Tan threads elementwise over lists and matrices:

Tan can be used with Interval and CenteredInterval objects:

Specific Values  (5)

Values of Tan at fixed points:

Values at infinity:

Zeros of Tan:

Find one zero using Solve:

Substitute in the result:

Visualize the result:

Singular points of Tan:

Simple, exact values are generated automatically:

More complicated cases require explicit use of FunctionExpand:

Visualization  (3)

Plot the Tan function:

Plot the real part of :

Plot the imaginary part of :

Polar plot with :

Function Properties  (13)

Real domain of Tan:

Complex domain:

Tan achieves all real values:

Tan is a periodic function with a period :

Tan is an odd function:

Tan has the mirror property tan(TemplateBox[{z}, Conjugate])=TemplateBox[{{tan, (, z, )}}, Conjugate]:

Tan is not an analytic function:

However, it is meromorphic:

Tan is monotonic in a specific range:

Tan is not injective:

Tan is surjective:

Tan is neither non-negative nor non-positive:

It has both singularities and discontinuities in points multiple to π/2:

Tan is neither convex nor concave:

TraditionalForm formatting:

Differentiation  (3)

First derivative:

Higher derivatives:

Formula for the ^(th) derivative:

Integration  (3)

Indefinite integral of Tan:

Definite integral of Tan over a period is 0:

More integrals:

Series Expansions  (3)

Taylor expansion:

Plot the first three approximations for Tan around :

General term in the series expansion of Tan:

Tan can be applied to power series:

Function Identities and Simplifications  (6)

Tan of a double angle:

Tan of a sum:

Convert multipleangle expressions:

Convert sums of trigonometric functions to products:

Expand assuming real variables and :

Convert to complex exponentials:

Function Representations  (4)

Representation through Cot:

Representation through Jacobi functions:

Representation through SphericalHarmonicY:

Representation through Mathieu functions:

Applications  (4)

Generate a plot over the complex argument plane:

Differential equation solution with a movable singularity:

The tangent function conformally maps a parabola into the unit disk:

Pursuit curve in the reference frame of the predator with prey moving half as fast along a line:

Properties & Relations  (12)

Basic parity and periodicity properties of the tangent function get automatically applied:

Use TrigFactorList to factor Tan into Sin and Cos:

Complicated expressions containing trigonometric functions do not simplify automatically:

Simplify under assumptions on parameters:

Compose with inverse functions:

Solve a trigonometric equation:

Solve for zeros and poles:

Numerically find a root of a transcendental equation:


Tan appears in special cases of many mathematical functions:

Calculate residue symbolically and numerically:

Tan is a numeric function:

Possible Issues  (4)

Machine-precision input is insufficient to give a correct answer:

With exact input, the answer is correct:

A larger setting for $MaxExtraPrecision is needed:

The precision of the output can be much smaller than the precision of the input:

In TraditionalForm, parentheses are needed around the argument:

Neat Examples  (7)

Plot Tan at integer points:

The continued fraction is highly regular:

Wolfram Research (1988), Tan, Wolfram Language function, https://reference.wolfram.com/language/ref/Tan.html (updated 2021).


Wolfram Research (1988), Tan, Wolfram Language function, https://reference.wolfram.com/language/ref/Tan.html (updated 2021).


Wolfram Language. 1988. "Tan." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Tan.html.


Wolfram Language. (1988). Tan. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Tan.html


@misc{reference.wolfram_2024_tan, author="Wolfram Research", title="{Tan}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/Tan.html}", note=[Accessed: 13-July-2024 ]}


@online{reference.wolfram_2024_tan, organization={Wolfram Research}, title={Tan}, year={2021}, url={https://reference.wolfram.com/language/ref/Tan.html}, note=[Accessed: 13-July-2024 ]}