Home Python math Functions sinh() Python math.sinh() Function Definition math.sinh(x) returns the hyperbolic sine of x: mathematically (e ** x - e ** (-x)) / 2, returned as a float.
It is an odd function (sinh(-x) == -sinh(x)) that vanishes at zero and grows exponentially for large |x|, raising OverflowError past roughly |x| > 710.47.
math.sinh() is a function in Python's standard math module: import it with import math and call math.sinh(...), or import the name directly with from math import sinh.
Syntax Import math and pass a real number.
import math
val = math.sinh(x) Call What it does math.sinh(0)Returns 0.0. math.sinh(1)Returns approximately 1.175201.... math.sinh(float("-inf"))Returns -inf. math.sinh(1000)Raises OverflowError: result exceeds float range.
Use math.asinh() for the inverse hyperbolic sine; for tiny x near 0, sinh(x) stays accurate without cancellation.
Function signatures math.sinh(x, /)
# returns: float hyperbolic sine (e**x - e**(-x)) / 2 Parameters Parameter Description xRequired positional real number (int or float).
Return Value Return Value Description floatHyperbolic sine of x; preserves inf, -inf, -0.0, and nan.
Python Examples 1. Cable slope values 2. Hyperbolic identity 3. Inf and overflow Example 1 — Evaluate Catenary Slopes With math.sinh() Sample hyperbolic sine across symmetric distances and verify odd symmetry.
import math
for x in [-2.0, -1.0, 0.0, 1.0, 2.0]:
val = math.sinh(x)
print(f"x={x:+4.1f} -> sinh={val:+7.4f}") x=-2.0 -> sinh=-3.6269
x=-1.0 -> sinh=-1.1752
x=+0.0 -> sinh=+0.0000
x=+1.0 -> sinh=+1.1752
x=+2.0 -> sinh=+3.6269 How It Works Odd symmetry visible. Negating x flips the sign of math.sinh(x) identically on both sides of zero.Exponential climb. Doubling x from one to two more than triples the output from 1.1752 to 3.6269.Origin crosses zero. At zero, e**0 - e**0 cancels cleanly to 0.0000.Example 2 — Check cosh(x)**2 - sinh(x)**2 == 1.0 Verify the core hyperbolic identity alongside exact exponential differences.
import math
for x in [0.5, 1.5, 3.0]:
diff = math.cosh(x) ** 2 - math.sinh(x) ** 2
print(f"x={x} -> diff isclose 1.0: {math.isclose(diff, 1.0)}")
print(math.sinh(-1.5) == -math.sinh(1.5)) x=0.5 -> diff isclose 1.0: True
x=1.5 -> diff isclose 1.0: True
x=3.0 -> diff isclose 1.0: True
True How It Works Hyperbola equation. Just as circular trig satisfies cos**2 + sin**2 == 1, hyperbolic trig satisfies cosh**2 - sinh**2 == 1.Tolerance check. math.isclose() handles minor floating-point rounding cleanly.Exact negative sign. Comparing sinh(-1.5) with -sinh(1.5) evaluates to True.Example 3 — Inspect Infinite Inputs and Overflow Thresholds Compare infinite inputs that return infinity against finite inputs that raise OverflowError.
import math
print(math.sinh(0), math.sinh(float("inf")), math.sinh(float("-inf")))
try:
math.sinh(1000)
except OverflowError:
print("sinh(1000) exceeds float range") 0.0 inf -inf
sinh(1000) exceeds float range How It Works Infinite limits. Passing inf and -inf returns inf and -inf without error.Slightly wider range than exp. Because sinh(x) divides e**x by two, it overflows near 710.47 instead of 709.78.OverflowError trapped. Finite 1000 raises OverflowError cleanly.Frequently Asked Questions What does math.sinh(x) compute? The hyperbolic sine (e**x - e**(-x)) / 2 as a float.
Are inputs to math.sinh() in radians? No. Hyperbolic functions take real dimensionless values (hyperbolic angles), not circular degrees or radians.
When does math.sinh(x) raise OverflowError? For finite inputs with absolute value larger than roughly 710.4758.
Why does math.sinh(1e-10) avoid cancellation error? Unlike computing (math.exp(x) - math.exp(-x)) / 2 by hand, math.sinh() switches to a series expansion near zero.
What is the inverse of math.sinh()? math.asinh(y), which is defined for all real numbers.
Next: math.sqrt() Return the square root of x as a float.
sqrt() → About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
9 people found this page helpful
Helpful Share Copy link Suggestion