TExcelTAD
Home › Calculus in Depth › Hyperbolic Functions

Hyperbolic Functions

The hyperbolic functions are combinations of exe^{x} and e−xe^{-x} that behave like sine and cosine, but for a hyperbola instead of a circle. They describe hanging cables, appear in relativity and solutions of differential equations, and tanh⁡\tanh is a classic neural-network activation. This lesson defines them, proves their identities and derivatives, and writes their inverses as logarithms.

For a first look see Hyperbolic Functions in the survey course.

Definitions

sinh⁡x=ex−e−x2cosh⁡x=ex+e−x2tanh⁡x=sinh⁡xcosh⁡x=ex−e−xex+e−xcsch⁡x=1sinh⁡xsech⁡x=1cosh⁡xcoth⁡x=1tanh⁡x\begin{aligned} &\sinh x = \frac{e^{x} - e^{-x}}{2} \qquad \cosh x = \frac{e^{x} + e^{-x}}{2} \\ &\tanh x = \frac{\sinh x}{\cosh x} = \frac{e^{x} - e^{-x}}{e^{x} + e^{-x}} \\ &\operatorname{csch} x = \frac{1}{\sinh x} \qquad \operatorname{sech} x = \frac{1}{\cosh x} \qquad \coth x = \frac{1}{\tanh x} \end{aligned}

sinh⁡\sinh is odd, cosh⁡\cosh is even, and cosh⁡x≥1\cosh x \ge 1 with minimum 1 at 0. Every function splits into an even plus an odd part, and cosh⁡\cosh, sinh⁡\sinh are exactly the even and odd parts of exe^{x}: ex=cosh⁡x+sinh⁡xe^{x} = \cosh x + \sinh x.

Function Domain Range Notes
sinh⁡\sinh R\mathbb{R} R\mathbb{R} odd, increasing
cosh⁡\cosh R\mathbb{R} [1,∞)[1, \infty) even, U-shaped (a catenary)
tanh⁡\tanh R\mathbb{R} (−1,1)(-1, 1) odd, horizontal asymptotes y=±1y = \pm 1

Identities

The fundamental identity follows directly from the definitions:

cosh⁡2x−sinh⁡2x=14[(ex+e−x)2−(ex−e−x)2]=14[(e2x+2+e−2x)−(e2x−2+e−2x)]=1\cosh^2 x - \sinh^2 x = \tfrac{1}{4}\left[(e^{x} + e^{-x})^2 - (e^{x} - e^{-x})^2\right] = \tfrac{1}{4}\left[(e^{2x} + 2 + e^{-2x}) - (e^{2x} - 2 + e^{-2x})\right] = 1

So the point (cosh⁡t,sinh⁡t)(\cosh t, \sinh t) lies on the right branch of the hyperbola x2−y2=1x^2 - y^2 = 1, just as (cos⁡t,sin⁡t)(\cos t, \sin t) lies on the circle. The parameter tt is not an angle but twice the area swept out between the origin, the curve and the x-axis, which is also true of tt for the circle.

Other identities have the same shape as trig identities with some signs flipped:

1−tanh⁡2x=sech⁡2xsinh⁡(x+y)=sinh⁡xcosh⁡y+cosh⁡xsinh⁡ycosh⁡(x+y)=cosh⁡xcosh⁡y+sinh⁡xsinh⁡ysinh⁡2x=2sinh⁡xcosh⁡x,cosh⁡2x=cosh⁡2x+sinh⁡2x\begin{aligned} 1 - \tanh^2 x &= \operatorname{sech}^2 x \\ \sinh(x + y) &= \sinh x \cosh y + \cosh x \sinh y \\ \cosh(x + y) &= \cosh x \cosh y + \sinh x \sinh y \\ \sinh 2x &= 2 \sinh x \cosh x, \qquad \cosh 2x = \cosh^2 x + \sinh^2 x \end{aligned}
python · try it yourself
import sympy as sp

x, y = sp.symbols('x y')
checks = {
    "cosh² − sinh²": sp.cosh(x)**2 - sp.sinh(x)**2 - 1,
    "1 − tanh² − sech²": 1 - sp.tanh(x)**2 - sp.sech(x)**2,
    "sinh(x+y) formula": sp.sinh(x + y) - (sp.sinh(x)*sp.cosh(y) + sp.cosh(x)*sp.sinh(y)),
    "cosh 2x formula": sp.cosh(2*x) - (sp.cosh(x)**2 + sp.sinh(x)**2),
}
for name, expr in checks.items():
    print(f"{name:20s} -> {sp.simplify(expr.rewrite(sp.exp))}")
cosh² − sinh²        -> 0
1 − tanh² − sech²    -> 0
sinh(x+y) formula    -> 0
cosh 2x formula      -> 0

Rewriting in terms of exp turns each identity into polynomial algebra in exe^{x}, which is also how you prove them by hand.

Derivatives

Differentiate the definitions:

ddxsinh⁡x=ex+e−x2=cosh⁡xddxcosh⁡x=ex−e−x2=sinh⁡x(no minus sign, unlike cos⁡)ddxtanh⁡x=cosh⁡2x−sinh⁡2xcosh⁡2x=sech⁡2xddxsech⁡x=−sech⁡xtanh⁡xddxcsch⁡x=−csch⁡xcoth⁡xddxcoth⁡x=−csch⁡2x\begin{aligned} \frac{d}{dx} \sinh x &= \frac{e^{x} + e^{-x}}{2} = \cosh x \\ \frac{d}{dx} \cosh x &= \frac{e^{x} - e^{-x}}{2} = \sinh x && \text{(no minus sign, unlike } \cos\text{)} \\ \frac{d}{dx} \tanh x &= \frac{\cosh^2 x - \sinh^2 x}{\cosh^2 x} = \operatorname{sech}^2 x \\ \frac{d}{dx} \operatorname{sech} x &= -\operatorname{sech} x \tanh x \\ \frac{d}{dx} \operatorname{csch} x &= -\operatorname{csch} x \coth x \\ \frac{d}{dx} \coth x &= -\operatorname{csch}^2 x \end{aligned}

Since sinh⁡′′=sinh⁡\sinh'' = \sinh and cosh⁡′′=cosh⁡\cosh'' = \cosh, both solve y′′=yy'' = y, while sin⁡\sin and cos⁡\cos solve y′′=−yy'' = -y. Every solution of y′′=yy'' = y is Acosh⁡x+Bsinh⁡xA \cosh x + B \sinh x (see Second-Order Linear Equations).

Inverse hyperbolic functions as logarithms

sinh⁡\sinh and tanh⁡\tanh are one-to-one; cosh⁡\cosh is one-to-one on [0,∞)[0, \infty). Because they are built from exe^{x}, their inverses are logarithms. For y=sinh⁡−1xy = \sinh^{-1} x:

x=sinh⁡y=ey−e−y2  ⟹  e2y−2xey−1=0(quadratic in ey)ey=x±x2+1; ey>0 forces the + signsinh⁡−1x=ln⁡(x+x2+1)\begin{aligned} &x = \sinh y = \frac{e^{y} - e^{-y}}{2} \implies e^{2y} - 2x e^{y} - 1 = 0 && \text{(quadratic in } e^{y}\text{)} \\ &e^{y} = x \pm \sqrt{x^2 + 1};\ e^{y} > 0 \text{ forces the } + \text{ sign} \\ &\sinh^{-1} x = \ln\left(x + \sqrt{x^2 + 1}\right) \end{aligned}

The same method gives

cosh⁡−1x=ln⁡(x+x2−1),x≥1tanh⁡−1x=12ln⁡1+x1−x,−1<x<1\begin{aligned} \cosh^{-1} x &= \ln\left(x + \sqrt{x^2 - 1}\right), && x \ge 1 \\ \tanh^{-1} x &= \tfrac{1}{2} \ln\frac{1 + x}{1 - x}, && -1 < x < 1 \end{aligned}

and their derivatives, by implicit differentiation or from the logs:

ddxsinh⁡−1x=11+x2ddxcosh⁡−1x=1x2−1(x>1)ddxtanh⁡−1x=11−x2(∣x∣<1)\begin{aligned} \frac{d}{dx} \sinh^{-1} x &= \frac{1}{\sqrt{1 + x^2}} \\ \frac{d}{dx} \cosh^{-1} x &= \frac{1}{\sqrt{x^2 - 1}} && (x > 1) \\ \frac{d}{dx} \tanh^{-1} x &= \frac{1}{1 - x^2} && (\lvert x \rvert < 1) \end{aligned}

These are why ∫dx1+x2=sinh⁡−1x+C\int \frac{dx}{\sqrt{1 + x^2}} = \sinh^{-1} x + C shows up in Trigonometric Substitution.

python · try it yourself
import math
import numpy as np

for x in [0.5, 2.0, 10.0]:
    print(f"x = {x:5}: asinh = {math.asinh(x):.12f}  log formula = {math.log(x + math.sqrt(x*x + 1)):.12f}")
print("atanh(0.6) =", round(math.atanh(0.6), 12), " log formula =", round(0.5 * math.log(1.6 / 0.4), 12))
# a cancellation trap: for large negative x the log formula subtracts nearly equal numbers
x = -1e8
print("asinh(-1e8) library:", math.asinh(x))
print("naive log argument x + sqrt(x² + 1) =", x + math.sqrt(x*x + 1), "(true value 5e-09), so log fails")
print("np.tanh(20) =", float(np.tanh(20)))
x =   0.5: asinh = 0.481211825060  log formula = 0.481211825060
x =   2.0: asinh = 1.443635475179  log formula = 1.443635475179
x =  10.0: asinh = 2.998222950298  log formula = 2.998222950298
atanh(0.6) = 0.69314718056  log formula = 0.69314718056
asinh(-1e8) library: -19.11382792451231
naive log argument x + sqrt(x² + 1) = 0.0 (true value 5e-09), so log fails
np.tanh(20) = 1.0

Note that tanh⁡−1(0.6)=12ln⁡4=ln⁡2\tanh^{-1}(0.6) = \tfrac{1}{2} \ln 4 = \ln 2. The last lines show why libraries implement asinh carefully: for x=−108x = -10^8 the true argument x+x2+1≈12⋅108x + \sqrt{x^2 + 1} \approx \frac{1}{2 \cdot 10^8} is lost to cancellation and becomes exactly 0.0. Using oddness, sinh⁡−1x=−sinh⁡−1(−x)\sinh^{-1} x = -\sinh^{-1}(-x), avoids the problem.

The catenary

A flexible cable of uniform weight hanging between two supports takes the shape

y=acosh⁡(xa)y = a \cosh\left(\frac{x}{a}\right)

where a=T/wa = T/w is the ratio of horizontal tension to weight per unit length. Its slope is sinh⁡(x/a)\sinh(x/a), and its arc length from 0 to xx is asinh⁡(x/a)a \sinh(x/a) because 1+sinh⁡2=cosh⁡\sqrt{1 + \sinh^2} = \cosh. A parabola looks similar near the bottom (cosh⁡u≈1+u2/2\cosh u \approx 1 + u^2/2) but diverges from it further out.

python · try it yourself
import numpy as np
import matplotlib.pyplot as plt

a = 2.0
x = np.linspace(-4, 4, 200)
cat = a * np.cosh(x / a)
par = a + x**2 / (2 * a)          # quadratic approximation at the bottom
plt.figure(figsize=(6, 4))
plt.plot(x, cat, label="catenary a·cosh(x/a)")
plt.plot(x, par, "--", label="parabola a + x²/(2a)")
plt.legend(); plt.title("Hanging cable, a = 2"); plt.grid(alpha=0.3)
print(f"at x = 4: catenary {float(a * np.cosh(2)):.4f}, parabola {float(a + 16 / 4):.4f}")
print(f"cable length from -4 to 4: {float(2 * a * np.sinh(2)):.4f}")
at x = 4: catenary 7.5244, parabola 6.0000
cable length from -4 to 4: 14.5074

In software

  • Neural networks: tanh⁡\tanh is a zero-centred activation, and its derivative 1−tanh⁡21 - \tanh^2 is cheap to compute from the forward value during backpropagation; it is closely related to the sigmoid, σ(x)=1+tanh⁡(x/2)2\sigma(x) = \frac{1 + \tanh(x/2)}{2}. LSTM cells use tanh⁡\tanh gates. See Machine Learning.
  • Numerics: use math.asinh, math.atanh, math.log1p instead of the log formulas; the naive forms lose precision through cancellation.
  • Graphics and games: tanh⁡\tanh is a smooth saturating curve for tone mapping, soft clipping of audio, and easing; hyperbolic geometry (cosh⁡\cosh, sinh⁡\sinh) drives hyperbolic tilings and some map projections (the Mercator latitude uses tanh⁡−1(sin⁡φ)\tanh^{-1}(\sin\varphi)).
  • Physics: relativity's rapidity adds like tanh⁡−1\tanh^{-1}: velocities uu, vv combine as tanh⁡(tanh⁡−1u+tanh⁡−1v)\tanh(\tanh^{-1} u + \tanh^{-1} v) in units of cc.

Exercises

Exercise 1: Evaluate

Find the exact values of cosh⁡(ln⁡3)\cosh(\ln 3) and tanh⁡(ln⁡3)\tanh(\ln 3).

Answer

cosh⁡(ln⁡3)=53\cosh(\ln 3) = \frac{5}{3}, tanh⁡(ln⁡3)=45\tanh(\ln 3) = \frac{4}{5}.

Solution
eln⁡3=3,e−ln⁡3=13cosh⁡(ln⁡3)=3+1/32=53,sinh⁡(ln⁡3)=3−1/32=43tanh⁡(ln⁡3)=4/35/3=45\begin{aligned} &e^{\ln 3} = 3, \quad e^{-\ln 3} = \tfrac{1}{3} \\ &\cosh(\ln 3) = \frac{3 + 1/3}{2} = \frac{5}{3}, \qquad \sinh(\ln 3) = \frac{3 - 1/3}{2} = \frac{4}{3} \\ &\tanh(\ln 3) = \frac{4/3}{5/3} = \frac{4}{5} \end{aligned}

Exercise 2: Differentiate

Find ddx[ln⁡(cosh⁡x)]\frac{d}{dx}\left[\ln(\cosh x)\right] and ddx[xsinh⁡−1(2x)]\frac{d}{dx}\left[x \sinh^{-1}(2x)\right].

Answer

tanh⁡x\tanh x and sinh⁡−1(2x)+2x1+4x2\sinh^{-1}(2x) + \frac{2x}{\sqrt{1 + 4x^2}}.

Solution
ddxln⁡(cosh⁡x)=sinh⁡xcosh⁡x=tanh⁡xddx xsinh⁡−1(2x)=sinh⁡−1(2x)+x⋅21+(2x)2\begin{aligned} \frac{d}{dx} \ln(\cosh x) &= \frac{\sinh x}{\cosh x} = \tanh x \\ \frac{d}{dx}\, x \sinh^{-1}(2x) &= \sinh^{-1}(2x) + x \cdot \frac{2}{\sqrt{1 + (2x)^2}} \end{aligned}
python · try it yourself
import sympy as sp

x = sp.symbols('x')
print(sp.simplify(sp.diff(sp.log(sp.cosh(x)), x)))
print(sp.diff(x * sp.asinh(2 * x), x))
tanh(x)
2*x/sqrt(4*x**2 + 1) + asinh(2*x)

Exercise 3: Derive tanh⁡−1\tanh^{-1}

Show that tanh⁡−1x=12ln⁡1+x1−x\tanh^{-1} x = \tfrac{1}{2} \ln\frac{1 + x}{1 - x}.

Answer

Solve x=e2y−1e2y+1x = \frac{e^{2y} - 1}{e^{2y} + 1} for e2ye^{2y}.

Solution
x=tanh⁡y=ey−e−yey+e−y=e2y−1e2y+1xe2y+x=e2y−1  ⟹  e2y(1−x)=1+x  ⟹  e2y=1+x1−xy=12ln⁡1+x1−x\begin{aligned} &x = \tanh y = \frac{e^{y} - e^{-y}}{e^{y} + e^{-y}} = \frac{e^{2y} - 1}{e^{2y} + 1} \\ &x e^{2y} + x = e^{2y} - 1 \implies e^{2y}(1 - x) = 1 + x \implies e^{2y} = \frac{1 + x}{1 - x} \\ &y = \tfrac{1}{2} \ln\frac{1 + x}{1 - x} \end{aligned}

Exercise 4: Cable sag

A cable follows y=10cosh⁡(x/10)y = 10 \cosh(x/10) between supports at x=±15x = \pm 15. How far above its lowest point are the supports, and how long is the cable?

Answer

Sag≈13.52\text{Sag} \approx 13.52; length≈42.59\text{length} \approx 42.59.

Solution
sag=10cosh⁡(1.5)−10=10(cosh⁡1.5−1)length=2⋅10sinh⁡(1.5)=20sinh⁡1.5\begin{aligned} \text{sag} &= 10 \cosh(1.5) - 10 = 10(\cosh 1.5 - 1) \\ \text{length} &= 2 \cdot 10 \sinh(1.5) = 20 \sinh 1.5 \end{aligned}
python · try it yourself
import math
print(round(10 * (math.cosh(1.5) - 1), 4), round(20 * math.sinh(1.5), 4))
13.5241 42.5856

Test yourself

What is the derivative of cosh⁡x\cosh x?

  1. −sinh⁡x-\sinh x
  2. sinh⁡x\sinh x
  3. cosh⁡x\cosh x
  4. sech⁡2x\operatorname{sech}^2 x

Which identity is correct?

  1. cosh⁡2x+sinh⁡2x=1\cosh^2 x + \sinh^2 x = 1
  2. sinh⁡2x−cosh⁡2x=1\sinh^2 x - \cosh^2 x = 1
  3. cosh⁡2x−sinh⁡2x=1\cosh^2 x - \sinh^2 x = 1
  4. tanh⁡2x+sech⁡2x=2\tanh^2 x + \operatorname{sech}^2 x = 2

Which expression equals sinh⁡−1x\sinh^{-1} x?

  1. ln⁡(x+x2+1)\ln(x + \sqrt{x^2 + 1})
  2. ln⁡(x+x2−1)\ln(x + \sqrt{x^2 - 1})
  3. 12ln⁡1+x1−x\tfrac{1}{2} \ln\frac{1 + x}{1 - x}
  4. 1sinh⁡x\frac{1}{\sinh x}