I cannot find a way to integrate this, $$\int\frac{2x^6-13x^5+23x^4-15x^3+40x^2-24x+9}{x^5-6x^4+9x^2}dx$$
I searched for a solution on WolframAlpha but the answer is in terms of complex complex-valued functions.
So the question is, how can I prove that it is not possible to compute this indefinite integral in terms of simple elementary real-valued functions?
Hint:
A key issue is to factor the denominator in a manageable form.
We solve
$$x^3-6x^2+9=0$$ by setting
$$x=\frac3{\sqrt8z}$$
and after simplification,
$$4z^3-3z=-\frac3{4\sqrt{2}}.$$
Hence the three real roots are
$$\frac3{\sqrt8\cos\left(\dfrac13{\arccos\left(-\dfrac{3}{4\sqrt2}\right)}\right)},\\\frac3{\sqrt8\cos\left(\dfrac13{\arccos\left(-\dfrac{3}{4\sqrt2}\right)}+\dfrac{2\pi}3\right)},\\\frac3{\sqrt8\cos\left(\dfrac13{\arccos\left(-\dfrac{3}{4\sqrt2}\right)}+\dfrac{4\pi}3\right)}.$$
Now you can decompose in simple fractions. You can start from the form given by @EeveeTrainer and
$$\frac{59x^2-150x+165}{x^3-6x^2+9}=\frac a{x-x_0}+\frac b{x-x_1}+\frac c{x-x_2}$$ is easy to integrate.