dash–calculator

02 Complex Numbers and Functions

How to Calculate the Hyperbolic Tangent (tanh)

Readout 02-0017 · Updated · Standard formula, shown below

tanh x 0.462117
sinh x
0.521095
Result, rounded to 6 decimal places
cosh x
1.127626
Result, rounded to 6 decimal places
Value x
0.5
Input
You enter
Value x
You get
tanh x, sinh x, cosh x
Rounding
6 dp

This page works out the hyperbolic tangent of a number, and the hyperbolic sine and cosine it is built from. Enter x (a plain number, not an angle in degrees); you get tanh x, sinh x and cosh x to six decimal places.

Formula

sinh x = (eˣ − e⁻ˣ) ÷ 2, cosh x = (eˣ + e⁻ˣ) ÷ 2 and tanh x = sinh x ÷ cosh x = (eˣ − e⁻ˣ) ÷ (eˣ + e⁻ˣ).

  • x: any real number (the calculator accepts −300 to 300)
  • e ≈ 2.718282, the base of natural logarithms

Worked Example

Take x = 0.5.

  1. e0.5 = 1.648721 and e−0.5 = 0.606531
  2. sinh 0.5 = (1.648721 − 0.606531) ÷ 2 = 0.521095
  3. cosh 0.5 = (1.648721 + 0.606531) ÷ 2 = 1.127626
  4. tanh 0.5 = 0.521095 ÷ 1.127626 = 0.462117

How to read the result

tanh x always lies between −1 and 1. It is close to x for small x, and it flattens towards 1 (or −1) as x grows, which is why it is used as an activation function in neural networks and in the velocity of a falling body with air drag. cosh x is never below 1, and cosh² x − sinh² x = 1 for every x.

Limits and common mistakes

  • x is not an angle: there is no degrees mode for hyperbolic functions.
  • For x above about 20, tanh x rounds to 1.000000 at six decimals.
  • Do not confuse tanh with tan; tan uses an angle and repeats every π.

Frequently Asked Questions

What is tanh 0?

0, because sinh 0 = 0 and cosh 0 = 1.

What is tanh 1?

About 0.761594.

Is tanh an odd function?

Yes: tanh(−x) = −tanh x. sinh is odd too, while cosh is even.

How do I find the inverse, artanh?

artanh y = ½ ln((1 + y) ÷ (1 − y)) for −1 < y < 1.

Formula used
in x | Value x | - | 0.5 | -300 | 300
out th | tanh x | - | (exp(x) - exp(-x)) / (exp(x) + exp(-x)) | 6
out sh | sinh x | - | (exp(x) - exp(-x)) / 2 | 6
out ch | cosh x | - | (exp(x) + exp(-x)) / 2 | 6

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More on this panel

The whole Complex Numbers and Functions panel →