Python math.sinh() Function

Beginner
5 min read
Updated: Nov 2026
3 examples
math module

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.

python
import math

val = math.sinh(x)
CallWhat 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
python
math.sinh(x, /)
# returns: float hyperbolic sine (e**x - e**(-x)) / 2

Parameters

ParameterDescription
xRequired positional real number (int or float).

Return Value

Return ValueDescription
floatHyperbolic sine of x; preserves inf, -inf, -0.0, and nan.

Python Examples

Example 1 — Evaluate Catenary Slopes With math.sinh()

Sample hyperbolic sine across symmetric distances and verify odd symmetry.

python
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}")

How It Works

  1. Odd symmetry visible. Negating x flips the sign of math.sinh(x) identically on both sides of zero.
  2. Exponential climb. Doubling x from one to two more than triples the output from 1.1752 to 3.6269.
  3. 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.

python
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))

How It Works

  1. Hyperbola equation. Just as circular trig satisfies cos**2 + sin**2 == 1, hyperbolic trig satisfies cosh**2 - sinh**2 == 1.
  2. Tolerance check. math.isclose() handles minor floating-point rounding cleanly.
  3. 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.

python
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")

How It Works

  1. Infinite limits. Passing inf and -inf returns inf and -inf without error.
  2. Slightly wider range than exp. Because sinh(x) divides e**x by two, it overflows near 710.47 instead of 709.78.
  3. OverflowError trapped. Finite 1000 raises OverflowError cleanly.

Frequently Asked Questions

The hyperbolic sine (e**x - e**(-x)) / 2 as a float.
No. Hyperbolic functions take real dimensionless values (hyperbolic angles), not circular degrees or radians.
For finite inputs with absolute value larger than roughly 710.4758.
Unlike computing (math.exp(x) - math.exp(-x)) / 2 by hand, math.sinh() switches to a series expansion near zero.
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

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

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