Integral Calculator

This calculator numerically evaluates the definite integral of any function you provide, over a lower and upper bound that you set, using Simpson's rule with 1000 subintervals. The definite integral of f(x) from a to b gives you the net signed area between the curve and the x-axis on that interval: positive where the function is above the axis and negative where it falls below. Integration is the reverse process of differentiation and is one of the two fundamental operations of calculus. It appears throughout physics (displacement from velocity, work from force), engineering (signal processing, moment of inertia), statistics (probability from a density function), and finance (continuous compounding models). Symbolic integration is only possible in closed form for certain families of functions, but numerical integration can handle almost any well-behaved expression. Simpson's rule works by dividing your interval into many small pieces, fitting a parabolic arc to each pair of adjacent strips, and summing the results. With 1000 subintervals the method is highly accurate for smooth functions, typically correct to six or more decimal places. You type the function using standard maths notation (for example x*x, sin(x) or exp(-x*x)), set a and b, and the result appears immediately. Supported functions include all standard Math object methods. The tool is suited to calculus students, scientists and engineers who need a quick numerical check. Results are approximations; verify symbolically where an exact answer is needed.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
Advertise on this page
9.000000
∫ f(x) dx from a to b
Interval width3.000000
Subintervals1000
f(a)0.000000
f(b)9.000000

Uses Simpson's rule with 1000 subintervals. Accuracy is very high for smooth continuous functions. Avoid intervals where f(x) is undefined.

How it works

Simpson's rule divides the interval [a, b] into n equal subintervals (n must be even; this calculator uses n = 1000). The step size h = (b − a) / n. The approximation is (h / 3) times the sum of f(a) + 4f(x1) + 2f(x2) + 4f(x3) + ... + 4f(x_n-1) + f(b), where coefficients alternate 4 and 2 for interior points. The error is proportional to h to the power of four, making Simpson's rule far more accurate than the trapezoidal rule for the same number of evaluations. The function is evaluated using JavaScript's Function constructor with Math in scope.

Worked example

Integrate f(x) = x*x from 0 to 3. The exact antiderivative is x cubed divided by 3, so the exact integral is (27 / 3) − (0 / 3) = 9. The calculator returns 9.000000, matching the exact result. f(0) = 0 and f(3) = 9 are shown as supporting figures. These match the default values pre-filled in the calculator above.

Related calculators