You should study the technique of using substitutions in integration.
That was the point of giving you that problem,
to see if you could recognise the connection between numerator and denominator.
When one is the derivative of the other, or a multiple of that derivative,
you can then write the integral in a simple form.