Integral Calc
Calculate definite integrals numerically using Simpsons rule with step-by-step formula breakdown. Supports polynomial, trig, and exponential functions.
Use x as the variable. Supports + - * / ^, implicit products (3x, 2(x+1)), sin cos tan asin acos atan sinh cosh tanh exp ln log (base 10) sqrt abs, and the constants pi and e. Example: x^2 - 4*x + 3 or sin(x)*e^(-x).
The starting limit of the definite integral.
The ending limit of the definite integral.
Number of subintervals (2 to 100000). Higher values give more accurate results. Must be even for Simpson's rule (odd values are auto-incremented).
The formula
∫ₐᵇ f(x)dx ≈ (h/3)[f(a) + f(b) + 4 Σ f(x_odd) + 2 Σ f(x_even)], h = (b−a)/n, n even
- f(x)
- Integrand
- a
- Lower limit
- b
- Upper limit
- n
- Subdivisions
- h
- Step size
How Integral Calc Works
∫ₐᵇ f(x)dx ≈ (h/3)[f(a) + f(b) + 4 Σ f(x_odd) + 2 Σ f(x_even)], h = (b−a)/n, n even
Simpson's 1/3 rule is a numerical integration method that approximates the definite integral by fitting quadratic (parabolic) arcs through every three consecutive points on the function. The interval [a, b] is divided into an even number n of equally-spaced subintervals of width h = (b − a) / n. Interior points are weighted alternately by 4 (odd indices) and 2 (even indices), reflecting the underlying quadratic interpolation. This method achieves O(h⁴) accuracy — significantly better than the trapezoidal rule's O(h²) — making it exact for polynomials up to degree 3.
- f(x)
- Integrand — The function to be integrated, expressed in terms of the variable x.
- a
- Lower limit — The starting point of the integration interval.
- b
- Upper limit — The ending point of the integration interval.
- n
- Subdivisions — The number of subintervals used for the numerical approximation. Must be even for Simpson's rule.
- h
- Step size — The width of each subinterval, computed as h = (b − a) / n.
Understanding the Result
Numerical integration is essential when a function has no elementary antiderivative (e.g., e^(−x²), sin(x)/x) or when only discrete data points from experiments or sensors are available. Simpson's 1/3 rule is one of the most widely used Newton–Cotes formulas for numerical integration. It works by dividing the interval [a, b] into an even number n of subintervals of equal width h = (b − a) / n. Over each pair of adjacent subintervals (three points: x_{i−1}, x_i, x_{i+1}), the function is approximated by a quadratic (degree-2) Lagrange interpolating polynomial.
The area under each quadratic segment is then computed exactly via analytical integration and summed to produce the total approximation. The error term for Simpson's rule is −(b − a)h⁴ / 180 × f⁽⁴⁾(ξ) for some ξ in (a, b), provided f is four times continuously differentiable. This means the method is exact for polynomials up to degree 3 (cubic), and doubling n reduces error by roughly a factor of 16 — much faster than the trapezoidal rule (factor of 4).
However, Simpson's rule can produce poor results for functions with sharp peaks, discontinuities, or rapid oscillations within the interval. In such cases, adaptive quadrature methods (which concentrate subdivisions where the function varies most) may be preferred. The calculator provides both Simpson and trapezoidal results so you can assess the reliability of the approximation: a large discrepancy between the two suggests the result should be treated with caution, or that more subdivisions are needed.
How to Use
- Enter the function f(x) using x as the variable. Use ^ for powers (e.g., x^2 for x squared), parentheses for grouping (e.g., (x^2 + 1) / (x - 1)); products such as 3x or 2(x+1) may omit the * sign.
- Enter the lower bound a and upper bound b to define the integration interval. The calculator automatically sorts a and b so lower ≤ upper.
- Optionally adjust the number of subdivisions n (default 100). Use higher values (e.g., 500–1000) for greater accuracy, especially for oscillatory functions.
- The result shows the approximate integral using Simpson's rule, along with the trapezoidal rule result for comparison and an estimated error (from the change when n is doubled). A small discrepancy between the methods indicates high confidence in the result.
- The step-by-step work panel breaks down the computation: step size h, endpoint values, sums of odd/even terms, and the final Simpson formula application.
Quick Reference
| ∫ x² dx from 0 to 1 | 1/3 ≈ 0.33333 |
| ∫ 1 dx from 0 to 5 | 5 |
| ∫ x dx from 0 to 2 | 2 |
| ∫ (3x² + 2x) dx from 0 to 3 | 36 |
Frequently Asked Questions
- Why must the number of subdivisions be even?
- Simpson's 1/3 rule fits a quadratic polynomial through every three consecutive sample points (two adjacent subintervals). This requires an even total number of subintervals. If you enter an odd value, the calculator automatically increments it by 1 to make it even.
- How does Simpson's rule compare to the trapezoidal rule?
- Simpson's rule is significantly more accurate for smooth functions. The trapezoidal rule uses straight-line segments (linear interpolation) between points, giving error O(h²). Simpson's rule uses parabolic arcs (quadratic interpolation), giving error O(h⁴). For most smooth functions, Simpson's rule achieves the same accuracy with far fewer subdivisions.
- What does the method discrepancy tell me?
- The trapezoidal rule converges more slowly than Simpson's rule, so the discrepancy mostly measures the trapezoidal error. If the two agree closely you can be confident; a large discrepancy suggests high curvature or irregularities. For Simpson's own accuracy use the "Estimated error" row (the change when n is doubled and quadrupled, scaled by the observed convergence order). Increase n or split the interval at points of rapid change.
- What happens if my function has a singularity inside the interval?
- Numerical integration methods including Simpson's rule assume the function is finite and well-behaved throughout [a, b]. If your function has a division by zero, vertical asymptote, or discontinuity within the interval, the result will be inaccurate or NaN. Consider splitting the interval at the singularity or using an improper integral technique.
- Can I integrate exponential or trigonometric functions?
- Yes. Trigonometric (sin, cos, tan and inverses), hyperbolic, exponential (e^x, a^x), logarithmic (ln, log base 10), sqrt and abs are all supported, along with the constants pi and e, e.g. sin(x)*e^(-x) or 1/(1+x^2). The calculator is numerical: it gives a decimal value, not an antiderivative.
Common Uses
- •Computing areas under curves in physics (e.g., work from force–distance graph, displacement from velocity)
- •Calculating probabilities and cumulative distribution functions in statistics
- •Determining total accumulated quantities in engineering (charge, energy, fluid volume)
- •Verifying analytic integration done by hand in calculus coursework
- •Computing arc lengths, volumes of revolution, and centroids in geometry
Cite this calculator
TheCalcUniverse. "Integral Calculator — Compute Definite Integrals Numerically." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/integral-calculator/. Accessed October 25, 2026.
Embed this calculator on your site
You may also like
-
Mathematics
Derivative Calc
Compute derivatives of polynomial expressions using the power rule. Get step-by-step differentiation and evaluate at any point.
Open calculator → -
Mathematics
Limit Calc
Compute limits of functions as x approaches any value. Evaluate left-hand, right-hand, and two-sided limits with approach tables.
Open calculator → -
Mathematics
Taylor Series
Compute Taylor series of common functions like e^x, sin(x), cos(x) around any center point. Adjust the expansion order for accurate polynomial approximation.
Open calculator → -
Mathematics
Area & Perimeter
Calculate area and perimeter for seven shapes: circle, rectangle, square, triangle, trapezoid, parallelogram, and hexagon. Includes interactive diagrams.
Open calculator → -
Mathematics
Factoring Calc
Factor quadratic polynomials (ax² + bx + c) into their factored form with step-by-step work. Find the factors and zeros of any quadratic expression.
Open calculator →