This is a derivation from "Exercises in Recursive Macroeconomic Theory preliminary and incomplete by Stijn Van Nieuwerburgh Pierre-Olivier Weill Lars Ljungqvist Thomas J. Sargent"
which uses integration by parts. Can someone explain how this derivation works? I have tried to replicate the result but to no avail. The text says that they use integration by parts on the second integral on the second line [the integral from w to B of w'dF(w') ]