I had to solve the $\lim_{x \to 3} \frac{x^3-3x^2-x+3}{x^2-x-6}$ that is indeed an indeterminate form ($\frac{0}{0}$).
The approach I adopted was to factor the polinomials so that I can deviate from the indeterminate form.
$$ \lim_{x \to 3} \frac{x^3-3x^2-x+3}{x^2-x-6} = \lim_{x \to 3} \frac{(x-3)(x^2-1)}{(x-3)(x+2)} = \lim_{x \to 3} \frac{(x^2-1)}{(x+2)} = \frac{8}{5} $$
Unfortunately, my first approach was to factor the denominator into $(x-2)(x+3)$ that didn't lead to the same simple solution.
Hence my question. Is there any rule, hint or suggestion I can keep in mind in cases like this one to properly determine the most appropriate factorization to simplify the fraction and the calculus?
EDIT: I just noticed, reading my own question, that the first attempt was not as simple because the factorization itself was wrong. Please ignore the question.
Note that $(x-2)(x+3) = x^{2} + x - 6 \ne x^{2} - x - 6 = (x + 2 ) (x - 3)$. Polynomials of degree $1$ are irreducible, so factorization is unique here.