This is somewhat confusing, until you look carefully for Figure 7.20 and 7.21 and notice that they are two different figures. One is uniformly loaded, and one is loaded with a concentrated moment at the end of the cantilever beam.
Thus on problem 7.22 he wants you to use volume integrals to solve for Delta B for Figure P7.20.
On problem 7.23 he wants you to use volume integrals to solve for Delta B for Figure P7.21.