Topic 6.7

Handle a changing formula

Builds on evaluating at the bounds in the correct order. 8 minutes.

Two formulas, one region

The curve follows \(y = x^2\) from \(x = 0\) to \(x = 2\), and then \(y = 2x\). Both formulas give the height 4 at \(x = 2\), so the two parts meet there.

The teal region lies under the curve from 0 to the orange edge, and the lower graph shows its area. Move the edge past 2 and a second green bracket starts, one for each part of the region.

Between 0 and 2, the region lies under \(x^2\). An antiderivative of \(x^2\) is \(x^3/3\), so this part has area \(\tfrac{2^3}{3} = \cb{\tfrac83}\).

Between 2 and 3, the region lies under \(2x\). It is a trapezoid with parallel sides 4 and 6 and width 1, so its area is \(\cb{5}\).

The total is \(\frac83 + 5 = \frac{23}{3}\). No single formula covers the whole interval, so the region needs two parts.

Cut the region where the formula changes

The curve follows one formula up to the corner and a different one after it. A function like this is a piecewise function.

Move the edge across the corner. A new green bracket starts there, so the region has a part before the corner and a part after it.

Each green bracket shows the area of one part. The two parts fill the region with no gap and no overlap, so their areas add up to the whole area.

Cut at the corner. Then each part lies under one formula, so one antiderivative serves each part, and its rise across the part is the green bracket.

Notation

  1. Cut the interval at the point \(c\) where the formula changes. The function is \(f_1\) to the left of \(c\) and \(f_2\) to the right. The integral runs from \(a\) to the edge \(\cy{b}\).

  2. The integral over the whole interval is the sum of the integrals over the two parts.

    \[\begin{aligned} \int_a^b f(x)\,dx &= \cg{\int_a^c f_1(x)\,dx} \\ &\quad + \cg{\int_c^b f_2(x)\,dx} \end{aligned}\]
  3. An absolute value is also a changing formula. Where the expression inside is negative, \(|u|\) equals \(-u\).

    \[|u| = \begin{cases} u & \text{if } u \ge 0 \\ -u & \text{if } u < 0 \end{cases}\]
  4. For an absolute value, find c by solving for where the expression inside equals 0. Keep only the solutions that lie between the bounds.

  5. Evaluate each part with its own antiderivative and its own two bounds. Then add the two values.

    \[\cg{F_1(c) - F_1(a)} + \cg{F_2(b) - F_2(c)}\]

    Each formula must be continuous on its own part, including the ends.

When it fails

Take \(f(x) = x^2\) up to \(x = 2\) and \(2x\) after it. Use \(x^3/3\), the antiderivative of the first formula, on the whole interval. The red dashed curve shows it, and its rise from 0 to 3 is 9.

The true area is \(\tfrac{23}{3}\). The antiderivative \(x^3/3\) belongs to \(x^2\) only, so it is wrong where the curve follows \(2x\).

Example 1: an absolute value

Evaluate \(\displaystyle\int_{-1}^{3} |2x - 2|\,dx\).

  1. The expression inside is \(2x - 2\). It equals 0 at \(x = 1\), which lies between the bounds, so the graph has a corner there.

  2. For \(x < 1\), the inside is negative, so \(|2x - 2| = 2 - 2x\). For \(x > 1\), it is \(2x - 2\).

  3. Integrate the left part from −1 to 1.

    \[\begin{aligned} \int_{-1}^{1} (2 - 2x)\,dx &= \Big[2x - x^2\Big]_{-1}^{1} \\ &= \cg{1 - (-3) = 4} \end{aligned}\]
  4. Integrate the right part from 1 to 3.

    \[\begin{aligned} \int_{1}^{3} (2x - 2)\,dx &= \Big[x^2 - 2x\Big]_{1}^{3} \\ &= \cg{3 - (-1) = 4} \end{aligned}\]
  5. Add the two parts. As a check, each part is a triangle with base 2 and height 4, so each has area 4.

    \[4 + 4 = \cy{8}\]

Example 2: a parabola inside the absolute value

Evaluate \(\displaystyle\int_{0}^{4} |x^2 - 3x|\,dx\).

  1. Factor the inside: \(x^2 - 3x = x(x - 3)\). It equals 0 at \(x = 0\) and \(x = 3\). The point 0 is an end of the interval, so cut only at 3. Between 0 and 3 the inside is negative, since at \(x = 1\) it equals \(-2\).

  2. A tempting wrong move: Integrate \(x^2 - 3x\) from 0 to 4. Then take the absolute value of the answer.

    \[\begin{aligned} \left|\int_0^4 (x^2 - 3x)\,dx\right| &= \left|-\frac{8}{3}\right| \\ &= \frac{8}{3} \end{aligned}\]

    The red dashed curve is the integral of \(x^2 - 3x\) without the absolute value. It falls to \(-\tfrac92\) at \(x = 3\), where the inside is negative, and ends at only \(-\tfrac83\). The shaded area can only grow, and the lower graph is already above 4 at \(x = 3\), so the answer is larger than \(\tfrac83\).

  3. Cut at 3. From 0 to 3, \(|x^2 - 3x| = 3x - x^2\).

    \[\begin{aligned} \int_0^3 (3x - x^2)\,dx &= \Big[\tfrac{3x^2}{2} - \tfrac{x^3}{3}\Big]_0^3 \\ &= \tfrac{27}{2} - 9 = \cg{\tfrac92} \end{aligned}\]
  4. From 3 to 4, \(|x^2 - 3x| = x^2 - 3x\).

    \[\begin{aligned} &\int_3^4 (x^2 - 3x)\,dx \\ &\quad = \Big[\tfrac{x^3}{3} - \tfrac{3x^2}{2}\Big]_3^4 \\ &\quad = -\tfrac83 - \left(-\tfrac92\right) = \cg{\tfrac{11}{6}} \end{aligned}\]
  5. Add the two parts.

    \[\tfrac92 + \tfrac{11}{6} = \cy{\tfrac{19}{3}}\]

Practice

Let \(f(x) = 3x^2\) for \(0 \le x \le 1\) and \(f(x) = 4 - x\) for \(1 < x \le 3\). Evaluate \(\displaystyle\int_0^3 f(x)\,dx\).

The formula changes at \(x = 1\), where both formulas give height 3. Cut there, and use each formula on its own part.

Solution
  1. Cut at x = 1. The left part uses 3x².

    \[\int_0^1 3x^2\,dx = \Big[x^3\Big]_0^1 = \cg{1}\]
  2. The right part uses 4 − x.

    \[\begin{aligned} \int_1^3 (4 - x)\,dx &= \Big[4x - \tfrac{x^2}{2}\Big]_1^3 \\ &= \tfrac{15}{2} - \tfrac{7}{2} = \cg{4} \end{aligned}\]
  3. Add the two parts.

    \[1 + 4 = \cy{5}\]

Questions

The graph shows \(y = g(x)\) with \(g(x) = x^2 - 5x + 4\), for \(0 \le x \le 5\). The curve crosses the \(x\)-axis at two points.

  1. To evaluate \(\displaystyle\int_0^5 |g(x)|\,dx\), where must you cut the interval?

    • At x = 1 and x = 4
    • At x = 2.5
    • At x = 0 and x = 5
    • At x = 1 only
    Answer

    At x = 1 and x = 4

  2. Between \(x = 1\) and \(x = 4\) the curve lies below the axis. Which expression equals \(|g(x)|\) on that part?

    • \(-g(x)\)
    • \(g(x)\)
    • \(-|g(x)|\)
    Answer

    \(-g(x)\)

  3. Let \(f(x) = 4x^3\) for \(0 \le x \le 1\) and \(f(x) = 7 - 3x\) for \(1 < x \le 2\). What is \(\displaystyle\int_0^2 f(x)\,dx\)?

    • \(\frac72\)
    • 16
    • 8
    • \(\frac52\)
    Answer

    \(\frac72\)

Summary

You cut the interval where the formula changes, integrate each part with its own antiderivative, and add the values.

It works because the areas of the parts add to the area of the whole, and one formula and one antiderivative serve each part.

You use it for piecewise functions and for absolute values, because one antiderivative cannot cover the whole interval.

This is one of four skills in topic 6.7 of Which & Why: AP Calculus.