<s>[INST] Which integration formula for $\frac{1}{a^2-x^2}$ is correct? In my book integration formula for $\frac{1}{x^2-a^2}$ is given as $\frac{1}{2a}\ln(\frac{x-a}{x+a})$.
From the above formula we can write the formula for integration of $\frac{1}{a^2-x^2}$ as   $-\frac{1}{2a}\ln(\frac{x-a}{x+a}) = \frac{1}{2a}\ln(\frac{x+a}{x-a}) $ [as we know $\ln(\frac{1}{x})=-\ln(x)$]
But, in my book the integration of  $\frac{1}{a^2-x^2}$ is written as $\frac{1}{2a}\ln(\frac{x+a}{{a-x}}) $.
We know that the integration in the second case cannot be $\frac{1}{2a}\ln(\frac{x+a}{x-a}) $ and $\frac{1}{2a}\ln(\frac{x+a}{{a-x}}) $ at the same time. Which formula is the correct one and why?
 [/INST] We do have that $$I =\int \frac {1}{a^2-x^2} dx =\frac {1}{2a}\ln \frac {x+a}{x-a} $$ But however we apply the absolute value function to arguments of logarithm functions in order to extend the antiderivative's domain giving us: $$I =\int \frac {1}{a^2-x^2} dx =\frac {1}{2a} \ln |\frac {x+a}{x-a}|$$Hope it helps. 
</s>