I need help in evaluating the following integral, please: $$\int\frac{\cos(x)}{a+b\cos(x)}dx$$ so that we get the following result: $$ \int \frac{\cos x }{a + b\cos x}\:dx = \frac{a}{b\sqrt{a^2-b^2}} \arcsin\left(\frac{b+a\cos x}{a+b\cos x}\right) - \frac1b \arcsin(\cos x) + C $$
Also, I would say I don't have a clue how the substitution can be done. I know another well-known answer which is done using the tangent half-angle substitution, but the result I am asking about exists nowhere online as far as I am concerned. This interesting result is given as a hint to a problem in a physics book and it is completely correct as you can test it yourself. I would appreciate any help. Thanks.
(edit: I came to know that the substitution [u=cos(x)] would lead to the desired formula. So, maybe you can help with that as a hint.)