Trigonometry
Hyperbolic Functions
19th-century engineers computed cable and chain shapes by hand and arrived at the catenary cosh(x/a). Today the same tanh(x) function is a standard activation in neural networks, from vanilla RNNs to LSTMs. And the softmax function in transformers is a multidimensional generalization of the same idea: normalizing through exponentials. Hyperbolic functions connect bridge engineering to deep learning.
- **Neural networks:** tanh(x) is the classical LSTM and GRU activation, with range (−1, 1) and a convenient derivative 1−tanh²x
- **Bridge engineering:** a suspension cable hangs as a catenary y = a·cosh(x/a), not a parabola; the 5% error matters at long spans
- **Special relativity:** rapidity (velocity expressed as a hyperbolic angle) is arctanh(v/c)
Предварительные знания
Definitions of sinh, cosh, tanh
Trigonometric functions parameterize points on the unit **circle** x² + y² = 1: x = cos t, y = sin t. Hyperbolic functions parameterize the **hyperbola** x² − y² = 1: x = cosh t, y = sinh t. Both are defined through exponentials.
**Hyperbolic function definitions:** sinh x = (eˣ − e⁻ˣ) / 2 (odd function) cosh x = (eˣ + e⁻ˣ) / 2 (even function) tanh x = sinh x / cosh x = (eˣ − e⁻ˣ) / (eˣ + e⁻ˣ)
| Property | Trigonometric | Hyperbolic |
|---|---|---|
| Core identity | cos²x + sin²x = 1 | cosh²x − sinh²x = 1 |
| Derivative of sin/sinh | cos x | cosh x (no minus!) |
| Derivative of cos/cosh | −sin x | sinh x (no minus!) |
| Range of sin/sinh | [−1, 1] | (−∞, +∞) |
| Range of tanh | (−1, 1) | (−1, 1) |
| Parity of cosh/cos | even | even |
| Parity of sinh/sin | odd | odd |
How does the range of tanh(x) differ from the range of tan(x)?
Identities and Derivatives
Hyperbolic identities mirror trigonometric ones with characteristic sign changes. The key: cosh²x − sinh²x = 1 (minus instead of plus). Derivatives: sinh' = cosh and cosh' = sinh - no minus sign, unlike d/dx cos x = −sin x.
**Osborn's rule:** to convert a trigonometric identity to its hyperbolic counterpart, replace cos→cosh, sin→i·sinh (equivalently: change sign whenever a product of two sinh terms appears). For example: cos²x + sin²x = 1 becomes cosh²x − sinh²x = 1.
What is the derivative of cosh x?
Inverse Hyperbolic Functions and the Catenary
Inverse hyperbolic functions are expressed through logarithms - the key difference from inverse trigonometric functions. arcsinh, arccosh, arctanh exist as named functions, but computers compute them using ln.
**Inverse hyperbolic functions via logarithms:** arcsinh x = ln(x + √(x²+1)), x ∈ (−∞, +∞) arccosh x = ln(x + √(x²−1)), x ≥ 1 arctanh x = ½·ln((1+x)/(1−x)), |x| < 1
The catenary is the shape a heavy cable hangs in between two supports. It's not a parabola (as Galileo believed). The catenary equation is y = a·cosh(x/a), where a is a tension parameter. Suspension bridges, power lines, hanging chains - all described by cosh.
In neural networks, tanh(x) is a popular activation because its range (−1, 1) is centered around zero. Unlike the logistic sigmoid (range (0, 1)), tanh has zero mean, which tends to speed up gradient descent convergence.
The shape of a hanging heavy cable is described by:
Key Ideas
- **Definitions:** sinh x = (eˣ−e⁻ˣ)/2, cosh x = (eˣ+e⁻ˣ)/2, tanh x = sinh x / cosh x
- **Core identity:** cosh²x − sinh²x = 1 (minus instead of plus, compared to sin²+cos²=1)
- **Derivatives without extra signs:** (sinh)' = cosh, (cosh)' = sinh, (tanh)' = 1/cosh²x
- **Inverses via logarithm:** arcsinh x = ln(x+√(x²+1)); **catenary** y = a·cosh(x/a) - not a parabola
Related Topics
Hyperbolic functions connect analysis, physics, and machine learning:
- Euler's Formula — The bridge: cosh x = cos(ix) and sinh x = −i·sin(ix) - hyperbolic and trig functions are the same with an imaginary argument
- Trigonometry in Physics — Damped oscillations: e^(−αt)·cos(ωt); when α > ω the motion is overdamped and described by sinh and cosh instead
- Trigonometry in Graphics and Signals — tanh appears in early attention mechanisms and gating, while RoPE uses cos/sin positional encoding
Вопросы для размышления
- tanh(x) and the logistic sigmoid σ(x) = 1/(1+e⁻ˣ) look similar. How are they related algebraically? When is one preferable over the other as an activation function?
- Sketch or mentally visualize the graphs of sinh x, cosh x, tanh x. What differences from sin x, cos x, tan x stand out most directly at first glance?
- Why is the catenary a cosh and not a parabola? What physically distinguishes a hanging cable from a projectile trajectory?