To find the value of \( x \) where the function \( f(x) = x^2 e^{-x} \) attains its maximum, we first need to take the derivative of the function with respect to \( x \), set it equal to zero, and solve for \( x \).
First, compute the derivative of \( f(x) \):
\[
f'(x) = \frac{d}{dx} \left( x^2 e^{-x} \right)
\]
Using the product rule:
\[
f'(x) = 2x e^{-x} - x^2 e^{-x}
\]
Simplifying:
\[
f'(x) = e^{-x} (2x - x^2)
\]
To find the critical points, set \( f'(x) = 0 \):
\[
e^{-x} (2x - x^2) = 0
\]
Since \( e^{-x} \neq 0 \) for any real value of \( x \), we solve:
\[
2x - x^2 = 0
\]
\[
x(2 - x) = 0
\]
This gives \( x = 0 \) or \( x = 2 \).
By applying the second derivative test or analyzing the first derivative, it can be shown that the function reaches its maximum at \( x = 2 \).
Therefore, the correct answer is 1. 2.