Definite Integral Calculator (Numerical)
Evaluate a definite integral numerically to about 13 digits — finite or infinite limits, endpoint singularities like 1/√x — with error estimate and plot.
Limits can be numbers, expressions such as pi/2 or sqrt(2), or inf and -inf.
Checked against mpmath's quad at 40 digits, with each function parsed independently by sympy. Runs in your browser.
How to use
- Enter the integrand as a function of x, e.g. exp(-x^2), x sin(x) or 1/sqrt(x).
- Enter the lower and upper limits — numbers, expressions like pi/2, or inf and -inf.
- If the function has a kink or a jump inside the interval, list those x values as split points. Read the value, its error estimate and the plot.
About this tool
ShowHide
Type a function of x and two limits, and this computes ∫ f(x) dx between them numerically, usually to 13 or more significant digits. It uses double-exponential quadrature (tanh-sinh, and its exp-sinh and sinh-sinh forms for infinite limits), which clusters sample points at the ends of the interval so strongly that integrable singularities there cost nothing extra: ∫₀¹ 1/√x, ∫₀¹ ln x and ∫₀^∞ e^(−x²) all come out to full precision. That holds when the singular endpoint is 0: at any other limit, such as 1/√(1−x²) at x = 1, x cannot get closer to the limit than one rounding step of a double, which caps the result near 8 significant digits, and the tool flags it as not fully converged. Substituting u = 1 − x moves the singularity to 0 and restores the lost digits. Limits can be numbers, constants such as pi/2 or sqrt(2), or inf and -inf. The function is written the usual way — powers with ^, implicit multiplication (2x, x sin(x), (x+1)(x−1)), sin, cos, tan and their inverses, sinh, cosh, tanh, exp, ln for the natural logarithm, log for base 10, log2, sqrt, cbrt and abs, with the constants pi and e. The answer comes with an error estimate and the number of function evaluations, and a plot of the integrand over a finite interval shows what was integrated. What it cannot do deserves equal space. The method expects a smooth integrand between the limits: a kink or a jump inside the interval — abs(x) across 0, a step — slows convergence and costs digits, so enter the location as a split point and each piece is integrated separately. A singularity inside the interval, such as 1/x across 0, is reported rather than integrated. Integrals that only converge conditionally over an infinite range, such as sin(x)/x from 0 to infinity, oscillate too slowly for the method and are flagged as not converged; so is a divergent integral like ∫₀¹ 1/x. The result is a number, not a formula: no antiderivative is found.
Frequently asked questions
How accurate is the result?
For a smooth integrand, and for an integrable singularity at an endpoint that is 0, typically 13 to 15 significant digits — close to the limit of double-precision arithmetic. A singularity at a nonzero endpoint, such as 1/√(1−x²) at x = 1, is limited to about 8 digits by the rounding of x next to the limit; the error estimate reflects that and a warning is shown. The error estimate shown is the change between the last two refinements; when the method has not settled, a warning replaces the usual confidence.
Does it find the antiderivative?
No. It evaluates the integral numerically. That works for integrands with no elementary antiderivative, such as e^(−x²) or sin(x)/x, but it gives a number rather than a formula.
Why do I need split points?
The quadrature assumes the integrand is smooth between the limits. At a kink (abs(x) at 0) or a jump, convergence slows and digits are lost. Splitting the interval there makes each piece smooth again, and the answer recovers full accuracy.
Is log the natural logarithm?
Here ln is the natural logarithm and log is base 10, as on most calculators; log2 and log10 are also available. Write ln(x) for the natural log to avoid surprises.
What happens with a divergent integral?
An integral such as ∫₀¹ 1/x has no finite value; the successive refinements keep growing, the method does not converge, and the tool says so instead of presenting the last partial sum as an answer. A function that is infinite inside the interval is reported with the location.
Related tools
CSS Cubic-Bezier Curve Generator
Drag the control points to design a CSS easing curve — preview the motion live, copy the cubic-bezier() value.
Color & CSS
Circle Calculator
Enter any one of radius, diameter, circumference or area, and instantly get the other three — with the formulas shown.
Math & Statistics
Descriptive Statistics Calculator
Paste any list of numbers and instantly get count, mean, median, mode, standard deviation, quartiles, IQR, and more — all computed in your browser.
Math & Statistics
Prime Factorization · GCD · LCM
Factor an integer into primes, list all divisors, and compute GCD and LCM of two numbers. Handles values up to ~10¹².
Math & Statistics
Combinations & Permutations Calculator
Compute nCr and nPr, with and without repetition, plus factorials — exact arbitrary-precision integers for probability, lottery odds and combinatorics.
Math & Statistics
Right Triangle Calculator
Solve a right triangle from any two sides — get the third side, both acute angles, area and perimeter using the Pythagorean theorem.
Math & Statistics