This is a typical integral where you'll split it up in a part which will give the natural logarithm of the denominator: adjust the numerator so you get a part which is the denominator's derivative, you'll have a constant term too much and you split the integral there. The second one can then be turned into an inverse tangent by completing the square in the denominator.
Now we 'designed' the first integral so that it'll become the natural logarithm of the denominator (since we constructed the derivative in the nominator). The second integral now no longer has an x so you can complete the square in the denominator to form an arctan.