Numerical Methods at work

Disclaimer:
Permission to use, copy, and distribute this software, and It’s documentation for any non-commercial purpose is hereby granted without fee, provided: THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL Henrik Vestermark, BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Numerical Integration

This web calculator performed numerical integration using well-known numerical integration methods:
  • Trapez
  • Romberg
  • Simpson
  • Fox-Romberg
  • Gauss-Legendre
  • Gauss-Chebyshev
  • Gauss-Kronrod
  • Double Exponential
Image of Numerical integration
Numerical Integration & Graphing. vs. 1.13





Integration Method










  • Results
  • Graphing
  • Convergence
  • Delta-E
  • Help

Help

Explanation: Enter the equation that needs to be displayed and/or integrated. The usual mathematical operators and functions can be used (in JavaScript format): + , - , * , / , ( ) , abs(), acos(), asin(), atan(), atan2(), acosh(), asinh(), atanh(), cos(), cosh() exp(), log(), pow(), sin(), sinh(), sqrt(), tan(), tanh(). The function log() denotes the natural logarithm. For x³, use pow(x,3) or x**3 or x^3.

To perform numerical integration, select one or more integration methods. Different methods are suitable for different types of functions:
  • Trapez, Simpson: Simple methods for smooth functions. Slow for high accuracy.
  • Romberg, Fox-Romberg: High accuracy for smooth functions.
  • Gauss-Legendre: Efficient for smooth analytic functions.
  • Gauss-Chebyshev: Internally maps the interval to [-1,1] and compensates for the Chebyshev weight, so standard integrands f(x) can be used.
  • Gauss-Kronrod (adaptive): Automatically refines difficult regions. Good for localized peaks and non-smooth behavior.
  • Double Exponential: Best choice for endpoint singularities and very high accuracy.
For most practical problems, the recommended methods are: Gauss-Kronrod for general use, and Double Exponential for difficult endpoint behavior.

The algorithms aim to reach near double-precision accuracy. To avoid excessive runtime, the number of function evaluations is automatically limited (typically up to around 10⁵ evaluations, depending on the method).

Note: Gauss-Chebyshev is implemented for general integrals on [a,b]. Internally the interval is mapped to [-1,1] and the method compensates for the Chebyshev weight, so you can enter a normal integrand f(x) without dividing by sqrt(1-x²).
The Test button inserts a default equation for demonstration. The interval [0,0.5] contains a singular derivative at x = 0 for sqrt(x), which makes it difficult for Trapez, Simpson, and Romberg to achieve high accuracy. Double Exponential and Gauss-Kronrod handle such cases much better.

Email: hve@hvks.com if you have any questions.
This version has been tested with Edge, Chrome, Firefox, and Safari browsers.

Rate this page

Click on the stars below to rate this page

Low
a Star
a Star
a Star
a Star
a Star
High


Corrections:
25-Jan-2026vs 1.13Removed Gauss-Hermite, replaced it with Gauss-Kronrod. Fixed a bug in Gauss-Chebyshev. Improved the Help section.
6-Feb-2025vs 1.12Disable autocapitalization, autocorrection and spellcheck for the input fields. Furthermore math.js library allows expressions in the input fields.
17-Nov-2023vs 1.11Switch to the Plotly library and remove the display option which is redundant with the Plotly package
8-Nov-2019vs 1.10Redesign the GUI
17-Oct-2019vs 1.9Fixed some display errors in the HTML code.
25-Nov-2011vs 1.8Layout changes and switching to using canvas objects for HTML graphics. Now Print also print the Graphic of the Function, Convergence Power, and Delta-E values
28-May-2011vs 1.7Fixed an issue with prematurely stop of the integration resulting in the wrong result. This was demonstrated with f(x)=x-floor(x) in [0,6.4]
04-May-2011vs 1.6Added Email and rearranged the layout
15-Nov-2009vs 1.5Added Double Exponential integration method
21-May-2007vs 1.4Added Gauss-Hermite integration
17-May-2007vs 1.3Added Gauss-Chebyshev integration and more display options
09-May-2007vs 1.2Added Gauss-Legendre integration method
23-Apr-2007vs 1.1Initial release