Tanh : Hyperbolic Tangent Formula, Graph & Properties

#Trigonometry
TL;DR
Tanh, the hyperbolic tangent, is defined by $\tanh x = \dfrac{e^{x} - e^{-x}}{e^{x} + e^{-x}}$ and produces a smooth S-curve squashing every real number into the open interval $(-1, 1)$. This article covers its definition, the tanh graph with horizontal asymptotes, its properties, derivative, and how it differs from the circular tangent function.
BT
Bhanzu TeamLast updated on August 15, 20269 min read

The Curve That Refuses To Go Past One

Drop a skydiver out of a plane and their speed does not climb forever - air resistance caps it, and the velocity curve bends smoothly toward a fixed terminal speed. That saturating shape, rising fast then flattening against a ceiling, is drawn almost exactly by the hyperbolic tangent, $\tanh x$. It is the mathematics of a quantity that grows, then runs out of room.

That "grows but never escapes a boundary" behaviour is why tanh is the go-to function for terminal velocity in physics and for the smooth on/off response of a neuron in a neural network. Feed it any number, however large, and the output stays politely between $-1$ and $+1$.

What Is Tanh?

Tanh - pronounced "tansh" - is the hyperbolic tangent function. The word hyperbolic is the headline: tanh is not a trigonometric function of an angle. It is built from the exponential function $e^{x}$, and its natural home is the unit hyperbola $x^{2} - y^{2} = 1$, not the unit circle. Its two definitions are equivalent.

  • Exponential definition. $\tanh x = \dfrac{e^{x} - e^{-x}}{e^{x} + e^{-x}}$, where $e \approx 2.718$ is Euler's number.

  • Ratio definition. $\tanh x = \dfrac{\sinh x}{\cosh x}$, the hyperbolic sine over the hyperbolic cosine - the same shape as $\tan\theta = \dfrac{\sin\theta}{\cos\theta}$, but with the hyperbolic pair.

The input $x$ is a plain real number, not an angle in degrees or radians. That is the cleanest way to keep tanh separate from its circular cousin: $\tan\theta$ answers "how steep is this angle?", while $\tanh x$ answers "how far has this number saturated toward the ceiling?"

Computing A Tanh Value

Take $x = 1$:

$$\tanh 1 = \dfrac{e^{1} - e^{-1}}{e^{1} + e^{-1}} = \dfrac{2.718 - 0.368}{2.718 + 0.368} = \dfrac{2.350}{3.086} \approx 0.762$$

Already at $x = 1$ the output is past $0.76$, well on its way to the ceiling of $1$. By $x = 3$ it is above $0.995$. The curve does its rising near the origin and then hugs the boundary.

How Is Tanh Different From The Tangent Function?

This is the question that trips students, so it earns its own section. Both share the name "tangent" and both are a ratio of a companion pair, but they are different families of function.

Feature

Circular $\tan\theta$

Hyperbolic $\tanh x$

Built from

$\sin\theta / \cos\theta$ (coordinates on the unit circle)

$\sinh x / \cosh x$ (coordinates on the unit hyperbola)

Input

an angle

a plain real number

Range

all real numbers

$(-1, 1)$ only

Repeats?

yes, period $\pi$

no, not periodic

Asymptotes

vertical, at $\dfrac{\pi}{2} + k\pi$

horizontal, at $y = \pm 1$

Symmetry

odd

odd

The one-line takeaway: circular tangent is unbounded and periodic; hyperbolic tanh is bounded and monotonic. They look alike on the page and behave nothing alike on a graph. Tanh sits alongside the wider trigonometric functions family only by analogy of form.

What Are The Properties Of Tanh?

The behaviour of $\tanh x$ is fixed by a short list, each readable off the S-curve above.

  • Domain: all real numbers - you can feed tanh anything.

  • Range: the open interval $(-1, 1)$. The output approaches $\pm 1$ but never reaches it.

  • Odd function: $\tanh(-x) = -\tanh x$. The graph has rotational symmetry about the origin.

  • Horizontal asymptotes: $y = 1$ as $x \to +\infty$ and $y = -1$ as $x \to -\infty$.

  • Monotonic increasing: the curve only ever rises; it never turns back.

  • Passes through the origin: $\tanh 0 = 0$.

  • Not periodic: unlike circular tangent, tanh never repeats.

What Is The Derivative Of Tanh?

Tanh has a famously tidy derivative, which is one reason it is popular in calculus and machine learning:

$$\dfrac{d}{dx}\tanh x = 1 - \tanh^{2} x = \operatorname{sech}^{2} x$$

The derivative is always positive (which confirms tanh only ever increases) and largest at $x = 0$, where the curve is steepest. Related identities include $\tanh(2x) = \dfrac{2\tanh x}{1 + \tanh^{2} x}$, the hyperbolic echo of the circular double-angle formula.

Examples Of Tanh

Example 1

Show that $\tanh 0 = 0$.

$$\tanh 0 = \dfrac{e^{0} - e^{0}}{e^{0} + e^{0}} = \dfrac{1 - 1}{1 + 1} = \dfrac{0}{2} = 0$$

Final answer: $\tanh 0 = 0$.

Example 2

Evaluate $\tanh(-1)$. First instinct, then the correct route.

The tempting move is to compute the exponential fraction again from scratch and risk a sign slip in $\dfrac{e^{-1} - e^{1}}{e^{-1} + e^{1}}$.

There is a faster, safer route that also guards the sign. Tanh is an odd function, so a negative input just flips the sign of the known positive value:

$$\tanh(-1) = -\tanh 1 \approx -0.762$$

Reaching for the odd-function property instead of re-deriving avoids the arithmetic slip and lands the sign correctly the first time.

Final answer: $\tanh(-1) \approx -0.762$.

Example 3

Confirm the range bound: can $\tanh x$ ever equal $2$?

No. The range of tanh is $(-1, 1)$, so no input produces an output of $2$ — the curve flattens against the ceiling $y = 1$ and never crosses it.

Final answer: impossible; $\tanh x < 1$ for every real $x$.

Example 4

Find the derivative of $\tanh x$ at $x = 0$.

Use $\dfrac{d}{dx}\tanh x = 1 - \tanh^{2} x$. Since $\tanh 0 = 0$:

$$1 - (0)^{2} = 1$$

Final answer: the slope at the origin is $1$ — the steepest point of the curve.

Example 5

Verify the identity $1 - \tanh^{2} x = \operatorname{sech}^{2} x$ at $x = 0$.

At $x = 0$: $\tanh 0 = 0$ and $\cosh 0 = 1$, so $\operatorname{sech} 0 = \dfrac{1}{\cosh 0} = 1$.

$$1 - 0^{2} = 1 = 1^{2} = \operatorname{sech}^{2} 0 \ \checkmark$$

Final answer: the identity holds at $x = 0$.

Example 6

A falling object's speed is modelled by $v(t) = 50\tanh\left(\dfrac{t}{5}\right)$ m/s. What is its terminal (long-run) speed?

As $t \to \infty$, $\tanh\left(\dfrac{t}{5}\right) \to 1$, so $v(t) \to 50 \times 1 = 50$.

Final answer: the terminal speed is $50$ m/s - the ceiling the tanh curve saturates against.

A common first-instinct error across these is reading tanh's asymptotes as vertical, the way circular tangent's are - but tanh's asymptotes are the horizontal lines $y = \pm 1$, which is exactly what keeps the output bounded.

Why Tanh Matters - "Growth with a built-in ceiling"

Tanh exists to model a quantity that grows quickly at first and then saturates against a limit, smoothly and symmetrically. That single behaviour is its fundamental utility, and it is why the function shows up far outside trigonometry.

  • Bounded response. Any signal that must stay between two fixed limits - a control output, a normalised score - can be passed through tanh to squash it into $(-1, 1)$ without a hard cutoff.

  • Physics of saturation. The velocity of an object falling through air, the charge on a capacitor, the magnetisation of a material: all follow a rising-then-flattening curve tanh captures.

  • Zero-centred smoothness. Because tanh is odd and passes through the origin, it treats positive and negative inputs symmetrically - the property that makes it a favoured activation function in neural networks.

What competitor explainers usually skip is why the exponential definition produces an S at all. For large positive $x$, $e^{-x}$ is nearly zero, so the fraction collapses to $\dfrac{e^{x}}{e^{x}} = 1$; for large negative $x$ it collapses to $-1$. The middle, near $x = 0$, is where the two exponentials are comparable and the curve does all its climbing. The S is the exponential's runaway growth, tamed by dividing one runaway by another.

Common Mistakes With Tanh

Mistake 1: Treating tanh as a trig function of an angle

Where it slips in: Any time a student sees "tan" inside "tanh" and reaches for degrees or the unit circle.

Don't do this: Trying to evaluate $\tanh 30^\circ$ as if it were $\tan 30^\circ$.

The correct way: Tanh takes a plain real number, not an angle. It is built from $e^{x}$ on the hyperbola, so there is no degree/radian input and no unit-circle value to look up.

The memorizer who filed tanh next to tan on the strength of the name applies angle-based habits to a function that has no angles.

Mistake 2: Drawing the graph as periodic or unbounded

Where it slips in: Sketching tanh from memory of the circular tangent graph.

Don't do this: Drawing repeating branches that run to $\pm\infty$ with vertical asymptotes.

The correct way: Tanh is a single S-curve, monotonic and bounded, with horizontal asymptotes at $y = \pm 1$. It never repeats and never leaves $(-1, 1)$.

Mistake 3: Saying the range includes $-1$ and $1$

Where it slips in: Writing the range as the closed interval $[-1, 1]$.

Don't do this: Claiming $\tanh x = 1$ is achievable for some finite $x$.

The correct way: The range is the open interval $(-1, 1)$. The curve approaches the asymptotes but never touches them, so $\pm 1$ are limits, not values.

Key Takeaways

  • Tanh is the hyperbolic tangent, $\dfrac{e^{x} - e^{-x}}{e^{x} + e^{-x}} = \dfrac{\sinh x}{\cosh x}$ — a function of a real number, not an angle.

  • Its graph is a smooth S-curve with range $(-1, 1)$ and horizontal asymptotes at $y = \pm 1$.

  • Tanh is odd, monotonic increasing, and not periodic — the opposite of circular tangent on every count except symmetry.

  • Its derivative is $1 - \tanh^{2} x$, and it saturates: large inputs give outputs near $\pm 1$.

  • The name overlaps with $\tan$, but tanh is hyperbolic, not circular.

To take hyperbolic and circular functions further with a teacher, explore Bhanzu's trigonometry tutor sessions, a high school math tutor for calculus-linked topics, or live math tutoring with peers from 20+ countries.

A Practical Next Step

Practice these to solidify your understanding: compute $\tanh 2$ from the exponential definition, then use the odd property to write down $\tanh(-2)$ without recomputing, and finally state the range and asymptotes from memory. If you get stuck, come back to the properties list above. Want a live Bhanzu trainer to work through the S-curve with you? Book a free demo class.

Read More

Book a Free Demo

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

Is tanh a trigonometric function?
No. Tanh is a hyperbolic function, built from $e^{x}$ and tied to the unit hyperbola, not an angle-based trigonometric function. It shares only the name and the ratio form with circular tangent.
What is the range of the tanh function?
The open interval $(-1, 1)$. Every output lies strictly between $-1$ and $1$; the endpoints are asymptotes, never reached.
Is tanh odd or even?
Odd. $\tanh(-x) = -\tanh x$, so its graph has rotational symmetry about the origin.
What is the derivative of tanh?
$\dfrac{d}{dx}\tanh x = 1 - \tanh^{2} x = \operatorname{sech}^{2} x$. It is always positive, confirming tanh only increases.
Is tanh the inverse of tan?
No. The inverse of tanh is $\operatorname{artanh}$ (inverse hyperbolic tangent), and the inverse of circular tangent is $\arctan$. "Hyperbolic" and "inverse" are two different relationships, and mixing them is a common slip.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →