In this case, you use wolframalpha.com because the calculation by hand is brutal.
http://www.wolframalpha.com/input/?i=integrate+(1%2Ba*cos(x))^-1
Some people think that's cheating, but I think doing the grunt work here would be a waste of time since there's no new insight. From the looks of it, it's just several cumbersome integration by parts with the inverse hyperbolic tangent function.