The sinh() function computes the hyperbolic sine of a real number. Built from exponentials—(ex − e−x) / 2—it passes through zero at x = 0 and grows without bound as |x| increases.
01
Hyperbolic
Not circular.
02
math.h
Link with -lm.
03
Any real x
Full domain.
04
sinh(0)=0
Through origin.
05
Odd fn
sinh(−x).
06
vs sin
Different.
Fundamentals
Definition and Usage
Hyperbolic sine is defined as sinh(x) = (ex − e−x) / 2, where e is Euler’s number (about 2.718). Unlike circular sin(), which oscillates between −1 and 1, sinh(x) grows smoothly and is unbounded.
The input x is any real number—not a degree or radian angle in the circular sense. Think of it as a hyperbolic parameter. At x = 0, both exponentials cancel and sinh(0) = 0.
💡
Beginner Tip
Do not confuse sinh() with sin(). sin needs radians and returns values in [−1, 1]. sinh takes any real number and grows without limit. The inverse is asinh() for all real outputs.
For very large |x|, result may overflow to ±infinity.
Headers and linking
#include <math.h>
Compile: gcc sinh.c -std=c11 -o sinh -lm
Cheat Sheet
⚡ Quick Reference
Call
Meaning
Result (approx.)
sinh(0)
Origin
0.0
sinh(1)
Standard value
1.175
sinh(1.5)
From reference
2.129
sinh(-1.5)
Odd function
-2.129
asinh(sinh(x))
Inverse pair
x
Forward
sinh(x)
Hyperbolic sin
Inverse
asinh(y)
All real y
Formula
(exp(x)-exp(-x))/2
Exponential
Not this
sin(x)
Circular trig
Hands-On
Examples Gallery
Compile every example with gcc file.c -std=c11 -o out -lm. Hyperbolic functions pair naturally with exp() and cosh().
📚 Getting Started
Compute hyperbolic sine and print the result.
Example 1 — Basic Hyperbolic Sine
Classic example from the reference: sinh(1.5).
C
#include <math.h>
#include <stdio.h>
int main(void) {
double x = 1.5;
double result = sinh(x);
printf("The hyperbolic sine of %.2f is: %.4f\n", x, result);
return 0;
}
📤 Output:
The hyperbolic sine of 1.50 is: 2.1293
How It Works
The library evaluates (e1.5 − e−1.5) / 2 internally and returns about 2.129.
When x = 0, e0 = 1, so sinh(0) = (1 − 1) / 2 = 0. Both sinh and circular sin are zero here—but only here at x = 0 do they share that value by coincidence.
📈 Practical Patterns
Symmetry, exponential formula, and comparison with sin.
Example 3 — Odd Function: sinh(−x) = −sinh(x)
Negative inputs flip the sign—unlike cosh, which is even.
The manual formula matches the library. In production code, prefer sinh()—it handles overflow and precision better than naive exp combinations for extreme values.
Example 5 — sinh() vs sin() at the Same Input
See why these are different functions despite similar names.
C
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
int main(void) {
double vals[] = { 0.0, 1.0, 1.5, M_PI / 2 };
size_t i;
printf(" x sinh(x) sin(x)\n");
for (i = 0; i < 4; i++) {
double x = vals[i];
printf("%5.2f %8.4f %8.4f\n", x, sinh(x), sin(x));
}
return 0;
}
They only agree at x = 0. For other inputs, sinh grows while sin stays in [−1, 1]. Note: 1.57 is π/2 radians (90°) for the last row—sin needs radians; sinh does not.
Applications
🚀 Common Use Cases
Physics and engineering — solutions to differential equations, heat flow.
Special relativity — rapidity and Lorentz transformations use hyperbolic functions.
Signal processing — filter design with hyperbolic kernels.
Finance — models involving exponential growth and decay.
Pair with cosh() — identity cosh²(x) − sinh²(x) = 1.
🧠 How sinh() Works
1
Receive real x
Any finite real number (positive, negative, or zero).
Input
2
Compute exponentials
Evaluate ex and e−x, take half their difference.
Compute
3
Return sinh(x)
Result is a double; unbounded as |x| grows.
Output
=
🔢
Hyperbolic sine
Use asinh(y) to reverse for any real y.
Important
📝 Notes
Defined as (ex − e−x) / 2.
Domain: all real numbers.
sinh(0) = 0; output is unbounded as |x| grows.
Odd function: sinh(-x) == -sinh(x).
Not the same as sin()—no degree/radian conversion needed.
Very large |x| may cause overflow; the library handles this gracefully.
Performance
⚡ Optimization
sinh() is implemented in the platform math library with careful handling of overflow. Avoid rewriting it as (exp(x) - exp(-x)) / 2 in hot loops—direct exp calls can overflow sooner. Use sinhf when float precision is sufficient to save memory bandwidth.
Wrap Up
Conclusion
sinh() computes hyperbolic sine from exponentials, accepts any real input, and passes through zero at x = 0. It is distinct from circular sin() and pairs with asinh() as its inverse.
Continue with sqrt() for square roots, or review cosh() for the partner hyperbolic function.
Expect output bounded in [−1, 1] like circular sine
Assume the input is an “angle in radians” in the trig sense
Rewrite with exp in performance-critical code without profiling
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about sinh()
Hyperbolic sine in C, explained simply.
5
Core concepts
🔢01
Hyperbolic
Not sin().
Basics
📚02
sinh(0)=0
Origin.
Anchor
📈03
Formula
(e^x-e^-x)/2.
Math
📄04
Odd fn
All reals in.
Property
🔄05
Inverse
asinh(y).
Pair
❓ Frequently Asked Questions
sinh() returns the hyperbolic sine of x, computed as (e^x - e^(-x)) / 2. For example, sinh(0) is 0.0 and sinh(1.5) is about 2.129. It is not the same as the circular sine function sin().
Include <math.h> and link with -lm on many systems: gcc program.c -o program -lm. The function is declared as double sinh(double x).
Neither in the usual trig sense. sinh(x) takes any real number x as a hyperbolic argument. You do not convert degrees to radians before calling sinh() the way you do for sin().
sin() is circular trigonometry (input in radians, output in [-1, 1]). sinh() is hyperbolic (input is any real, output unbounded). They share a similar name but solve different math problems.
sinh(0) is exactly 0. At zero, (e^0 - e^0) / 2 = (1 - 1) / 2 = 0. This is the only point where sinh and cosh cross their respective anchor values together.
sinhf(x) takes float and returns float. sinhl(x) takes long double and returns long double. Use the variant matching your variable type.
Did you know?
Hyperbolic functions satisfy cosh²(x) − sinh²(x) = 1—the hyperbolic analogue of the Pythagorean identity sin² + cos² = 1. You can verify it in C with cosh(x)*cosh(x) - sinh(x)*sinh(x) for any x.