Graph of y = tanh x (Hyperbolic tangent)

· How we calculate · Free, no sign-up

Quick answer

The graph of y = tanh x is an S-shaped curve through the origin that levels off at y = −1 and y = 1. Domain: All real numbers (−∞, ∞); range: −1 < y < 1. x-intercept: x = 0; y-intercept: y = 0. It is odd (symmetric about the origin).

Functiony = tanh x
DomainAll real numbers (−∞, ∞)
Range−1 < y < 1
x-intercept(s)x = 0
y-intercepty = 0
Derivativesech² x = 1 − tanh² x
Graph of y = tanh x for −4 ≤ x ≤ 4−4−3−2−101234−1.5−1−0.500.511.5
Graph of y = tanh x for −4 ≤ x ≤ 4, −1.5 ≤ y ≤ 1.5. Dashed lines are asymptotes. Dots mark intercepts.
Zoom, pan and trace y = tanh x in the interactive grapher.Open the Graphing Calculator →

What the graph of y = tanh x looks like

tanh x = sinh x / cosh x = (eˣ − e⁻ˣ)/(eˣ + e⁻ˣ). It passes through the origin with slope 1 and quickly flattens towards the horizontal asymptotes y = 1 and y = −1 — by x = 3 it is already 0.995.

It is a rescaled logistic curve: tanh x = 2σ(2x) − 1, where σ is the logistic function. That bounded, smooth S-shape is why tanh is used as an activation function in neural networks and to describe velocity approaching terminal speed.

Key features of y = tanh x

Key features of y = tanh x
PropertyValue
Functiony = tanh x (Hyperbolic tangent)
FamilyHyperbolic
DomainAll real numbers (−∞, ∞)
Range−1 < y < 1
x-intercept(s)x = 0
y-intercepty = 0
SymmetryOdd — symmetric about the origin
AsymptotesHorizontal y = −1 and y = 1
PeriodNot periodic
Increasing on(−∞, ∞)
Decreasing onNever
Key pointsInflection at (0, 0) with slope 1; tanh 1 ≈ 0.7616
Derivative f′(x)sech² x = 1 − tanh² x
Antiderivative ∫ f(x) dxln(cosh x) + C

Symmetry: Odd — symmetric about the origin. For example f(2) = 0.964 while f(−2) = −0.964, its negative, so the graph looks the same after a half-turn about the origin. Intercepts: the graph meets the x-axis at x = 0 and the y-axis at y = 0.

Table of values for y = tanh x

Values of y = tanh x
xy = tanh xSlope f′(x)
−3−0.99510.0099
−2−0.9640.0707
−1−0.76160.42
001
10.76160.42
20.9640.0707
30.99510.0099

How to sketch y = tanh x by hand

Plot the points from the table — (−3, −0.9951), (−2, −0.964), (−1, −0.7616), (0, 0), (1, 0.7616), (2, 0.964) — on axes running from about −4 to 4 horizontally. Draw the asymptotes first (horizontal y = −1 and y = 1) as dashed lines; the curve gets ever closer to them without crossing in that direction. Then join the points with a smooth curve. As a check on the shape — increasing: (−∞, ∞); decreasing: Never.

Derivative, tangent line and area

The derivative of y = tanh x is sech² x = 1 − tanh² x, which gives the slope of the curve at each point (the third column of the table). At x = 1 the curve is at height 0.7616 and its slope is f′(1) = 0.42, so the tangent line there is y = 0.42x + 0.3416.

The signed area under the curve from x = 0 to x = 1 is 0.4338, found using the antiderivative ln(cosh x) + C.

Related graphs and transformations

Browse all graphs of common functions by family, or open the graphing calculator.

Frequently asked questions

What is the domain and range of y = tanh x?

Domain: All real numbers (−∞, ∞). Range: −1 < y < 1.

What are the intercepts of y = tanh x?

x-intercept(s): x = 0. y-intercept: y = 0.

What is the derivative of y = tanh x?

f′(x) = sech² x = 1 − tanh² x. At x = 1 the curve is at height 0.7616 and its slope is f′(1) = 0.42, so the tangent line there is y = 0.42x + 0.3416.

Is y = tanh x even, odd or neither?

Odd — symmetric about the origin. For example f(2) = 0.964 while f(−2) = −0.964, its negative, so the graph looks the same after a half-turn about the origin.

Does y = tanh x have asymptotes?

Horizontal y = −1 and y = 1.