# Hyperbolic tangent calculator (tanh)

Input tanh and numbers in the above form to calculate the hyperbolic tangent (tanh) as follows. In the above example, the calculator returns the hyperbolic tangents of -1, 0, 1, 180°. The tanh is a command to calculate the hyperbolic tangent and all numbers are separated by one space. The value that ends with d means a degree angle so 180d is about 3.141592... (pi).

• 90d ... 90°
• 180d ... 180°

The calculator takes radians, not degrees. So the degree numbers should have the suffix d and the calculator converts them to radians.

Let's input tanh and numbers in the form and calculate the hyperbolic tangents. If you want to calculate hundreds or thousands of hyperbolic tangents at once, use bulk calculator.

## Definition of hyperbolic tangent

The following is the definition of hyperbolic tangent.

$\textnormal{tanh} \ x = \dfrac{ \textnormal{sinh} \ x }{ \textnormal{cosh} \ x }$

The hyperbolic tangent is the hyperbolic sine divided by hyperbolic cosine. The hyperbolic cosine and sine are defined as follows.

$\textnormal{cosh} \ x = \dfrac{ e^x + e^{-x} }{2} \\~\\ \textnormal{sinh} \ x = \dfrac{ e^x - e^{-x} }{2}$

So we can write the hyperbolic tangent in exponential form like this.

$\textnormal{tanh} \ x = \dfrac{ e^x - e^{-x} }{ e^x + e^{-x} }$

If substituting x for -x in the function, you get -tanh().

\begin{aligned} \textnormal{tanh} (-x) &= \dfrac{ e^{-x} - e^{-(-x)} }{ e^{-x} + e^{-(-x)} } \\~\\ &= \dfrac{ e^{-x} - e^x }{ e^{-x} + e^x } \\~\\ &= \dfrac{ e^{-x} - e^x }{ e^x + e^{-x} } \\~\\ &= \dfrac{ -e^x + e^{-x} }{ e^x + e^{-x} } \\~\\ &= - \textnormal{tanh} \ x \end{aligned}

## Hyperbolic tangent formula

$\textnormal{tanh} (x+y) = \dfrac{ \textnormal{tanh} \ x + \textnormal{tanh} \ y }{ 1 + \textnormal{tanh} \ x \ \textnormal{tanh} \ y } \\~\\ \textnormal{tanh} (x-y) = \dfrac{ \textnormal{tanh} \ x - \textnormal{tanh} \ y }{ 1 - \textnormal{tanh} \ x \ \textnormal{tanh} \ y }$

$\textnormal{tanh} \ 2x = \dfrac{ 2 \ \textnormal{tanh} \ x }{ 1 + \textnormal{tanh}^2 \ x }$