Hyperbolic Functions
The hyperbolic functions are combinations of and 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 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
is odd, is even, and with minimum 1 at 0. Every function splits into an even plus an odd part, and , are exactly the even and odd parts of : .
| Function |
Domain |
Range |
Notes |
|
|
|
odd, increasing |
|
|
|
even, U-shaped (a catenary) |
|
|
|
odd, horizontal asymptotes |
Identities
The fundamental identity follows directly from the definitions:
So the point lies on the right branch of the hyperbola , just as lies on the circle. The parameter is not an angle but twice the area swept out between the origin, the curve and the x-axis, which is also true of for the circle.
Other identities have the same shape as trig identities with some signs flipped:
python · try it yourselfimport 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 , which is also how you prove them by hand.
Derivatives
Differentiate the definitions:
Since and , both solve , while and solve . Every solution of is (see Second-Order Linear Equations).
Inverse hyperbolic functions as logarithms
and are one-to-one; is one-to-one on . Because they are built from , their inverses are logarithms. For :
The same method gives
and their derivatives, by implicit differentiation or from the logs:
These are why shows up in Trigonometric Substitution.
python · try it yourselfimport 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 . The last lines show why libraries implement asinh carefully: for the true argument is lost to cancellation and becomes exactly 0.0. Using oddness, , avoids the problem.
The catenary
A flexible cable of uniform weight hanging between two supports takes the shape
where is the ratio of horizontal tension to weight per unit length. Its slope is , and its arc length from 0 to is because . A parabola looks similar near the bottom () but diverges from it further out.
python · try it yourselfimport 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: is a zero-centred activation, and its derivative is cheap to compute from the forward value during backpropagation; it is closely related to the sigmoid, . LSTM cells use 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: is a smooth saturating curve for tone mapping, soft clipping of audio, and easing; hyperbolic geometry (, ) drives hyperbolic tilings and some map projections (the Mercator latitude uses ).
- Physics: relativity's rapidity adds like : velocities , combine as in units of .
Exercises
Exercise 1: Evaluate
Find the exact values of and .
Answer
, .
Solution
Exercise 2: Differentiate
Find and .
Answer
and .
Solution
python · try it yourselfimport 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
Show that .
Answer
Solve for .
Solution
Exercise 4: Cable sag
A cable follows between supports at . How far above its lowest point are the supports, and how long is the cable?
Answer
; .
Solution
python · try it yourselfimport 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 ?
Which identity is correct?
Which expression equals ?