Why the Formula at an Endpoint Matters
A definite integral records accumulated change across an interval. The Fundamental Theorem of Calculus, Part II, lets us calculate that change from an antiderivative: on an interval where \(F'(x)=f(x)\), the integral of \(f\) from \(u\) to \(v\) is \(F(v)-F(u)\), provided the theorem’s conditions hold.
A complication arises when an antiderivative is supplied by different formulas on adjacent intervals. Each formula can correctly represent an antiderivative on its own interval, while the formulas may have different values at a shared endpoint. In that case, subtracting the values at the two outer endpoints can give the wrong result. The reliable method is to calculate a difference on each interval using its own formula, then add those differences.
Piecewise Antiderivatives and Local Endpoint Values
Suppose an interval is divided at points \(c_1,\ldots,c_{n-1}\), where \(a=c_0<c_1<\cdots<c_n=b\). On each subinterval \([c_{i-1},c_i]\), suppose a formula \(F_i\) is an antiderivative of \(f\): on the interior, \(F_i'(x)=f(x)\). Assume each formula extends continuously to the endpoints of its own subinterval, and that the usual conditions for applying the Fundamental Theorem of Calculus hold on each piece.
The value \(F_i(c_i)\) here means the endpoint value from the formula for the \(i\)-th subinterval. At a shared endpoint \(c_i\), there are therefore two local values to consider: \(F_i(c_i)\), from the interval to the left, and \(F_{i+1}(c_i)\), from the interval to the right. These values need not agree.
Because a definite integral can be split across adjacent intervals, the integral over the full interval is the sum of these local differences:
This formula is the central calculation rule for piecewise antiderivatives. It does not require the formulas on neighboring pieces to agree at their shared endpoint.
Worked Example: Matching Formulas at the Breakpoint
Worked Example: Matching Formulas at the Breakpoint
Let \(f(x)=2x\) on \([0,1]\), and \(f(x)=2\) on \([1,2]\). On the first interval, use \(F_1(x)=x^2\); on the second, use \(F_2(x)=2x-1\). Evaluate \(\int_0^2 f(x)\,dx\).
First check the antiderivative formulas on their respective interval interiors:
At the breakpoint, the formulas agree: \(F_1(1)=1^2=1\), and \(F_2(1)=2(1)-1=1\). Now calculate each local endpoint difference:
Adding the two contributions gives \(\int_0^2 f(x)\,dx=1+2=3\). Since the formulas agree at the breakpoint, the local differences combine into the outer-endpoint subtraction \(F_2(2)-F_1(0)=3-0=3\). This agrees with the local calculation. As a direct check, \(\int_0^1 2x\,dx=1\) and \(\int_1^2 2\,dx=2\), giving the same total, \(3\).
When the Outer-Endpoint Shortcut Is Justified
If the formula from the left and the formula from the right agree at every breakpoint, then the local differences telescope. The inner endpoint values cancel in pairs, leaving just the last formula at \(b\) minus the first formula at \(a\). Agreement at every breakpoint is therefore a sufficient condition for using this outer-endpoint shortcut.
To see exactly what can happen without agreement, expand the sum of local differences. For \(n\) subintervals, it can be rewritten as:
Every internal endpoint contributes a correction: the value from the left formula minus the value from the right formula. If the formulas agree at that point, its correction is zero. If they do not, the correction may be nonzero. Corrections at different breakpoints may cancel, but that cancellation is not guaranteed. Thus, when formulas fail to agree, the outer-endpoint difference might happen to give the integral, but it is not a reliable shortcut.
Worked Example: Formulas That Disagree
Worked Example: Formulas That Disagree
Let \(f(x)=1\) on \([0,2]\). Use \(F_1(x)=x+4\) on \([0,1]\), and \(F_2(x)=x-3\) on \([1,2]\). Evaluate \(\int_0^2 f(x)\,dx\).
Each formula has derivative \(1\), which equals \(f(x)\) on the interior of its assigned interval. Calculate the first local difference:
Then calculate the second, using \(F_2\) at both endpoints of \([1,2]\):
The integral is \(1+1=2\). In contrast, subtracting the outer values gives \(F_2(2)-F_1(0)=-1-4=-5\), which is not the integral. The formulas disagree at the breakpoint: \(F_1(1)=5\), while \(F_2(1)=-2\). The correction is \(5-(-2)=7\), so the expanded identity gives \(-5+7=2\). As a direct check, the integral of \(1\) over an interval of length \(2\) is \(2\).
Worked Example: Mismatches Can Cancel
Worked Example: Mismatches Can Cancel
Let \(f(x)=1\) on \([0,3]\), with \(F_1(x)=x\) on \([0,1]\), \(F_2(x)=x+1\) on \([1,2]\), and \(F_3(x)=x\) on \([2,3]\). Evaluate \(\int_0^3 f(x)\,dx\).
All three formulas have derivative \(1\), so each is an antiderivative on its assigned interval. Compute the local differences separately:
The sum is \(1+1+1=3\), so \(\int_0^3 f(x)\,dx=3\). The formulas disagree at both breakpoints: at \(1\), the left value is \(1\) and the right value is \(2\); at \(2\), the left value is \(3\) and the right value is \(2\). Nevertheless, the outer-endpoint difference is \(F_3(3)-F_1(0)=3-0=3\), which happens to equal the integral.
The correction terms explain why. At \(1\), the correction is \(F_1(1)-F_2(1)=1-2=-1\). At \(2\), it is \(F_2(2)-F_3(2)=3-2=1\). Their sum is \(-1+1=0\), so the corrections cancel. As a direct check, \(f(x)=1\) throughout an interval of length \(3\), giving integral \(3\). This example shows why disagreement does not make the outer subtraction impossible; it makes it unsafe unless the corrections are checked.
A Reliable Calculation Process
When an antiderivative is given piece by piece, keep the interval assignment visible throughout the calculation. The following process prevents a formula from being used on the wrong side of a breakpoint.
Write the breakpoints in increasing order and identify which antiderivative formula belongs to each subinterval.
For each subinterval, substitute both of its endpoints into that subinterval’s formula and subtract the left-endpoint value from the right-endpoint value.
Sum the local endpoint differences. This gives the full integral by additivity and the Fundamental Theorem of Calculus on each piece.
Use only the outer-endpoint subtraction if the formulas agree at every breakpoint, or if you have separately verified that all correction terms sum to zero.
Common Pitfall: Treating Piecewise Formulas as One Formula
A frequent error is to take the formula for the last interval at the upper endpoint and the formula for the first interval at the lower endpoint, then subtract immediately. This silently assumes that the internal endpoint contributions cancel. They do cancel when adjacent formulas agree at every breakpoint. Otherwise, the correction terms must be accounted for.
Another error is to evaluate both sides of a breakpoint using whichever formula appears first in the piecewise definition. For the integral on the interval to the left, use the left formula at that endpoint. For the interval to the right, use the right formula there. The two local endpoint values can differ, and each belongs in its own local difference.
Why This Method Matters
Piecewise formulas arise when a function or its antiderivative is described differently on different regions. Working locally respects those interval assignments and makes the calculation robust, even when the formulas do not join continuously. It also makes the role of the Fundamental Theorem of Calculus clear: apply it where the relevant antiderivative formula is valid, then combine the integrals over the pieces.
The method is useful beyond this particular setting. Whenever a calculation is divided into adjacent intervals, local contributions can be combined, but internal boundary terms cancel only when their values match or when any mismatches cancel in the total. Checking those terms is a general way to avoid losing information at a boundary.
Check Your Understanding
For each question, use the formula assigned to each interval at both of that interval’s endpoints.
- If an interval is split at one breakpoint and the two local antiderivative formulas agree there, why can the local differences be combined into an outer-endpoint subtraction?
- Let \(f(x)=2\) on \([0,2]\), with \(F_1(x)=2x+1\) on \([0,1]\) and \(F_2(x)=2x+5\) on \([1,2]\). Evaluate the integral using local endpoint differences. Do the formulas agree at the breakpoint?
- For three adjacent intervals, write the correction terms that must be added to the outer-endpoint difference.
- Can the outer-endpoint difference equal the integral even if formulas disagree at breakpoints? Explain what must happen to the correction terms.
- What is the key mistake in evaluating both local endpoint values at a breakpoint using only one of the adjacent formulas?