Evaluate the following integrals:
$\int \frac{\left(x^{3}+8\right)(x-1)}{x^{2}-2 x+4} d x$
Let $I=\int \frac{\left(x^{2}+8\right)(x-1)}{x^{2}-2 x+4} d x$
We know $a^{3}+b^{3}=(a+b)\left(a^{2}-a b+b^{2}\right)$
Hence, in the numerator, we can write
$x^{3}+8=x^{3}+2^{3}$
$\Rightarrow x^{3}+8=(x+2)\left(x^{2}-x \times 2+2^{2}\right)$
$\Rightarrow x^{3}+8=(x+2)\left(x^{2}-2 x+4\right)$
Therefore, we can write the integral as
$I=\int \frac{(x+2)\left(x^{2}-2 x+4\right)(x-1)}{x^{2}-2 x+4} d x$
$\Rightarrow I=\int(x+2)(x-1) d x$
$\Rightarrow I=\int\left(x^{2}+x-2\right) d x$
$\Rightarrow I=\int x^{2} d x+\int x d x-\int 2 d x$
$\Rightarrow I=\int x^{2} d x+\int x d x-2 \int d x$
Recall $\int x^{n} d x=\frac{x^{n+1}}{n+1}+c$ and $\int d x=x+c$
$\Rightarrow I=\frac{x^{2+1}}{2+1}+\frac{x^{1+1}}{1+1}-2 \times x+c$
$\therefore I=\frac{x^{3}}{3}+\frac{x^{2}}{2}-2 x+c$
Thus, $\int \frac{\left(x^{3}+8\right)(x-1)}{x^{2}-2 x+4} d x=\frac{x^{2}}{3}+\frac{x^{2}}{2}-2 x+c$