Connect via MCP →

Enter Calculation

Supported: + - * / ^, parentheses, x, and functions sin, cos, tan, exp, ln, log, sqrt, abs. Constants pi and e. The result is the absolute area between the two curves (handles crossings automatically).

Formula

Advertisement

Results

Area Between the Two Curves
0.166667
square units
Integration interval [ 0, 1 ]
Method Composite Simpson's rule (n = 2000)
Integrand | f(x) − g(x) |

What is the area between two curves?

The area between two curves f(x) and g(x) over an interval [a, b] is the total region enclosed between their graphs. Mathematically it equals the definite integral of the absolute value of their difference, \(A = \int_a^b |f(x) - g(x)|\,dx\). Using the absolute value guarantees a positive area even when the curves cross or when the "upper" curve becomes the "lower" one somewhere in the interval.

Shaded region between an upper curve and a lower curve over an interval on the x-axis
The area between two curves is the shaded region bounded above by f(x), below by g(x), and on the sides by x = a and x = b.

How to use this calculator

Type each function in terms of x — for example x^2, 2*x+1, sin(x), or 4-x^2. Enter the lower limit a and the upper limit b, then read the area. The tool supports + − * / ^, parentheses, the constants pi and e, and the functions sin, cos, tan, exp, ln, log, sqrt and abs. You do not need to know which curve is on top — the absolute difference is handled for you.

The formula explained

If f(x) ≥ g(x) everywhere on [a, b], the area is simply \(\int_a^b (f - g)\,dx\). When the curves cross, the difference changes sign, so we integrate the absolute value to avoid cancellation. This calculator evaluates the integrand at thousands of points and applies composite Simpson's rule (n = 2000), which gives high accuracy for smooth functions.

Two curves crossing, with two separately shaded regions where each function is on top
When curves cross, the absolute value splits the integral so each region's area stays positive.

Worked example

Find the area between the line y = x and the parabola y = x² on [0, 1]. Here x ≥ x² on that interval, so $$A = \int_0^1 (x - x^2)\,dx = \left[\frac{x^2}{2} - \frac{x^3}{3}\right]_0^1 = \frac{1}{2} - \frac{1}{3} = \frac{1}{6} \approx 0.1667 \text{ square units.}$$

How to Calculate the Area Between Two Curves by Hand

The area between two curves \(f(x)\) and \(g(x)\) over \([a,b]\) is the integral of the absolute vertical distance between them. Because the order of the curves can switch where they cross, you cannot simply integrate \(f-g\) blindly — that introduces sign cancellation. Follow this procedure:

  1. Find the crossing points. Solve \(f(x)=g(x)\) for \(x\) and keep only the solutions lying inside \([a,b]\). These are the points where the upper and lower curves swap roles.
  2. Determine the upper curve on each subinterval. Between consecutive crossings, the difference \(f-g\) keeps one sign. Pick a test point in each piece and evaluate \(f-g\): if positive, \(f\) is on top; if negative, \(g\) is on top.
  3. Split the integral at the crossings. If the curves cross at \(c\) with \(a
  4. Integrate (upper − lower) on each piece. On each subinterval put the larger function first so the integrand is non‑negative:
    $$A_i = \int_{x_{i}}^{x_{i+1}}\big(\text{upper}(x)-\text{lower}(x)\big)\,dx.$$
  5. Sum the absolute areas. Add the pieces: \(A = \sum_i A_i\). Each \(A_i\ge 0\), so there is no cancellation.

The sign-handling detail: the compact formula \(A=\int_a^b |f(x)-g(x)|\,dx\) is exact, but \(\int_a^b (f-g)\,dx\) is not the area when the curves cross. For example, if \(f-g\) is \(+2\) over a width‑1 interval and \(-2\) over the next width‑1 interval, the raw signed integral gives \(2+(-2)=0\), while the true area is \(|2|+|-2|=4\). Splitting at the crossing and taking each piece positively is exactly what the absolute value does.

Key Terms

Definite integral
The value \(\int_a^b h(x)\,dx\), representing the net signed area between the graph of \(h\) and the x‑axis from \(x=a\) to \(x=b\).
Integrand
The function being integrated. For area between curves the integrand is the difference \(f(x)-g(x)\) (or its absolute value).
|f − g| (absolute difference)
The non‑negative vertical gap between the curves at each \(x\). Using the absolute value guarantees the integral measures geometric area rather than canceling positive and negative regions.
Intersection / crossing point
An \(x\)-value where \(f(x)=g(x)\); the curves touch or swap which one is on top. The integral must be split at any crossing inside \([a,b]\).
Bounds a and b
The lower and upper limits of integration that define the horizontal interval over which the area is measured.
Upper / lower curve
On a given subinterval, the upper curve has the larger \(y\)-value; the area integrand is (upper − lower) so it stays non‑negative.
Composite Simpson's rule
A numerical integration method that approximates \(\int_a^b h\,dx\) by fitting parabolas over pairs of subintervals; used when the integrand has no simple antiderivative.
Square units
The dimensional units of an area result. Since area combines a horizontal length with a vertical length, the answer is expressed in units squared.

FAQ

Does it matter which function I put as f and which as g? No. Because the integrand is \(|f - g|\), swapping them gives the same area.

What if the curves cross inside [a, b]? The absolute value automatically accounts for crossings, so the result is the total enclosed area, not a signed difference.

How accurate is the result? Simpson's rule with 2000 subintervals is extremely accurate for continuous functions; results typically match the exact value to many decimal places.

Last updated: