Question:
Evaluate the following integral:
$\int \frac{1}{1+x+x^{2}+x^{3}} d x$
Solution:
$I=\int \frac{1}{1+x+x^{2}+x^{3}}=\int \frac{d x}{\left(x^{2}+1\right)(x+1)}$
$\frac{1}{\left(x^{2}+1\right)(x+1)}=\frac{A x+B}{x^{2}+1}+\frac{C}{x+1}$
$1=(A x+B)(x+1)+C\left(x^{2}+1\right)$
Equating constants
$1=B+C$
Equating coefficients of $x$
$0=A+C$
Solving, we get
$\mathrm{A}=-\frac{1}{2} \mathrm{~B}=\frac{1}{2} \mathrm{C}=\frac{1}{2}$
Thus
$I=-\frac{1}{2} \int \frac{x d x}{x^{2}+1}+\frac{1}{2} \int \frac{d x}{x^{2}+1}+\frac{1}{2} \int \frac{d x}{x+1}$
$I=-\frac{1}{4} \log \left|x^{2}+1\right|+\frac{1}{2} \tan ^{-1} x+\frac{1}{2} \log |x+1|+C$