Definite Integral Calculator
This calculator evaluates a definite integral of any function you enter over bounds a and b, using Simpson's rule with a precision you can adjust. A definite integral measures the net signed area between a curve and the x-axis over a closed interval. Positive area accumulates where the function sits above the axis; negative area where it dips below. The result is a single number representing that total. Definite integrals appear in virtually every branch of mathematics, physics and engineering: calculating distance from a velocity function, finding total energy from a power curve, computing cumulative probability from a continuous distribution, or working out the volume of a solid of revolution. Symbolic (exact) integration is only possible for certain function families, but numerical methods handle almost any smooth expression. Simpson's rule approximates each segment of the curve with a parabola, making it significantly more accurate than rectangular or trapezoidal methods for the same number of evaluations. You type the function (for example sin(x), x*x or exp(-x*x)), set the lower bound a and upper bound b, and choose the number of subintervals (the default is 100; set it higher for oscillating or steeply curved functions). The step size h is shown so you can assess the granularity of the approximation. The calculator also displays the midpoint value of the function and the interval width, giving you a quick sanity check. Results are numerical approximations suited to students, scientists and engineers who need a reliable quick value. Always verify critical results against a symbolic solution where one exists.
Use PI in your bounds field to enter pi (3.14159...). Enter expressions using standard Math functions: sin, cos, exp, log, sqrt.
How it works
Simpson's rule divides [a, b] into n even subintervals of width h = (b − a) / n. The approximation is (h / 3) × [f(a) + 4f(x1) + 2f(x2) + 4f(x3) + ... + 4f(x_n-1) + f(b)]. Interior points alternate between coefficients 4 and 2. The formula's error term is proportional to (b − a) × h to the power of four, divided by 180, times the maximum of the fourth derivative of f on the interval. With 100 subintervals this is extremely small for typical smooth functions. If you enter an odd number of subintervals the calculator rounds up to the nearest even number automatically.
Worked example
Integrate f(x) = sin(x) from 0 to pi (3.14159265358979) with 100 subintervals. The exact antiderivative is −cos(x), so the exact value is −cos(pi) − (−cos(0)) = 1 − (−1) = 2.0000. The calculator returns 2.0000, the interval width is pi (approximately 3.1416), h is about 0.0314, and the midpoint is pi/2 where sin equals 1. These match the default values pre-filled above.
Related calculators
- Integral Calculator: fixed 1000-subinterval Simpson integration for quick results.
- Derivative Calculator: find the instantaneous rate of change using the central difference method.
- Limit Calculator: numerically estimate a function limit as x approaches a value.
- Sin Cos Tan Calculator: look up all six trig function values for any angle.