Skip to content
ihateDesmos

Graph of tanh x (hyperbolic tangent)

Updated 20 October 2026 · Values computed by the ihateDesmos engine

The hyperbolic tangent, tanh x = sinh x / cosh x, squeezes every real number into the interval from −1 to 1. Its graph is an S-curve through the origin with slope 1 there, flattening toward y = 1 and y = −1.

−4−224−110
Open in calculator
The graph of
y=tanh(x)
for −5 ≤ x ≤ 5. Dots mark its root.

Key features

Domain
All real numbers
Range
−1 < y < 1
Formula
tanh x = (eˣ − e⁻ˣ)/(eˣ + e⁻ˣ)
Horizontal asymptotes
y = 1 and y = −1
Slope at the origin
1
Symmetry
Odd
y-intercept
None
Derivative
1−tanh(x)2
Antiderivative
ln(cosh(x))+C

Derivative and antiderivative from the calculator’s algebra system. Domain, range and asymptotes are stated for real x.

What the graph of tanh x looks like

Near the origin tanh x ≈ x. By x = 3 it is already 0.995, so the curve flattens quickly toward its asymptotes, much faster than arctan x does.

It is closely related to the logistic function: tanh x = 2σ(2x) − 1, where σ(x) = 1/(1 + e⁻ˣ). Both are smooth step functions.

Its derivative is 1 − tanh²x = sech²x, a bell-shaped curve peaking at 1 when x = 0.

Points of interest

Found numerically to about twelve digits in the window −5 ≤ x ≤ 5, then shown in exact form where one exists.

x-intercepts (roots)
x = 0
Local maxima
None in this window
Local minima
None in this window
Inflection points
(0, 0)

Table of values

A few points to plot, with exact values where they are simple.

Values of tanh x
xy = tanh x
−3−0.995055
−2−0.964028
−1−0.761594
00
10.761594
20.964028
30.995055

How to graph tanh x by hand

  1. 1
    Draw the asymptotes y = 1 and y = −1.
  2. 2
    Plot (0, 0), (1, 0.76), (2, 0.96) and their negatives.
  3. 3
    Draw an S-curve with slope 1 at the origin, hugging the asymptotes beyond |x| = 3.

Transformations

How the graph moves when you change the formula. The original is tanh x in blue.

−4−224−110
  • y = atan(x)*2/pi Arctan scaled to the same range: it approaches ±1 much more slowly.
  • y = tanh(3x) A sharper switch, approaching a step function as the factor grows.
  • y = 1/(1 + e^(-x)) The logistic sigmoid, which runs from 0 to 1 instead.

Where it shows up

  • Activation functions in neural networks.
  • The velocity of a falling object with quadratic air resistance, v(t) = v_terminal tanh(gt/v_terminal).

Frequently asked questions

What is the range of tanh x?
−1 < y < 1. The values ±1 are approached but never reached.
What is the derivative of tanh x?
1 − tanh²x, also written sech²x.
How is tanh related to the sigmoid function?
tanh x = 2σ(2x) − 1, where σ is the logistic sigmoid 1/(1 + e⁻ˣ).

Related graphs

Graph tanh x your way

Change the window, add sliders for a, b, h and k, trace the curve with your keyboard, or overlay its derivative.

Open in the calculator