Integral Calc
Calculate definite integrals numerically using Simpsons rule with step-by-step formula breakdown. Supports polynomial, trig, and exponential functions.
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.
How to Use
- Enter the function f(x) using x as the variable. Use ^ for powers (e.g., x^2 for x squared), * for explicit multiplication, and parentheses for grouping (e.g., (x^2 + 1) / (x - 1)).
- 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. A small discrepancy between the two 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 |
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
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.
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 discrepancy between Simpson and trapezoidal results gives a rough error estimate. If the two methods agree closely (discrepancy < 0.001), you can have high confidence. A large discrepancy suggests the function has high curvature or irregularities — try increasing n or breaking 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 — the basic expression parser supports standard arithmetic operators (+, -, *, /, ^) and parentheses. For example, you can integrate e^x by entering e^x if your expression uses Euler's number... wait, the basic parser does not support the constant "e" or "sin"/"cos". For those, see the Limit Calculator which supports trigonometric and exponential functions.
Cite this calculator
TheCalcUniverse. "Integral Calculator — Compute Definite Integrals Numerically." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/integral-calculator/. Accessed July 27, 2026.
Embed this calculator on your site
You may also like
-
Derivative Calc
Compute derivatives of polynomial expressions using the power rule. Get step-by-step differentiation and evalu…
-
Limit Calc
Compute limits of functions as x approaches any value. Evaluate left-hand, right-hand, and two-sided limits wi…
-
Taylor Series
Compute Taylor series of common functions like e^x, sin(x), cos(x) around any center point. Adjust the expansi…
-
Area & Perimeter
Calculate area and perimeter for seven shapes: circle, rectangle, square, triangle, trapezoid, parallelogram, …