gives the hyperbolic tangent of z.


  • Mathematical function, suitable for both symbolic and numerical manipulation.
  • Sinh[z]/Cosh[z] is automatically converted to Tanh[z]. TrigFactorList[expr] does decomposition.
  • For certain special arguments, Tanh automatically evaluates to exact values.
  • Tanh can be evaluated to arbitrary numerical precision.
  • Tanh automatically threads over lists.
  • Tanh can be used with Interval and CenteredInterval objects. »

Background & Context

  • Tanh is the hyperbolic tangent function, which is the hyperbolic analogue of the Tan circular function used throughout trigonometry. Tanh[α] is defined as the ratio of the corresponding hyperbolic sine and hyperbolic cosine functions via . Tanh may also be defined as , where is the base of the natural logarithm Log.
  • Tanh automatically evaluates to exact values when its argument is the (natural) logarithm of a rational number. When given exact numeric expressions as arguments, Tanh may be evaluated to arbitrary numeric precision. TrigFactorList can be used to factor expressions involving Tanh into terms containing Sinh, Cosh, Sin, and Cos. Other operations useful for manipulation of symbolic expressions involving Tanh include TrigToExp, TrigExpand, Simplify, and FullSimplify.
  • Tanh threads element-wise over lists and matrices. In contrast, MatrixFunction can be used to give the hyperbolic tangent of a square matrix (i.e. the power series for the hyperbolic tangent function with ordinary powers replaced by matrix powers) as opposed to the hyperbolic tangents of the individual matrix elements.
  • Tanh[x] approaches for small negative x and for large positive x. Tanh satisfies an identity similar to the Pythagorean identity satisfied by Tan, namely . The definition of the hyperbolic tangent function is extended to complex arguments by way of the identities and . Tanh has poles at values for an integer and evaluates to ComplexInfinity at these points. Tanh[z] has series expansion sum_(k=0)^infty(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 Tanh is ArcTanh. Additional related mathematical functions include Sinh, Coth, and Tan.


open allclose all

Basic Examples  (5)

Evaluate numerically:

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  (5)

Evaluate to high precision:

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

Tanh can take complex number inputs:

Evaluate Tanh efficiently at high precision:

Tanh threads elementwise over lists and matrices:

Tanh can be used with Interval and CenteredInterval objects:

Specific Values  (4)

Values of Tanh at fixed purely imaginary points:

Values at infinity:

Zero of Tanh:

Find the zero using Solve:

Substitute in the value:

Visualize the result:

Simple exact values are generated automatically:

More complicated cases require explicit use of FunctionExpand:

Visualization  (3)

Plot the Tanh function:

Plot the real part of :

Plot the imaginary part of :

Plot the real part of :

Function Properties  (12)

Tanh is defined for all real values:

Complex domain:

Tanh achieves all real values from the open interval :

Tanh is an odd function:

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

Tanh is an analytic function of over the reals:

While it is not analytic on the complex plane, it is meromorphic:

Tanh is monotonic:

Tanh is injective:

Tanh is not surjective:

Tanh is neither non-negative nor non-positive:

Tanh has no singularities or discontinuities:

Tanh is neither convex nor concave:

TraditionalForm formatting:

Differentiation  (3)

First derivative:

Higher derivatives:

Formula for the ^(th) derivative:

Integration  (3)

Indefinite integral of Tanh:

Definite integral of an odd integrand over an interval centered at the origin is 0:

More integrals:

Series Expansions  (4)

Find the Taylor expansion using Series:

Plot the first three approximations for Tanh around :

General term in the series expansion of Tanh:

A few first terms of Fourier series:

Tanh can be applied to power series:

Integral Transforms  (2)

Compute the Laplace transform using LaplaceTransform:


Function Identities and Simplifications  (6)

Tanh of a double angle:

Convert multipleangle expressions:

Tanh of a sum:

Convert sums of hyperbolic functions to products:

Expand assuming real variables and :

Convert to exponentials:

Function Representations  (4)

Representation through Tan:

Representation through Bessel functions:

Representation through Jacobi functions:

Representation through Mathieu functions:

Applications  (4)

Plot a tractrix pursuit curve:

Plot a pseudosphere:

Calculate the finite area of the surface extending to infinity:

Velocity of a relativistic body in a constant force field:

Solution of the Burgers' equation using the tanh method:

Properties & Relations  (13)

Basic parity and periodicity properties of Tanh are automatically applied:

Expressions containing hyperbolic functions do not automatically simplify:

Use Refine, Simplify, and FullSimplify to simplify expressions containing Tanh:

Use FunctionExpand to express special values in radicals:

Compose with inverse functions:

Solve a hyperbolic equation:

Numerically find a root of a transcendental equation:

Reduce a hyperbolic equation:


Integral transforms:

Obtain Tanh from sums and integrals:

Tanh appears in special cases of special functions:

Tanh 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 can be needed:

No power series exists at infinity, where Tanh has an essential singularity:

In TraditionalForm, parentheses are needed around the argument:

Neat Examples  (1)

Continued fraction expansion:

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


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


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


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


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


@online{reference.wolfram_2024_tanh, organization={Wolfram Research}, title={Tanh}, year={2021}, url={https://reference.wolfram.com/language/ref/Tanh.html}, note=[Accessed: 21-June-2024 ]}