y=tanhxy = \tanh x

Graph of the Hyperbolic Tangent y=tanhxy = \tanh x

The hyperbolic tangent function y=tanhxy = \tanh x is defined as the ratio of the hyperbolic sine to the hyperbolic cosine:

tanhx=sinhxcoshx=exexex+ex\tanh x = \frac{\sinh x}{\cosh x} = \frac{e^x - e^{-x}}{e^x + e^{-x}}

It is the hyperbolic analogue of the ordinary tangent tanx\tan x.

Domain and range

Because the denominator coshx1\cosh x \geq 1 is never zero, tanhx\tanh x is defined for every real xx, giving the domain (,)(-\infty, \infty). Its values always lie strictly between 1-1 and 11, so its range is the open interval (1,1)(-1, 1).

Symmetry

Since tanh(x)=tanhx\tanh(-x) = -\tanh x, the function is odd, and its graph is symmetric about the origin.

Monotonicity

The derivative is ddxtanhx=sech2x=1tanh2x\dfrac{d}{dx}\tanh x = \operatorname{sech}^2 x = 1 - \tanh^2 x, which is always positive, so tanhx\tanh x is strictly increasing on the whole real line. The slope is steepest (=1=1) at the origin and flattens toward both ends, producing a smooth S-shaped curve.

Asymptotes and limits

As x+x \to +\infty, tanhx1\tanh x \to 1, and as xx \to -\infty, tanhx1\tanh x \to -1. The lines y=1y = 1 and y=1y = -1 are therefore horizontal asymptotes that the curve never crosses.

Notable points

The curve passes through the origin with tanh0=0\tanh 0 = 0. This is an inflection point and the center of symmetry. Near the origin tanhxx\tanh x \approx x.

Relationships with other functions

By definition it is the ratio of sinhx\sinh x and coshx\cosh x. It can also be written tanhx=e2x1e2x+1\tanh x = \dfrac{e^{2x} - 1}{e^{2x} + 1}, and it is related to the logistic sigmoid σ(x)=11+ex\sigma(x) = \dfrac{1}{1 + e^{-x}} by tanhx=2σ(2x)1\tanh x = 2\sigma(2x) - 1.

Applications

Because it is smooth, bounded, and S-shaped, tanhx\tanh x has been widely used as an activation function in neural networks. In statistics and physics it appears as a saturating function that confines values to a range, and as a model for magnetization or signal response.