Tutorials › Calculus I › Area Between Two Lines

Area Between Curves · Tutorial 1200 of 1495

Area Between Two Lines

Find where two lines meet, identify which graph is higher, and use a definite integral to calculate the triangular or trapezoidal area between them.

Intermediate 9 min read

What You'll Learn

  • Find the intersection of two line graphs by equating their formulas.
  • Determine which line is above the other on a specified interval.
  • Set up the area integral as upper function minus lower function.
  • Derive the trapezoid area formula from the integral of a linear function.
  • Recognize when an intersection at an interval endpoint makes the region triangular.
  • Identify the extra boundary needed to make a finite region.

Why Areas Between Lines Are Manageable

The graphs of two linear functions are straight lines. Between two fixed vertical boundaries, their separation changes at a constant rate, so the region between them is a trapezoid. If the lines meet at one of those boundaries, one end of the region narrows to a point, making a triangle.

To calculate the area, we need to find where the lines meet when that point is relevant, determine which line lies above the other, and integrate the vertical distance between them. This is a particularly direct application of area from vertical slices.

Important: Two distinct lines by themselves do not enclose a finite region. A finite area requires additional boundaries, such as two vertical lines \(x=a\) and \(x=b\), or one vertical line together with the intersection of the two lines.

Finding the Intersection of Two Lines

Write the two linear functions as \(f(x)=m_1x+b_1\) and \(g(x)=m_2x+b_2\). At an intersection, both functions have the same \(y\)-value, so its \(x\)-coordinate satisfies \(f(x)=g(x)\). If the slopes differ, solving this equation gives the unique intersection:

$$ m_1x+b_1=m_2x+b_2 \qquad\Longrightarrow\qquad x=\frac{b_2-b_1}{m_1-m_2}. $$

Substitute this \(x\)-coordinate into either line to obtain the \(y\)-coordinate. If the slopes are equal and the intercepts differ, the lines are parallel and have no intersection. If both slopes and intercepts agree, the graphs are the same line.

An intersection helps locate a boundary and determine where the order of the lines changes. But the intersection alone does not enclose an area: a further boundary is still needed. For the areas considered here, the interval endpoints or an axis provide that boundary.

Setting Up the Area Integral

Suppose the region lies between the graphs on \(a\le x\le b\), and \(f(x)\ge g(x)\) throughout this interval. A vertical slice has height \(f(x)-g(x)\). Adding the slice areas gives:

$$ A=\int_a^b \bigl(f(x)-g(x)\bigr)\,dx. $$

The order matters: the upper function goes first. If instead \(g(x)\ge f(x)\) throughout the interval, the area is \(\int_a^b(g(x)-f(x))\,dx\). The area is nonnegative because each slice has nonnegative height.

For two lines, the difference \(h(x)=f(x)-g(x)\) is also linear. If the lines meet at an endpoint, the gap there is zero. If they do not meet within the interval, their order remains fixed there, and the two endpoint gaps give the parallel sides of a trapezoid.

Why the Trapezoid Formula Follows

The area between two ordered lines on \([a,b]\) is the integral of their gap \(h(x)\). Let the endpoint gaps be \(h(a)\) and \(h(b)\), both nonnegative. Since \(h\) is linear, its value at any point is the linear interpolation between those endpoint values:

$$ h(x)=h(a)+\frac{h(b)-h(a)}{b-a}(x-a). $$

Integrating this expression over the interval proves the trapezoid formula:

$$ \begin{aligned} A &=\int_a^b h(x)\,dx\\ &=(b-a)h(a) +\frac{h(b)-h(a)}{b-a}\int_a^b(x-a)\,dx\\ &=(b-a)h(a) +\frac{h(b)-h(a)}{b-a}\cdot\frac{(b-a)^2}{2}\\ &=\frac{b-a}{2}\bigl(h(a)+h(b)\bigr). \end{aligned} $$

Thus the area equals the horizontal width times the average of the two endpoint heights. When one endpoint gap is zero, this becomes the triangle formula: one-half the base times the height.

Theorem: If the vertical gap between two lines is nonnegative throughout \([a,b]\), their enclosed area between \(x=a\) and \(x=b\) is \(A=\frac{b-a}{2}\bigl(h(a)+h(b)\bigr)\), where \(h(x)\) is the upper line minus the lower line. This is the trapezoid formula; if \(h(a)=0\) or \(h(b)=0\), the region is triangular.

Worked Example: A Trapezoid Between Two Lines

Worked Example: A Trapezoid Between Two Lines

Find the area between \(f(x)=2x+1\) and \(g(x)=-x+8\) from \(x=0\) to \(x=2\). First check their intersection:

$$ 2x+1=-x+8 \quad\Longrightarrow\quad 3x=7 \quad\Longrightarrow\quad x=\frac{7}{3}. $$

The intersection lies to the right of the interval because \(\frac{7}{3}>2\). On \([0,2]\), the gap \(g(x)-f(x)=7-3x\) is at least \(7-3(2)=1\), so \(g\) is above \(f\). The area is:

$$ \begin{aligned} A &=\int_0^2\bigl(g(x)-f(x)\bigr)\,dx\\ &=\int_0^2(7-3x)\,dx\\ &=\left[7x-\frac{3}{2}x^2\right]_0^2\\ &=(14-6)-0\\ &=8. \end{aligned} $$

Check the geometry using the endpoint gaps: \(g(0)-f(0)=8-1=7\), and \(g(2)-f(2)=6-5=1\). The trapezoid formula gives \(\frac{2}{2}(7+1)=8\), agreeing with the integral.

Worked Example: An Intersection at an Endpoint

Worked Example: An Intersection at an Endpoint

Find the area between \(f(x)=2x-1\) and \(g(x)=-x+5\) from their intersection to \(x=4\). Equating the lines gives:

$$ 2x-1=-x+5 \quad\Longrightarrow\quad 3x=6 \quad\Longrightarrow\quad x=2. $$

At \(x=2\), both functions equal \(3\), so the intersection is \((2,3)\). On \([2,4]\), their difference \(f(x)-g(x)=3x-6\) is nonnegative. Therefore \(f\) is above \(g\), and:

$$ \begin{aligned} A &=\int_2^4(3x-6)\,dx\\ &=\left[\frac{3}{2}x^2-6x\right]_2^4\\ &=(24-24)-(6-12)\\ &=0-(-6)\\ &=6. \end{aligned} $$

At \(x=2\), the gap is zero. At \(x=4\), the line values are \(f(4)=7\) and \(g(4)=1\), so the gap is \(6\). The region is a triangle with horizontal base \(4-2=2\) and vertical height \(6\); its area is \(\frac12(2)(6)=6\), as checked against the integral.

Worked Example: Two Lines and the \(y\)-Axis

Worked Example: Two Lines and the \(y\)-Axis

Find the finite area bounded by \(f(x)=2x+4\), \(g(x)=-x+1\), and the \(y\)-axis. The \(y\)-axis is the boundary \(x=0\). First find where the two lines meet:

$$ 2x+4=-x+1 \quad\Longrightarrow\quad 3x=-3 \quad\Longrightarrow\quad x=-1. $$

Substitution gives \(f(-1)=2\) and \(g(-1)=2\), so the intersection is \((-1,2)\). The region runs from \(x=-1\) to \(x=0\). On that interval, \(f(x)-g(x)=3x+3\ge 0\), so \(f\) is above \(g\). Its area is:

$$ \begin{aligned} A &=\int_{-1}^0(3x+3)\,dx\\ &=\left[\frac{3}{2}x^2+3x\right]_{-1}^0\\ &=0-\left(\frac{3}{2}-3\right)\\ &=\frac{3}{2}. \end{aligned} $$

The gap at the intersection is zero, and the gap at \(x=0\) is \(f(0)-g(0)=4-1=3\). The horizontal width is \(1\), so the triangular area is \(\frac12(1)(3)=\frac32\). This confirms the integral result.

A Common Mistake: Reversing the Difference

A frequent error is to subtract the upper function from the lower one. For example, in the first worked example, using \(f-g\) instead of \(g-f\) gives:

$$ \int_0^2\bigl(f(x)-g(x)\bigr)\,dx =\int_0^2(3x-7)\,dx =\left[\frac{3}{2}x^2-7x\right]_0^2 =6-14=-8. $$

This is a signed integral, not the geometric area: the integrand is negative throughout the interval. The correction is to check which graph is higher and subtract lower from upper. Here \(g\) is higher, so the area is \(\int_0^2(g-f)\,dx=8\), consistent with the positive trapezoid area.

A Reliable Procedure

1
Identify the boundaries.
Specify the interval or other boundary that closes the region. Two lines alone do not enclose a finite area.
2
Find the intersection if needed.
Set the line formulas equal, solve for \(x\), and substitute to find \(y\).
3
Determine the order.
Compare the functions on the interval, using their difference or a test value when appropriate.
4
Integrate upper minus lower.
Evaluate the definite integral, then check the result against the endpoint gaps and the region's geometry.

If the lines cross inside the chosen interval, their order is not fixed across the whole interval. A single integral of one line minus the other would then include a negative part. The area must instead be handled on intervals where the order is fixed; the examples here use intervals with a fixed order.

Check Your Understanding

For each question, identify the boundaries and the upper graph before calculating.

  1. Find the intersection of \(y=3x+2\) and \(y=-x+10\).
  2. On \(0\le x\le 2\), which line is above: \(y=x+4\) or \(y=-2x+7\)?
  3. What geometric shape results when the gap between two lines is zero at one endpoint of the interval?
  4. Calculate the area between \(y=2x+1\) and \(y=-x+7\) on \(0\le x\le 1\).
  5. Why do two nonparallel lines, without any additional boundaries, fail to enclose a finite region?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon