This is a problem solved using the Partial Fraction Decomposition method:
Basically, you have to factor the denominator, and then set the equivalent expression equal to multiple fractions (however many you need in order to not have any products in the denominators). You basically just set the actual integral to the side for the next few steps, which is just setting the variable x (well, in this example, at least) equal to numbers that eliminate all but one unknown. After repeating the process until you have solved every unknown, you can head back to the original integral, setting it equal to the new expression. From there, you simply find the anti-derivatives of each piece and you're done! :D
Edit:
If you hadn't said this was math I would have probably thought it was the insane scribblings of a crazy person.
Why not both?
enjoy this truth.