Let
$\begin{aligned}
I &=\int \frac{x^{3}-1}{x^{3}+x} d x=\int\left(1-\frac{x+1}{x^{3}+x}\right) d x \\
&=\int 1 d x-\int \frac{x+1}{x\left(x^{2}+1\right)} d x=x-\int \frac{x+1}{x\left(x^{2}+1\right)} d x \ldots(\mathrm{i})
\end{aligned}$
Now, $\frac{x+1}{x\left(x^{2}+1\right)}=\frac{A}{x}+\frac{B x+C}{x^{2}+1}$
(By using partial fractions)
$\begin{aligned}
&\Rightarrow x+1=A\left(x^{2}+1\right)+(B x+C) x \\
&\Rightarrow x+1=(A+B) x^{2}+C x+A
\end{aligned}$
Comparing coefficients of $x^{2}, x$ and constant, we get
$A+B=0, C=1, A=1 \Rightarrow B=-1$
$\therefore$ From Eq. (i), we get
$\begin{aligned}
I &=x-\int \frac{1}{x} d x-\int \frac{1-x}{x^{2}+1} d x \\
&=x-\log x-\int \frac{1}{x^{2}+1} d x+\frac{1}{2} \int \frac{2 x}{x^{2}+1} d x \\
&=x-\log x-\tan ^{-1} x+\frac{1}{2} \log \left(x^{2}+1\right)+c
\end{aligned}$