<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] 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.
</s>