1. Area Between Curves Calculator — Theory
This tool computes the (positive) area between two curves over an interval by integrating the
absolute difference. It supports both vertical slices (integrate in \(x\)) and horizontal slices
(integrate in \(y\)), and it splits the interval at intersection points so the “top minus bottom”
(or “right minus left”) choice stays correct.
1) The main idea
Suppose two curves are given and you want the area enclosed between them from \(a\) to \(b\).
The key is: on any interval where one curve stays above the other,
the area of a vertical “strip” is just (top − bottom)\(\times dx\).
If they cross, you must split the interval at each intersection.
The absolute value ensures a nonnegative area even if \(f(x)-g(x)\) changes sign.
Equivalently, split the interval into pieces where one is above the other and remove \(|\cdot|\).
2) Vertical slices (integrate in \(x\))
Use this when it is easy to write both curves as functions of \(x\):
\(y=f(x)\) and \(y=g(x)\).
-
Find intersections by solving \(f(x)=g(x)\) on \([a,b]\).
These are the points where the “top” curve may change.
-
Split \([a,b]\) at the intersection \(x\)-values.
-
On each sub-interval \([x_i,x_{i+1}]\), decide which is above by checking a midpoint \(x_m\).
-
Integrate top − bottom:
\[
A_i=\int_{x_i}^{x_{i+1}}(\text{top} - \text{bottom})\,dx
\]
-
Add them:
\[
A=\sum_i A_i
\]
Signed area option
If you choose Signed in the calculator, it computes
\(\int_a^b (f(x)-g(x))\,dx\) without absolute value. This can be negative.
3) Horizontal slices (integrate in \(y\))
Sometimes the region is easier if you slice horizontally. Then you describe the curves as
\(x=f(y)\) and \(x=g(y)\), and integrate in \(y\).
On each sub-interval, the “right” boundary is the larger \(x\)-value and the “left” boundary is the smaller:
As with vertical slices, if the curves intersect, you split the \(y\)-interval at those intersection
\(y\)-values.
4) Worked example (classic)
Find the area between \(y=x^2\) and \(y=2x\) from \(x=0\) to \(x=2\).
-
Intersections: solve \(x^2=2x\Rightarrow x(x-2)=0\Rightarrow x=0,2\).
-
On \((0,2)\), test \(x=1\): \(2x=2\) and \(x^2=1\), so \(2x\) is above \(x^2\).
-
Area:
The calculator shows the same steps plus the shaded region on the graph.
5) Why splitting at intersections matters
If curves cross inside \([a,b]\), then “top − bottom” changes at each crossing.
Without splitting, integrating a single difference may subtract areas instead of adding them.
Using \(\big|f-g\big|\) fixes that conceptually, but numerically it is still best to split at intersections
for stability and clearer steps.
Midpoint test (how the tool decides top/bottom)
On each sub-interval \([x_i,x_{i+1}]\), choose a midpoint \(x_m\). If \(f(x_m)\ge g(x_m)\),
then \(f\) is treated as the top curve on that segment; otherwise \(g\) is the top curve.
The same idea applies for y-slices using \(y_m\).
6) Practical notes and limitations
-
Domain issues: If a function is undefined on part of \([a,b]\) (e.g., \(\sqrt{x}\) for \(x<0\)),
the integral on that interval is not valid. Reduce the interval or change slicing.
-
Intersections: The calculator uses a numeric scan + refinement to find intersection points.
Extremely close or highly oscillatory crossings may require a tighter tolerance.
-
Numeric integration: The tool uses adaptive Simpson integration. If the integrand blows up,
narrow the interval or switch mode.
-
Choosing x-slices vs y-slices: Pick the option that makes the region “single valued” and simpler
(no overlapping slices).