So, recently I came across a question which goes as follows
How many arrangements of $a,a,a,b,b,b,c,c,c$ are there such that no two consecutive letters are the same?
To which I found the following answer based on Laguerre polynomials here given by @true-blue-anil. (Side/optional question)I don't know why the formula works so if anybody can explain that, it would be super nice, but my main question is in the evaluation of the integral. See for the above quoted question the answer should be
$$N= \int\limits_{0}^{\infty}e^{-x} \left(q_3(x)\right)^3 \, \mathrm{d}x$$
where $q_3(x)= \dfrac{x^3-6x^2+6x}{6}$, so the above becomes
$$N= \frac{1}{216}\int\limits_{0}^{\infty}e^{-x} (x^3-6x^2+6x)^3 \, \mathrm{d}x= 174$$which is the correct answer, but my gripe is that this is not doable in a exam setting with my calculation style (which is to just expand the polynomial completely and integrate termwise) atleast, it takes me so much time to evaluate this integral, so, I was asking if there is a quicker way to calculate the integral of format
$$\int\limits_{0}^{\infty}e^{-x}f(x) \, \mathrm{d}x$$
where $f(x)$ is a polynomial written in a factored form?