Answer
$$\ln|x^3-x|+C$$
Work Step by Step
Given
$$ \int \frac{\left(3 x^{2}-1\right) d x}{x\left(x^{2}-1\right)}$$
Since
\begin{align*}
\int \frac{\left(3 x^{2}-1\right) d x}{x\left(x^{2}-1\right)}&=\int \frac{\left(3 x^{2}-1\right) d x}{\left(x^{3}-x\right)}
\end{align*}
Let $$u =x^3-x\ \ \ \to\ \ \ du=(3x^2 -1)dx$$
Then
\begin{align*}
\int \frac{\left(3 x^{2}-1\right) d x}{x\left(x^{2}-1\right)}&=\int \frac{\left(3 x^{2}-1\right) d x}{\left(x^{3}-x\right)}\\
&=\int \frac{du}{u}\\
&=\ln u+C\\
&=\ln|x^3-x|+C
\end{align*}