Second-order derivatives and rearrangements