Answer
$$k = \frac{1}{3}$$
Work Step by Step
$$\eqalign{
& f\left( x \right) = k{x^2};\,\,\,\,\,\,\,\,\,\,\,\,\left[ { - 1,2} \right] \cr
& {\text{The function f is a probability density function of a random variable X }} \cr
& {\text{in the interval }}\left[ {a,b} \right]{\text{ if}}: \cr
& 1{\text{ condition}}:f\left( x \right) \geqslant 0{\text{ for all }}x{\text{ in the interval }}\left[ {a,b} \right].{\text{ then}} \cr
& and \cr
& 2{\text{ condition}}:\int_a^b {f\left( x \right)} dx = 1.{\text{ then replacing the interval }}\left[ { - 1,2} \right]{\text{ and }}f\left( x \right) = k{x^2} \cr
& \int_{ - 1}^2 {k{x^2}} dx = 1 \cr
& {\text{Integrating}} \cr
& \left( {\frac{{k{x^3}}}{3}} \right)_{ - 1}^2 = 1 \cr
& \frac{k}{3}\left( {{{\left( 2 \right)}^3} - {{\left( { - 1} \right)}^3}} \right) = 1 \cr
& {\text{Simplify and solve for }}k \cr
& \frac{k}{3}\left( {8 + 1} \right) = 1 \cr
& \frac{{9k}}{3} = 1 \cr
& k = \frac{1}{3} \cr
& {\text{then }}f\left( x \right) = \frac{1}{3}{x^2} \cr
& {\text{The function is positive for the interval }}\left[ { - 1,2} \right].{\text{ then the condition 1 it is true}} \cr
& {\text{for }}k = \frac{1}{3} \cr} $$