Why a Piecewise Integrand Must Be Split
A double integral on a rectangle accumulates the values of a function across the entire domain. If the formula for the function changes at a vertical or horizontal line, the calculation must account for those changes. Using one formula over the whole rectangle generally gives the wrong result, because that formula may not describe the function on every part of the domain.
The basic method is to divide the original rectangle along the stated break lines. Each resulting piece is itself a rectangle, and on each piece we use the formula assigned to that part of the domain. We then add the individual integrals. The procedure is a direct application of additivity across rectangular subdivisions.
Rectangular Pieces and the Integral
Let \(R=[a,b]\times[c,d]\) be a rectangle. Suppose the piecewise definition changes at vertical lines \(x=r_1,\ldots,x=r_m\) and horizontal lines \(y=s_1,\ldots,y=s_n\), all lying within \(R\). Sort the break coordinates and include the outer edges \(a,b,c,d\). These coordinates divide \(R\) into smaller rectangles.
For example, one cell of this division has the form \([r_{i-1},r_i]\times[s_{j-1},s_j]\). On that cell, use the formula assigned to the corresponding region of the piecewise definition. If each formula is continuous on its cell and the function remains bounded on the break lines, the resulting function is Riemann integrable on \(R\). The integral is the sum of the integrals over the cells.
Here the notation for the cell edges is understood to include the outer edges of the original rectangle, so each cell uses its own left and right \(x\)-coordinates and lower and upper \(y\)-coordinates. If a break occurs in only one coordinate, the division produces strips instead of a full grid. In either case, every interior point belongs to exactly one piece, except for points on shared edges.
A shared edge does not contribute area to the double integral. Thus the way the function assigns values exactly on a break line does not affect the integral, provided those values are bounded. This fact permits us to integrate over closed rectangles that share edges, even though the original definition may assign a break-line point to only one branch.
Why Adding the Piece Integrals Works
The justification is the additivity of the double integral across rectangular subdivisions. For a division by one vertical line \(x=r\), additivity gives the integral over the whole rectangle as the sum of the integrals over the left and right rectangles. Dividing again by a horizontal line splits each of those integrals into a lower and upper part. Repeating this process gives the sum over all cells.
On each cell, the applicable formula can be integrated as an iterated integral. When the formula is continuous there, Fubini’s theorem for continuous functions allows us to evaluate the double integral by integrating first with respect to one coordinate and then the other. The important bookkeeping requirement is that the limits describe the cell, and the formula inside the integral is the one valid on that cell.
Record each vertical and horizontal coordinate where the formula changes.
Use the break lines and the outer edges to partition the full domain.
Use the piece’s bounds and its assigned formula.
Combine the signed integral values and verify that all pieces together cover the original rectangle.
Worked Example: One Vertical Break Line
Worked Example: One Vertical Break Line
Evaluate \(\iint_R f(x,y)\,dA\) on \(R=[0,2]\times[0,1]\), where \(f(x,y)=x+y\) for \(0\le x<1\), and \(f(x,y)=2x-y\) for \(1\le x\le2\).
The vertical break line is \(x=1\). It divides \(R\) into \([0,1]\times[0,1]\) and \([1,2]\times[0,1]\). Integrate each formula on its own rectangle.
For the second rectangle, the evaluated endpoint at \(x=2\) is \(4-1=3\), and at \(x=1\) it is \(1-\frac12=\frac12\), so its contribution is \(\frac52\). The first contributes \(1\). Their sum is \(\frac72\), as stated.
Worked Example: Break Lines in Both Coordinates
Worked Example: Break Lines in Both Coordinates
On \(R=[0,2]\times[0,2]\), define \(f\) by \(x+y\) when \(0\le x<1\) and \(0\le y<1\); by \(2\) when \(1\le x\le2\) and \(0\le y<1\); by \(3y\) when \(0\le x<1\) and \(1\le y\le2\); and by \(xy\) when \(1\le x\le2\) and \(1\le y\le2\). Find the integral.
The break lines \(x=1\) and \(y=1\) form four unit squares. Evaluate the four integrals separately:
The lower-left contribution is
The lower-right contribution is
The upper-left contribution is
The upper-right contribution is
Adding the four contributions gives
As a check, the four pieces have areas \(1,1,1,1\), so together they cover the area \(4\) of the original rectangle. The integral is \(\frac{39}{4}\), the sum of the four computed contributions.
Worked Example: Negative Contributions
Worked Example: Negative Contributions
Evaluate the integral over \(R=[-1,1]\times[0,2]\) for the function \(f(x,y)=x+y\) when \(-1\le x<0\), and \(f(x,y)=x^2-y\) when \(0\le x\le1\).
The line \(x=0\) divides the domain into two rectangles. The first contribution is
The second contribution is
Therefore,
The negative contribution is valid: a double integral is signed, so regions where the function is negative subtract from regions where it is positive. The final result checks as the sum \(1+(-\frac43)=-\frac13\).
Common Mistake: Using One Branch Everywhere
In the first example, the formula \(x+y\) applies only to the left-hand rectangle. A tempting but incorrect calculation is to use it across all of \(R\):
This value is not the required integral. On the right-hand rectangle, the function is \(2x-y\), not \(x+y\). The correct calculation uses both pieces and gives \(\frac72\). The error is not in evaluating the displayed integral; it is in applying the wrong branch on part of the domain.
When This Method Applies
This method applies directly when the break lines are vertical or horizontal, so that the pieces are rectangles. The formula on each piece should be integrable there; a common sufficient condition is that it is continuous on that piece. Bounded assignments on the finitely many break lines do not alter the integral.
If a stated change occurs along a slanted line or a curved boundary, splitting only along vertical and horizontal lines may not produce rectangular pieces. The rectangular subdivision method described here is intended for rectangular break lines; a different description of the region may then be needed. For the present setting, the reliable habits are simple: draw the breaks, label each cell with its formula, integrate cell by cell, and add the signed results.
Check Your Understanding
For each question, identify the pieces before attempting any integration.
- A function changes formula at \(x=2\) on \([0,4]\times[0,3]\). How many rectangular strips result?
- What four rectangles result when the break lines are \(x=1\) and \(y=2\) inside \([0,3]\times[0,4]\)?
- Why may a shared edge be included in both adjacent closed rectangles when writing the piece integrals?
- On \([0,2]\times[0,1]\), a formula \(x\) applies for \(x<1\), and \(2x\) applies for \(x\ge1\). What integrals should be added?
- Can a negative integral over one piece be added to a positive integral over another? Explain what the sign represents.