<s>[INST] Prove that $\int\frac{1}{x^2-a^2}dx=\frac{1}{2a}\ln|\frac{x-a}{x+a}|+\zeta$ using trigonometric substitution We know that $\int\frac{1}{x^2-a^2}dx=\frac{1}{2a}\ln\left|\frac{x-a}{x+a}\right|+\zeta$.

I tried to verify formula using trigonometric substitution and I had some problems.


Here is all my steps:
$\int\frac{1}{x^2-a^2}dx=\frac{1}{a}\int\frac{sec(\theta)\:d\theta}{tg(\theta)}=\frac{1}{a}\int{csc(\theta)}\:d\theta=-\frac{1}{a}\ln\left(\frac{x}{\sqrt{x^2-a^2}}+\frac{a}{x}\right)+\zeta\Rightarrow\theta=\sec^{-1}(\frac{x}{a})$.

How can I continue such that to get $\frac{1}{2a}\ln\left|\frac{x-a}{x+a}\right|$ ?

 [/INST] $\DeclareMathOperator{\sech}{sech}$If it matters, the step where you integrate $\csc$ looks awry; should be
$$
\frac{1}{a} \int \csc\theta\, d\theta
  = -\frac{1}{a} \log\left\lvert\csc\theta + \cot\theta\right\rvert + C
  = -\frac{1}{a}\log\left\lvert\frac{x + a}{\sqrt{x^{2} - a^{2}}}\right\rvert + C.
$$
Then factor the radicand as a difference of squares and use properties of logarithms.
Yet another approach (in addition to partial fractions and verifying the formula via differentiation), incidentally, is to use the hyperbolic substitution $x = a\tanh u$, $dx = a\sech^{2} u\, du$ which leads to
$$
\int \frac{dx}{x^{2} - a^{2}}
  = \int \frac{a \sech^{2} u\, du}{a^{2} \sech^{2} u}
  = \frac{1}{a} u + C
  = \frac{1}{a} \tanh^{-1} \frac{x}{a} + C
  = \frac{1}{2a} \log \left\lvert \frac{x - a}{x + a} \right\rvert + C.
$$
</s>