Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Hyperbolic Tangent
0.761594
tanh(x)
sinh(x) 1.175201
cosh(x) 1.543081

What is the Tanh Calculator?

The hyperbolic tangent, written \(\tanh(x)\), is one of the fundamental hyperbolic functions. It maps any real number x to a value strictly between -1 and 1, making it a smooth, S-shaped (sigmoidal) function. This calculator computes \(\tanh(x)\) for any input, and also returns the companion functions \(\sinh(x)\) and \(\cosh(x)\).

How to use it

Enter any real number for x — it can be positive, negative, a decimal, or zero — and the calculator returns \(\tanh(x)\) along with \(\sinh(x)\) and \(\cosh(x)\). No units are required; these are pure mathematical functions.

The formula explained

The hyperbolic tangent is defined directly from the exponential function:

$$\tanh(x) = \frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}$$

This is the ratio of the hyperbolic sine, \(\sinh(x) = \frac{e^{x} - e^{-x}}{2}\), to the hyperbolic cosine, \(\cosh(x) = \frac{e^{x} + e^{-x}}{2}\). As x grows large and positive, \(\tanh(x)\) approaches 1; as x grows large and negative, it approaches -1; and \(\tanh(0) = 0\).

Advertisement
S-shaped graph of tanh(x) bounded between -1 and 1
The tanh curve is S-shaped and bounded between -1 and +1, crossing zero at the origin.

Worked example

For x = 1: \(e^{1} \approx 2.718282\) and \(e^{-1} \approx 0.367879\). Then $$\tanh(1) = \frac{2.718282 - 0.367879}{2.718282 + 0.367879} = \frac{2.350402}{3.086161} \approx 0.761594.$$ The calculator also reports \(\sinh(1) \approx 1.175201\) and \(\cosh(1) \approx 1.543081\).

FAQ

What is the range of tanh(x)? The output always lies in the open interval \((-1, 1)\), no matter how large x is.

Is tanh an odd function? Yes. \(\tanh(-x) = -\tanh(x)\), so it is symmetric about the origin.

Where is tanh used? It appears in neural networks as an activation function, in physics for describing relativistic velocity addition, and in solutions to differential equations.

Last updated: