Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Tanh-Sinh nodes returned
10
node/weight pairs (order n = 20)
Effective t_a 4.2
Step size h 0.442105
Sum of all weights 1.9999993431
i t_i Node x_i Weight w_i
1 0.2211 0.3364317911573048 0.6309622363150247
2 0.6632 0.8074765118645584 0.296772693493876
3 1.1053 0.9711342024624363 0.0662076633937352
4 1.5474 0.9982615398799233 0.0059249094153592
5 1.9895 0.9999745093540499 0.0001318520493753
6 2.4316 0.9999999602027466 0.0000003168563807
7 2.8737 0.999999999998166 0.0000000000226176
8 3.3158 1 0
9 3.7579 1 0
10 4.2 1 0
11

What this calculator does

The Tanh-Sinh Quadrature Nodes and Weights Calculator generates the abscissae (nodes) \(x_i\) and matching weights \(w_i\) used by the Tanh-Sinh, or double-exponential (DE), integration rule on the standard interval [-1, 1]. Once you have these pairs you can approximate any definite integral as a simple weighted sum: the integral of f(x) over [-1, 1] is approximately the sum of \(w_i\) times \(f(x_i)\).

Number line from -1 to 1 with quadrature nodes clustering toward the endpoints
Tanh-sinh nodes cluster toward the endpoints of [-1, 1], handling singularities well.

The method and formula

Tanh-Sinh quadrature applies the change of variable \(x = \tanh\!\left(\tfrac{\pi}{2}\sinh t\right)\), which maps the whole real line t onto the open interval (-1, 1). The transformed integrand decays double-exponentially, so the ordinary trapezoidal rule converges astonishingly fast. After truncating t to \([-t_a, t_a]\) and sampling n equally spaced points with step \(h = \tfrac{2 t_a}{n - 1}\), each point gives node and weight as follows:

$$x_i = \tanh\!\left(\tfrac{\pi}{2}\sinh t_i\right), \qquad w_i = \frac{h\,\tfrac{\pi}{2}\cosh t_i}{\cosh^{2}\!\left(\tfrac{\pi}{2}\sinh t_i\right)}$$

where \(t_i = -t_a + (i - 1) h\).

Advertisement
Graph of the tanh-sinh transform x versus t and the bell-shaped weight curve versus t
The double-exponential map x(t) and the rapidly decaying weight w(t) as functions of t.

How to use it

Pick the order n (the number of trapezoid sample points), choose whether \(t_a\) is set automatically from your requested precision or entered manually, and select how many significant digits to display. In auto mode the half-width is \(t_a = \mathrm{round}\!\left[\left(\text{digits} + 1\right)^{0.46},\,1\right]\); for 22 digits this gives the documented default \(t_a = 4.2\). The "Half" option exploits the symmetry \(x_{-i} = -x_i\), \(w_{-i} = w_i\) and returns only the non-negative side; "All" lists every node from near -1 to near +1.

Worked example

With \(n = 3\), manual \(t_a = 4\), and "All" selected: \(h = 8 / 2 = 4\). The three t values are -4, 0, 4. At \(t = 0\), \(x = \tanh(0) = 0\) and \(w = \tfrac{\pi}{2} h = 1.5707963 \times 4 = 6.2831853\). At \(t = \pm 4\) the argument \(\tfrac{\pi}{2}\sinh(4)\) is huge, so x saturates to \(\pm 1\) and the weight underflows to essentially 0. Larger n with a proper \(t_a\) makes the weights sum to about 2, the exact integral of \(f = 1\) over [-1, 1].

FAQ

Why are the end weights nearly zero? The double-exponential decay drives \(\cosh^2\!\left(\tfrac{\pi}{2}\sinh t\right)\) to overflow near the edges, so those weights vanish - that is exactly why the rule is so accurate.

What does "order n" mean here? It is the number of equally spaced trapezoid points across \([-t_a, t_a]\); more points and a suitable \(t_a\) improve accuracy.

Can I integrate over a general interval [a, b]? Yes - rescale: substitute \(x = \tfrac{b - a}{2} x_i + \tfrac{a + b}{2}\) and multiply each weight by \(\tfrac{b - a}{2}\).

Last updated: