Answer
$$\frac{1}{2}\ln |\tan \theta-1|-\frac{1}{2}\ln |\tan \theta+1|+C$$
Work Step by Step
Given
$$ \int \frac{\sec ^{2} \theta d \theta}{\tan ^{2} \theta-1}$$
Let
$$u=\tan \theta \ \ \ \ \ \to \ \ \ \ du=\sec ^{2} \theta d \theta$$
Then
\begin{aligned}
\int \frac{\sec ^{2} \theta d \theta}{\tan ^{2} \theta-1}&=\int \frac{ d u}{u^{2} -1}
\end{aligned}
Since
\begin{align*}
\frac{1}{(u^2-1)} &=\frac{A}{u-1}+\frac{B}{u+1}\\
&= \frac{A(u+1)+B(u-1)}{(u^2-1)}\\
1&= A(u+1)+B(u-1)
\end{align*}
Then
\begin{align*}
\text{at } u&=1 \ \ \ \ \to A=1/2 \\
\text{at } u&=- 1\ \ \ \ \to B=-1/2
\end{align*}
Hence
\begin{aligned}
\int \frac{\sec ^{2} \theta d \theta}{\tan ^{2} \theta-1}&=\int \frac{ d u}{u^{2} -1}\\
&= \frac{1}{2} \int \frac{du}{u-1}- \frac{1}{2} \int \frac{du}{u+1}\\
&=\frac{1}{2}\ln |u-1|-\frac{1}{2}\ln |u+1|+C\\
&=\frac{1}{2}\ln |\tan \theta-1|-\frac{1}{2}\ln |\tan \theta+1|+C
\end{aligned}