Intermediate

Tanh Calculator — Hyperbolic Tangent

Compute tanh(x) = (eˣ − e⁻ˣ) / (eˣ + e⁻ˣ) for any real x, and see sinh(x), cosh(x), the derivative sech²(x) = 1 − tanh²(x), and the characteristic S-curve.
Any real number — tanh(x) always lies strictly between −1 and 1
tanh(x)
0,761594

Hyperbolic tangent — always strictly between −1 and 1 for any real x

sinh(x)
1,175201
cosh(x)
1,543081
sech²(x) = 1 − tanh²(x)
0,419974
arctanh(tanh(x))
1 (= x)
(1, 0,7616)
Step by step
  1. 1

    sinh(x) = (eˣ − e⁻ˣ) ÷ 2

    (e^1 − e^−1) ÷ 2 = 1,175201
  2. 2

    cosh(x) = (eˣ + e⁻ˣ) ÷ 2

    (e^1 + e^−1) ÷ 2 = 1,543081
  3. 3

    tanh(x) = sinh(x) ÷ cosh(x)

    1,175201 ÷ 1,543081 = 0,761594
    Always strictly between −1 and 1 for any real x.
Результати є приблизними оцінками лише для загального ознайомлення та не є професійною порадою — завжди самостійно перевіряйте важливі результати, перш ніж покладатися на них. Прочитати повне застереження.
Швидка відповідь

Як працює цей калькулятор?

tanh(x) = (eˣ−e⁻ˣ)/(eˣ+e⁻ˣ). Always strictly between −1 and 1, zero at x=0, odd function, derivative sech²(x) = 1−tanh²(x) peaks at 1 when x=0. Related to logistic sigmoid by tanh(x) = 2σ(2x)−1. Widely used as a neural-network activation function for its zero-centred output and analytic derivative.

Формула
tanh(x) = sinh(x) / cosh(x) = (eˣ − e⁻ˣ) / (eˣ + e⁻ˣ) • d/dx tanh(x) = sech²(x) = 1 − tanh²(x)
How this is calculated

The hyperbolic tangent is defined as tanh(x) = sinh(x) / cosh(x) = (eˣ − e⁻ˣ) / (eˣ + e⁻ˣ). Because the numerator is always strictly smaller in magnitude than the denominator (both exponentials are positive, and the denominator is their sum), tanh(x) is bounded strictly between −1 and 1 for every real x. It passes through zero at x = 0, approaches +1 as x → +∞, and approaches −1 as x → −∞, tracing the smooth S-shaped curve shown in the plot.

This smooth saturation behaviour makes tanh a popular activation function in neural networks: it is zero-centred (unlike the logistic sigmoid, which maps to (0, 1) and can slow gradient descent), differentiable everywhere, and its derivative sech²(x) = 1 − tanh²(x) can be computed directly from the output — convenient for backpropagation. However, tanh still suffers from the vanishing-gradient problem for very large |x|, where the curve flattens and the derivative approaches zero.

The fundamental hyperbolic identity cosh²(x) − sinh²(x) = 1 implies that 1 − tanh²(x) = sech²(x), the derivative shown in the stat grid. For large |x|, tanh saturates rapidly: tanh(3) ≈ 0.9951, tanh(5) ≈ 0.9999. The function is strictly increasing and odd: tanh(−x) = −tanh(x).

Поширені запитання

The logistic sigmoid σ(x) = 1/(1+e⁻ˣ) maps to (0, 1), while tanh maps to (−1, 1). They are related by tanh(x) = 2σ(2x) − 1. Tanh is zero-centred, which generally helps gradient descent converge faster in neural network training.

d/dx tanh(x) = sech²(x) = 1 − tanh²(x). It is always positive (tanh is strictly increasing), reaches its maximum of 1 at x = 0, and approaches 0 as |x| → ∞ — reflecting the flattening of the S-curve near its horizontal asymptotes at ±1.

tanh is an odd function: tanh(−x) = −tanh(x). Its graph has 180°-rotational symmetry about the origin. This follows from sinh being odd and cosh being even, so sinh/cosh is odd.

APA

TG we-Calculate Editorial Team. (2026). Tanh Calculator — Hyperbolic Tangent [Online calculator]. TG we-Calculate. https://we-calculate.com/uk/calculator/tanh-calculator

Chicago

TG we-Calculate Editorial Team. "Tanh Calculator — Hyperbolic Tangent." TG we-Calculate. 2026. https://we-calculate.com/uk/calculator/tanh-calculator.

IEEE

TG we-Calculate Editorial Team, "Tanh Calculator — Hyperbolic Tangent," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/uk/calculator/tanh-calculator

BibTeX

@misc{wecalculate_tanh_calculator, title = {Tanh Calculator — Hyperbolic Tangent}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/uk/calculator/tanh-calculator}}, year = {2026}, note = {TG we-Calculate} }

Чи допоміг вам цей калькулятор?