Thanks Brightsky 
Thanks DSubShell
could you please explain the concept of using inspection
We'll use your earlier example, f(x)=x^3-3x-2.
Now, we know that f(2)=0, so f(x)=(x-2)q(x), the question we want to answer is what q(x) is. We know that q(x) should be some polynomial, and that it should be one degree lower than f(x), so we get:
f(x)=(x-2)(ax^2+bx+c)
Expanding this out, we get:
f(x)=ax^3+bx^2+cx-2ax^2+2bx-2c
Now, by equating coefficients, we can immediately tell that a=c=1, so we get:
f(x)=(x-2)(x^2+bx+1)
Finally, we need to solve for b - by equating coefficients again, we can see that:
2b+c=-3
2b=-3-1
b=-2
So, f(x)=(x-2)(x^2-2x+1)=(x-2)(x-1)^2
Doing it "by inspection" is that method, however instead of expanding, equating coefficients, etc. you do it all in your head, focusing on the constant and the leading coefficient to ascertain two of the unknowns, and then figuring out the last few by logic.
Remember that polynomial division is also a suitable technique for reducing a polynomial into its factors.