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.

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 all close all

Basic Examples  (3)

Evaluate numerically:

Click for copyable input

Plot over a subset of the reals:

Click for copyable input

Series expansion:

Click for copyable input

Scope  (36)

Generalizations & Extensions  (1)

Applications  (4)

Properties & Relations  (13)

Possible Issues  (4)

Neat Examples  (1)

Introduced in 1988
Updated in 1996