Is it a factor of a polynomial?
Pyth - 39 bytes
This is a monstrous combination of regexp and eval. I like the approach, but will try to improve the implementation.
It uses the Polynomial Remainder Theorem.
K_sPe:z&quot;-|\+&quot;3!v.ssXPtw,\^\x,&quot;**&quot;&quot;*K&quot;\*

Doesn't work online because of eval use.