# tanh() Function & Examples

Use the tanh() trigonometry function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## tanh

#### tanh(x)

Try it yourself:

```calculio
tanh(0.5)
sinh(0.5) / cosh(0.5)
```

[sinh](https://calcul.io/function/sinh/index.md)

[cosh](https://calcul.io/function/cosh/index.md)

---

## tanh(): hyperbolic tangent

**tanh(x)** returns the hyperbolic tangent of x. Unlike ordinary tangent, its real output stays between −1 and 1.

## Behavior

`tanh(0)` is 0. As x grows positive it approaches 1; as x grows negative it approaches −1. This smooth bounded behavior is useful in modeling and activation functions.

## Related functions

Use [atanh()](https://calcul.io/function/atanh/index.md) for the inverse on the interval (−1, 1), and [sinh()](https://calcul.io/function/sinh/index.md) or [cosh()](https://calcul.io/function/cosh/index.md) for related hyperbolic functions. [exp()](https://calcul.io/function/exp/index.md) underlies its exponential formula, while [abs()](https://calcul.io/function/abs/index.md) checks magnitude.

## Caveat

Do not confuse tanh with [tan()](https://calcul.io/function/tan/index.md); they have different geometry and domains.

[All functions](https://calcul.io/functions/index.md)
