<s>[INST] Integrate: $\int \frac{dx}{x \sqrt{(x+a) ^2- b^2}}$ How to evaluate
$$\int \frac{dx}{x \sqrt{(x+a) ^2- b^2}}$$
I tried trigonometric substitution $x + a = b \sec \theta$ and I encountered
$$\int \frac{\tan \theta}{ (b - a \cos \theta) \sqrt{\tan^2 \theta}}d\theta$$
how to handle this term $\displaystyle \frac{\tan \theta}{|\tan \theta|}$?
 [/INST] I substituted $x=1/y$ and got
$$-\int \frac{dy}{\sqrt{1+2 a y+(a^2-b^2) y^2}}$$
I then completed the square in the square root to get
$$-\frac{1}{\sqrt{a^2-b^2}} \int \frac{dy}{\displaystyle\sqrt{\left(y+\frac{a}{a^2-b^2}\right)^2-\left(\frac{a}{a^2-b^2}\right)^2}}$$
Now let 
$$y=\frac{a}{a^2-b^2} (\cosh{u}-1)$$
Then the integral becomes
$$-\frac{1}{\sqrt{a^2-b^2}} \int du \frac{\sinh{u}}{\sinh{u}} = -\frac{1}{\sqrt{a^2-b^2}} u+C$$
where $C$ is a constant of integration.  Back substituting, we get
$$\int \frac{dx}{x \sqrt{(x+a)^2-b^2}} = -\frac{1}{\sqrt{a^2-b^2}}\text{arccosh}{\left(\frac{a^2-b^2}{a x}+1 \right)} + C $$
Use $\text{arccosh}{z} = \log{(z+\sqrt{z^2-1})}$ to express the result in terms of logs.
</s>