# Evaluate $\int \frac{dx}{\left(\frac{1}{x}-\frac{1}{a}\right)}$

Evaluate the following integral: $$\displaystyle \int\dfrac{dx}{\left(\dfrac{1}{x}-\dfrac{1}{a}\right)}$$ Where $$a$$ is an arbitrary constant.

How do I solve this?

I tried the substitution $$x=a\cos \theta$$

But that got me here (i.e. no where): $$\displaystyle a^{3/2}\int\dfrac{-\sqrt {\cos\theta}.\sin\theta.d\theta}{\sqrt{1-\cos\theta}}$$

How do I simplify this further?

$$\int\dfrac{dx}{\left(\dfrac{1}{x}-\dfrac{1}{a}\right)}=\int\dfrac{ax\,dx}{a-x}.$$ Note that $$\dfrac{ax}{a-x}=\dfrac{(-a)(a-x+a)}{a-x}$$
Use: $$\frac 1 {\frac 1 x -\frac 1 a} =\frac {a^{2}} { a-x} -a$$.
Note that the integrand is a rational function which can be easily split: $$\dfrac{1}{\left(\dfrac{1}{x}-\dfrac{1}{a}\right)}= -\frac{ax}{x-a}=-\frac{a(x-a+a)}{x-a}=-a-\frac{a^2}{x-a}.$$ Can you take it from here?