According to the wording k must be a function of x. (If k is a constant then f is a linear function and not a cubic one).
If D denotes the domain of f then
- you only get one real root if for all
- you get two real roots of f if k(x) is a perfect square and .
- you get three real roots if k(x) has two real roots which are different from x = -2.