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|$ ?

 A: If I'm not mistaken, you cannot compute this integral without using partial fractions. If you make the substitution $x= a \sec(\theta)$, your integral "simplifies" to $\int \frac{d \theta}{a \sin \theta}$, from which you can write $\sin \theta = \sqrt {1-\cos^2 \theta}$ and use the substitution $y=\cos x$, which leads to the integral $-\frac{1}{a}\int \frac{dy}{1-y^2}$, which is more or less what you started with!
Thus the only (sensible?) way is to note that $$\int\frac{1}{x^2-a^2}dx = \frac{1}{2a}\left[\int\frac{1}{x-a}dx - \int\frac{1}{x+a}dx\right]$$ and the solution follows immediately as these are elementary integrals.
A: $\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.
$$
A: An other way
$$\frac{d}{dx}\left(\frac{1}{2a}\ln\left|\frac{x-a}{x+a}\right|+\zeta\right)=\frac{1}{2a}\frac{\frac{(x+a)-(x-a)}{(x+a)^2}}{\frac{x-a}{x+a}}=\frac{1}{(x-a)(x+a)}=\frac{1}{x^2-a^2},$$
and thus,
$$\int\frac{1}{x^2-a^2}dx=\frac{1}{2a}\ln\left|\frac{x-a}{x+a}\right|+\zeta.$$
