Numerical Integral Calculator
Approximate a definite integral using Simpson's rule.
What is a definite integral?
A definite integral measures the area between a curve and the x-axis, from a starting value a to an ending value b. If a derivative is about the slope at a point, an integral is about the accumulated total across a range. It answers questions like the total distance covered when you know the speed at every moment.
$$\int_a^b f(x)\,dx$$
This calculator finds that area numerically using Simpson's rule, which fits small parabolic arcs to the curve. Parabolas hug a curve more closely than straight lines, so the estimate is accurate even with relatively few segments.
How to use this calculator
- Enter the function you want to integrate, such as \(x^2+1\) or \(\sin(x)\).
- Type the lower limit \(a\) and upper limit \(b\) of the definite integral.
- Choose or confirm the number of subintervals, which must be even for Simpson's rule.
- Click calculate to get the approximate integral value and, if needed, compare it with the displayed steps or formula.
The formula explained
The definite integral \(\int_a^b f(x)\,dx\) computes the signed area between the graph of \(f(x)\) and the x-axis from \(a\) to \(b\). Simpson's rule estimates that area by fitting parabolas over pairs of subintervals, which often gives a better approximation than simple rectangles.
- f(x) = the function being integrated
- a = the lower limit of integration
- b = the upper limit of integration
- n = the number of equal subintervals, which must be even for Simpson's rule
- h = the width of each subinterval, \(h=(b-a)/n\)
Step by step method
- Split the interval \([a,b]\) into an even number \(n\) of equal parts, so each part has width \(h=(b-a)/n\).
- Evaluate the function at the endpoints and at each interior point \(x_1, x_2, \dots, x_{n-1}\).
- Apply Simpson's rule: \(\int_a^b f(x)\,dx \approx \frac{h}{3}[f(x_0)+4f(x_1)+2f(x_2)+\cdots+4f(x_{n-1})+f(x_n)]\).
Worked example
Problem. Approximate \(\int_0^2 (x^2+1)\,dx\) using Simpson's rule with \(n=2\).
- Compute the step size, \(h=(2-0)/2=1\).
- Find the function values: \(f(0)=1\), \(f(1)=2\), and \(f(2)=5\).
- Use Simpson's rule: \(\frac{1}{3}[1+4(2)+5]=\frac{14}{3}\approx 4.667\).
Answer. \(\int_0^2 (x^2+1)\,dx \approx 4.667\)
Tips and common mistakes
- Simpson's rule requires an even number of subintervals, so if your calculator asks for \(n\), choose 2, 4, 6, and so on.
- If the function changes quickly or has a sharp turn, using more subintervals usually improves the approximation.
Frequently asked questions
What is the difference between a definite and an indefinite integral?+
A definite integral has limits and gives a single number, the area over that range. An indefinite integral has no limits and gives a general antiderivative function. This tool computes definite integrals.
Can the area come out negative?+
Yes. Where the curve dips below the x-axis, that region counts as negative area, so a function that spends time below the axis can produce a negative or smaller total. The integral measures signed area.
How accurate is Simpson's rule?+
It is very accurate for smooth functions, often matching the exact answer to many decimal places. Because it approximates the curve with parabolas rather than straight lines, it beats simpler methods like the trapezoidal rule for the same number of segments.
More Mathematics Tools
Explore related calculators in this category
Absolute Value Calculator
Calculate the absolute value of any number. Use this free calculator for fast, accurate answers, complete with the formula and a worked example.
Absolute Value Equation Solver
Solve equations of the form |ax + b| = c.
Adding Fractions Calculator
Add two fractions with step-by-step simplification.
One-Way ANOVA Calculator
Perform one-way ANOVA on multiple groups.
You Might Also Like
Popular tools from other categories
AC to DC Converter Calculator
Convert AC voltage to DC voltage for different rectifier configurations. Free online calculator with instant, step-by-step results.
Acid-Base Titration Calculator
Calculate concentration from titration data. Get quick, accurate results with this free online calculator, including formulas and worked examples.
ABV Calculator
Calculate alcohol by volume from original and final gravity. Free calculator with instant calculations, the underlying formula, and an easy-to-follow example.
Amortization Schedule Calculator - Free Online
Free Generate a complete amortization schedule. Step-by-step solutions and formulas included. Free, accurate results with step-by-step explanations.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.