<s>[INST] Calculate the number of real numbers $k$ such that $f(k) = 2$ if $f(x) = x^4 − 3x^3 − 9x^2 + 4$. 
Calculate the number of real numbers $k$ such that $f(k) = 2$ if $f(x) = x^4 − 3x^3 − 9x^2 + 4$.

How do I calculate the number of values for $k$? I can't seem to understand.  Please help me solve this problem.
 [/INST] This is to find the number of real roots of $f(x)-2$.
$$\frac{d}{dx}(f(x)-2)=4x^3-9x^2-18x$$
which is equal to $0$ when $x=0$ or $\displaystyle \frac{9\pm4\sqrt{41}}{8}$.
$$f\left(\frac{9-4\sqrt{41}}{8}\right)-2=\frac{-23195-3321\sqrt{41}}{512}<0$$
$$f(0)-2=2>0$$
$$f\left(\frac{9+4\sqrt{41}}{8}\right)-2=\frac{-23195-3321\sqrt{41}}{512}<0$$
So $f(x)-2$ has a zero in each of the intervals $(-\infty,\frac{9-4\sqrt{41}}{8})$, $(\frac{9-4\sqrt{41}}{8},0)$, $(0,\frac{9+4\sqrt{41}}{8})$ and $(\frac{9+4\sqrt{41}}{8},\infty)$.
There are $4$ solutions.
You can also try the Descartes' rule of signs 
https://en.wikipedia.org/wiki/Descartes%27_rule_of_signs
</s>