Rolling over of securities

In volume 3, Reading 15, Page 115, Practice Problems, No. 6

Why extending the duration of the bond portfolio iwll be profitable when the yield curve subsequently flattens or inverts???

Many thanks.

Long term interest rates are dropping, thus long term bond prices are rising.