Area Under the Curve (Definite Integrals) Math

∫ f(x) dx = ---
ab f(x) dx = --

What is the Area Under the Curve Calculator?

Quick Answer: An interactive tool that computes the definite integral of a function f(x) over an interval [a, b] using high‑accuracy numerical integration (Simpson's rule). It shades the signed area between the curve and the x‑axis and displays the integral value. Great for visualising integration concepts.

Theory of Definite Integrals

The definite integral of a function f(x) from a to b represents the signed area enclosed by the curve, the x‑axis, and the vertical lines x = a and x = b. The fundamental theorem of calculus links integration to antiderivatives. Here we use Simpson's 1/3 rule to approximate the integral numerically when an antiderivative is not known:
ab f(x) dx ≈ (h/3)[f(x0) + 4f(x1) + 2f(x2) + ... + f(xn)]
where h = (b-a)/n and n is even. The tool uses n = 200 intervals for smooth accuracy. The visual shades the region: green for positive area (above x‑axis), red for negative area (below x‑axis), and displays the net signed area.

Step-by-Step Examples

Example 1: Integral of x² from 0 to 3

  1. Enter f(x) = x^2, a = 0, b = 3. Click Compute.
  2. The exact value is 9. The numerical result will be very close (e.g., 9.0000). The shaded region under the parabola is shown in green.

Example 2: Sine wave over a full period

  1. f(x) = sin(x), a = 0, b = 2*pi (6.283).
  2. The positive and negative areas cancel, giving a net integral near 0. The visual shows green above the axis and red below.

Example 3: Exponential decay

  1. f(x) = exp(-x), a = 0, b = 5. The integral is approximately 1 - e-5 ≈ 0.9933.

Frequently Asked Questions

How accurate is the numerical integration?

We use Simpson's rule with 200 subintervals, which gives excellent accuracy for smooth functions. For rapidly oscillating functions, error may increase.

What does negative area mean?

Area below the x‑axis is counted as negative. The tool shades it red. The net integral is the algebraic sum of green (positive) and red (negative) regions.

Can I use functions like sin, cos, exp, log?

Yes, you can use any Math.js expression, e.g., sin(x) + cos(2*x), log(x) for x>0, abs(x), etc.

Why does the shading not reach the x‑axis exactly?

The shading is drawn between the curve and the x‑axis using vertical strips. The resolution is limited by the canvas; the integral value is computed separately.

Is this the same as the Riemann sum visualizer?

No, the Riemann sum tool shows rectangles approximating the area. This tool computes the exact numeric integral (via Simpson's rule) and shades the true region, not rectangles.