Enter your function and bounds
Type a function f(x) using standard math syntax (examples: x^2, sin(x),
exp(-x), sqrt(x), 1/(1+x^2)). Then choose your interval [a, b]
and a numeric method.
Compute a definite integral (numeric approximation) for any smooth-ish function f(x) on an interval [a, b]. Pick Simpson’s Rule (recommended), Trapezoid, or Midpoint, preview the steps, then save or share your result.
Type a function f(x) using standard math syntax (examples: x^2, sin(x),
exp(-x), sqrt(x), 1/(1+x^2)). Then choose your interval [a, b]
and a numeric method.
An integral is calculus’ way of saying “add up a lot of tiny pieces.” If you can slice something into tiny parts and add those parts, you can model it with an integral. That “something” might be geometric area, total distance traveled, accumulated probability, total energy, or even the total “effect” of a changing rate.
The most common thing people mean by “integral” is the definite integral: ∫ab f(x) dx. You can read it as: “Add up the values of f(x) from a to b, using an infinitesimally small width dx.”
A subtle but important detail: the definite integral is a signed area. When the graph of f(x) is above the x-axis, it contributes positive area; when it’s below, it contributes negative area. That’s not a bug — it’s often the exact behavior you want (for example, positive vs negative velocity).
But sometimes you want total area regardless of sign. That’s why this page includes an option to compute ∫ |f(x)| dx, often called “area under the curve.”
Some functions have clean, symbolic antiderivatives you can write down. Many don’t — and even when they do, the algebra can be messy. Numerical integration is the practical workaround: split the interval into n slices, evaluate the function at strategic points, and combine those values with a formula that mimics “adding up thin pieces.”
First we compute the step size: h = (b − a) / n. Then we use one of these widely used methods:
Simpson’s Rule approximates the curve using small parabolas. For smooth functions it can be very accurate. It uses a repeating weight pattern 1, 4, 2, 4, 2, …, 4, 1 and requires n to be even.
∫ab f(x) dx ≈ (h/3) [ f(x₀) + 4f(x₁) + 2f(x₂) + … + 4f(xₙ₋₁) + f(xₙ) ]
The trapezoidal rule draws straight lines between sample points, turning each slice into a trapezoid:
∫ab f(x) dx ≈ (h/2) [ f(x₀) + 2f(x₁) + 2f(x₂) + … + 2f(xₙ₋₁) + f(xₙ) ]
Midpoint uses the function value at the center of each subinterval: ∫ab f(x) dx ≈ h · Σ f(a + (i+0.5)h)
Bottom line: integrals feel “advanced,” but the idea is simple: tiny slices + adding = integral. This calculator automates the slicing and adding so you can focus on the meaning.
Use x^2, a=0, b=2, Simpson, n=100. The exact answer is 8/3 ≈ 2.6667.
This is a perfect “does my calculator work?” test.
Use sin(x), a=0, b=pi. The area should be 2.
Great for testing constants (pi) and trig.
Use 1/(1+x^2), a=0, b=1. The exact value is π/4 ≈ 0.7854.
Another excellent sanity check.
Use exp(-x^2), a=0, b=1. There’s no elementary antiderivative here, which is exactly why numeric integration exists.
Try trapezoid with a larger n (like 400–800) and compare to Simpson.
Use sin(x), a=-pi, b=pi. The signed integral is 0 (perfect cancellation).
Switch Output to “Area under curve” to get a positive total.
2*x not 2x.1/(1+x^2) not 1/1+x^2.sin(), cos(), tan(), sqrt(), abs(), ln(), exp().Want a quick “viral flex”? Compute an integral and post your step preview table as a screenshot with “Can you guess the function?” — people love the puzzle.
A definite integral adds up f(x) over a specific interval [a, b] and returns a number (area, total change, accumulation). An indefinite integral produces a family of antiderivatives: ∫ f(x) dx = F(x) + C. This calculator focuses on definite integrals using numerical methods, which works even when no simple antiderivative exists.
Because the default definite integral is a signed area. Wherever f(x) is below the x-axis, it contributes negative area. If you want total area regardless of sign, switch Output to Area under curve (∫ |f(x)| dx).
For most smooth functions, Simpson’s Rule is the best default because it usually gives higher accuracy with the same number of slices. Trapezoid is a reliable baseline. Midpoint can be a great “quick check” too.
Increase n and see whether the result stabilizes. Another simple check is to compute with Simpson and Trapezoid. If they converge as n grows, you’re likely close to the true value.
n is the number of subintervals (slices). More slices means more function evaluations and typically better accuracy. For Simpson’s Rule, n must be even — the calculator will automatically adjust if you enter an odd value.
That usually means the function becomes invalid somewhere between a and b — for example: division by zero, ln of a negative number, or sqrt of a negative number. Try changing the bounds or rewriting the function.
Not in the strict “give me an exact antiderivative” sense. It’s designed for fast, practical numerical answers. Numeric methods are often the right tool in statistics and engineering, especially when no elementary antiderivative exists.
If your function is oscillatory (lots of waves) or has sharp turns, you may need a larger n. Don’t be shy about n=1000 — modern browsers handle it easily.
MaximCalculator provides simple, user-friendly tools. Always treat results as entertainment and double-check any important numbers elsewhere.