Answer
$$\eqalign{
& f\left( x \right) = {x^2}{e^x} \cr
& {\text{Differentiate both sides with respect to }}x \cr
& f'\left( x \right) = {x^2}{e^x} + 2x{e^x} \cr
& {\text{Set }}f'\left( x \right) = 0 \cr
& {x^2}{e^x} + 2x{e^x} = 0 \cr
& x\left( {x + 2} \right){e^x} = 0 \cr
& x = 0,{\text{ }}x = - 2 \cr
& {\text{Calculate the second derivative}} \cr
& f''\left( x \right) = \frac{d}{{dx}}\left[ {{x^2}{e^x} + 2x{e^x}} \right] \cr
& f''\left( x \right) = {x^2}{e^x} + 2x{e^x} + 2x{e^x} + 2{e^x} \cr
& f''\left( x \right) = {x^2}{e^x} + 4x{e^x} + 2{e^x} \cr
& {\text{Evaluate }}f''\left( 0 \right) \cr
& f''\left( 0 \right) = 2{e^0} = 2 \cr
& f''\left( 0 \right) > 0,{\text{ Therefore, there is a relative minimum at }}x = 0 \cr
& f\left( 0 \right) = 0 \cr
& {\text{Relative minimum of 0 at }}x = 0 \cr
& \cr
& {\text{Evaluate }}f''\left( { - 2} \right) \cr
& f''\left( 0 \right) = {\left( { - 2} \right)^2}{e^{ - 2}} + 4\left( { - 2} \right){e^{ - 2}} + 2{e^{ - 2}} \cr
& f''\left( 0 \right) = 4{e^{ - 2}} - 8{e^{ - 2}} + 2{e^{ - 2}} \cr
& f''\left( 0 \right) = - 8{e^{ - 2}} \cr
& f''\left( 0 \right) < 0,{\text{ Therefore, there is a relative maximum at }}x = - 2 \cr
& f\left( { - 2} \right) = {\left( { - 2} \right)^2}{e^{ - 2}} \cr
& f\left( { - 2} \right) = \frac{4}{{{e^2}}} \cr
& {\text{Relative maximum of }}\frac{4}{{{e^2}}}{\text{ at }}x = - 2 \cr} $$
Work Step by Step
$$\eqalign{
& {\text{Relative minimum of 0 at }}x = 0 \cr
& {\text{Relative maximum of }}\frac{4}{{{e^2}}}{\text{ at }}x = - 2 \cr} $$