You are "given" how to integrate the first and the second can be integrated by letting u= x+ 2.
First off, as HallsofIvy point out, the substitution u = x+2 or x = u - 2 will give you two integrals that you can easily integrate (and the way I personally would have done this problem). In what follows, the constants of integration will be supressed. First, using the fact that
then
noting that what you want is the first integral. Also so your integral can be written as
so
Now use integration by parts on the first integral in (2)
gives
or
or
Now multiply gives
from which it follows that
.
Kinda long and again, not the way I would have done this problem.