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)\).
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\).
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}\).