Tanh
✖
Tanh
Details

- 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
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.
Examples
open allclose allBasic Examples (5)Summary of the most common use cases

https://wolfram.com/xid/0y8aa9-f8mh1d

Plot over a subset of the reals:

https://wolfram.com/xid/0y8aa9-ixm76y

Plot over a subset of the complexes:

https://wolfram.com/xid/0y8aa9-kiedlx


https://wolfram.com/xid/0y8aa9-ewuwd9

Asymptotic expansion at a singular point:

https://wolfram.com/xid/0y8aa9-k12ao4

Scope (46)Survey of the scope of standard use cases
Numerical Evaluation (5)

https://wolfram.com/xid/0y8aa9-29kz8

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

https://wolfram.com/xid/0y8aa9-3ec16

Tanh can take complex number inputs:

https://wolfram.com/xid/0y8aa9-ft1eky

Evaluate Tanh efficiently at high precision:

https://wolfram.com/xid/0y8aa9-di5gcr


https://wolfram.com/xid/0y8aa9-bq2c6r

Compute the elementwise values of an array using automatic threading:

https://wolfram.com/xid/0y8aa9-thgd2

Or compute the matrix Tanh function using MatrixFunction:

https://wolfram.com/xid/0y8aa9-o5jpo

Compute worst-case guaranteed intervals using Interval and CenteredInterval objects:

https://wolfram.com/xid/0y8aa9-eacc3


https://wolfram.com/xid/0y8aa9-lmyeh7


https://wolfram.com/xid/0y8aa9-fr1lbp

Or compute average-case statistical intervals using Around:

https://wolfram.com/xid/0y8aa9-cw18bq

Specific Values (4)
Values of Tanh at fixed purely imaginary points:

https://wolfram.com/xid/0y8aa9-nww7l


https://wolfram.com/xid/0y8aa9-pmmsbf


https://wolfram.com/xid/0y8aa9-h2f1w1

Zero of Tanh:

https://wolfram.com/xid/0y8aa9-cw39qs

Find the zero using Solve:

https://wolfram.com/xid/0y8aa9-bgtr3o


https://wolfram.com/xid/0y8aa9-oiazhe


https://wolfram.com/xid/0y8aa9-lv6k6q

Simple exact values are generated automatically:

https://wolfram.com/xid/0y8aa9-c5kgx6

More complicated cases require explicit use of FunctionExpand:

https://wolfram.com/xid/0y8aa9-mnn


https://wolfram.com/xid/0y8aa9-p3j

Visualization (3)
Plot the Tanh function:

https://wolfram.com/xid/0y8aa9-ecj8m7


https://wolfram.com/xid/0y8aa9-bo5grg


https://wolfram.com/xid/0y8aa9-dx2pr


https://wolfram.com/xid/0y8aa9-epb4bn

Function Properties (12)
Tanh is defined for all real values:

https://wolfram.com/xid/0y8aa9-cl7ele


https://wolfram.com/xid/0y8aa9-de3irc

Tanh achieves all real values from the open interval :

https://wolfram.com/xid/0y8aa9-evf2yr

Tanh is an odd function:

https://wolfram.com/xid/0y8aa9-dnla5q

Tanh has the mirror property :

https://wolfram.com/xid/0y8aa9-heoddu

Tanh is an analytic function of over the reals:

https://wolfram.com/xid/0y8aa9-h5x4l2

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

https://wolfram.com/xid/0y8aa9-ez7tfw


https://wolfram.com/xid/0y8aa9-4ddax2

Tanh is monotonic:

https://wolfram.com/xid/0y8aa9-g6kynf

Tanh is injective:

https://wolfram.com/xid/0y8aa9-gi38d7


https://wolfram.com/xid/0y8aa9-ctca0g

Tanh is not surjective:

https://wolfram.com/xid/0y8aa9-hkqec4


https://wolfram.com/xid/0y8aa9-hdm869

Tanh is neither non-negative nor non-positive:

https://wolfram.com/xid/0y8aa9-84dui

Tanh has no singularities or discontinuities:

https://wolfram.com/xid/0y8aa9-mdtl3h


https://wolfram.com/xid/0y8aa9-mn5jws

Tanh is neither convex nor concave:

https://wolfram.com/xid/0y8aa9-io426y

TraditionalForm formatting:

https://wolfram.com/xid/0y8aa9-fh7jar

Differentiation (3)
Integration (3)
Indefinite integral of Tanh:

https://wolfram.com/xid/0y8aa9-bponid

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

https://wolfram.com/xid/0y8aa9-b9jw7l


https://wolfram.com/xid/0y8aa9-c56p3v


https://wolfram.com/xid/0y8aa9-k7rv16


https://wolfram.com/xid/0y8aa9-g221sm

Series Expansions (4)
Find the Taylor expansion using Series:

https://wolfram.com/xid/0y8aa9-ewr1h8

Plot the first three approximations for Tanh around :

https://wolfram.com/xid/0y8aa9-binhar

General term in the series expansion of Tanh:

https://wolfram.com/xid/0y8aa9-ctla0e

A few first terms of Fourier series:

https://wolfram.com/xid/0y8aa9-f64drv

Tanh can be applied to power series:

https://wolfram.com/xid/0y8aa9-b8zc8w

Integral Transforms (2)
Compute the Laplace transform using LaplaceTransform:

https://wolfram.com/xid/0y8aa9-ralmmn


https://wolfram.com/xid/0y8aa9-g4jpzm

Function Identities and Simplifications (6)
Tanh of a double angle:

https://wolfram.com/xid/0y8aa9-mjplp7

Convert multiple‐angle expressions:

https://wolfram.com/xid/0y8aa9-kvf23t


https://wolfram.com/xid/0y8aa9-m77ks

Tanh of a sum:

https://wolfram.com/xid/0y8aa9-nfe4y

Convert sums of hyperbolic functions to products:

https://wolfram.com/xid/0y8aa9-nwd70


https://wolfram.com/xid/0y8aa9-kcx5nz

Expand assuming real variables and
:

https://wolfram.com/xid/0y8aa9-jrl4k


https://wolfram.com/xid/0y8aa9-dvmv83

Function Representations (4)
Representation through Tan:

https://wolfram.com/xid/0y8aa9-df304y

Representation through Bessel functions:

https://wolfram.com/xid/0y8aa9-9y9s4

Representation through Jacobi functions:

https://wolfram.com/xid/0y8aa9-cvvpzm


https://wolfram.com/xid/0y8aa9-g9t7o2

Representation through Mathieu functions:

https://wolfram.com/xid/0y8aa9-vmhy11

Applications (4)Sample problems that can be solved with this function
Plot a tractrix pursuit curve:

https://wolfram.com/xid/0y8aa9-oj8qpy


https://wolfram.com/xid/0y8aa9-hzyvh9

Calculate the finite area of the surface extending to infinity:

https://wolfram.com/xid/0y8aa9-zzbr7

Velocity of a relativistic body in a constant force field:

https://wolfram.com/xid/0y8aa9-bs2t69

Solution of the Burgers' equation using the tanh method:

https://wolfram.com/xid/0y8aa9-bi3r23

https://wolfram.com/xid/0y8aa9-j32fqt

Properties & Relations (13)Properties of the function, and connections to other functions
Basic parity and periodicity properties of Tanh are automatically applied:

https://wolfram.com/xid/0y8aa9-kocj3w


https://wolfram.com/xid/0y8aa9-ebh78


https://wolfram.com/xid/0y8aa9-bqdwep

Expressions containing hyperbolic functions do not automatically simplify:

https://wolfram.com/xid/0y8aa9-jezq8


https://wolfram.com/xid/0y8aa9-g06vxs

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

https://wolfram.com/xid/0y8aa9-lb9an5


https://wolfram.com/xid/0y8aa9-gff2zy


https://wolfram.com/xid/0y8aa9-eb62d5

Use FunctionExpand to express special values in radicals:

https://wolfram.com/xid/0y8aa9-b89r83

Compose with inverse functions:

https://wolfram.com/xid/0y8aa9-fvbq9h


https://wolfram.com/xid/0y8aa9-dbvt9m


https://wolfram.com/xid/0y8aa9-b6ntf8

Numerically find a root of a transcendental equation:

https://wolfram.com/xid/0y8aa9-skmzw


https://wolfram.com/xid/0y8aa9-bfl3o3


https://wolfram.com/xid/0y8aa9-bw1qy5


https://wolfram.com/xid/0y8aa9-fmpx0y


https://wolfram.com/xid/0y8aa9-drshlz

Obtain Tanh from sums and integrals:

https://wolfram.com/xid/0y8aa9-c5l23


https://wolfram.com/xid/0y8aa9-bz0wge


https://wolfram.com/xid/0y8aa9-n3lbz0

Tanh appears in special cases of special functions:

https://wolfram.com/xid/0y8aa9-tuph9

Tanh is a numeric function:

https://wolfram.com/xid/0y8aa9-lqmofj


https://wolfram.com/xid/0y8aa9-bkvbk

Possible Issues (4)Common pitfalls and unexpected behavior
Machine-precision input is insufficient to give a correct answer:

https://wolfram.com/xid/0y8aa9-iubygb

With exact input, the answer is correct:

https://wolfram.com/xid/0y8aa9-b5az2y

A larger setting for $MaxExtraPrecision can be needed:

https://wolfram.com/xid/0y8aa9-06gw2



https://wolfram.com/xid/0y8aa9-g33rc4

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

https://wolfram.com/xid/0y8aa9-cwihoi

In TraditionalForm, parentheses are needed around the argument:

https://wolfram.com/xid/0y8aa9-casrkv


https://wolfram.com/xid/0y8aa9-e7rnsl

Wolfram Research (1988), Tanh, Wolfram Language function, https://reference.wolfram.com/language/ref/Tanh.html (updated 2021).
Text
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).
CMS
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. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/Tanh.html.
APA
Wolfram Language. (1988). Tanh. Wolfram Language & System Documentation Center. Retrieved from 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
BibTeX
@misc{reference.wolfram_2025_tanh, author="Wolfram Research", title="{Tanh}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/Tanh.html}", note=[Accessed: 22-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_tanh, organization={Wolfram Research}, title={Tanh}, year={2021}, url={https://reference.wolfram.com/language/ref/Tanh.html}, note=[Accessed: 22-May-2025
]}