At the end of the second line what you have is:

Notice that the last term is common with the left hand side, so move it to the other side to get:

And no, the plus sign before the last term of the 2nd line is correct. Starting with

and using integration by parts, let , ,

then: