#### Question

f(x) = (x - 1) (x + 2)^{2}.

#### Solution

\[\text { Given }: \hspace{0.167em} f\left( x \right) = \left( x - 1 \right) \left( x + 2 \right)^2 \]

\[ = \left( x - 1 \right)\left( x^2 + 4x + 4 \right)\]

\[ = x^3 + 4 x^2 + 4x - x^2 - 4x - 4\]

\[ = x^3 + 3 x^2 - 4\]

\[ \Rightarrow f'\left( x \right) = 3 x^2 + 6x\]

\[\text { For the local maxima or minima, we must have }\]

\[ f'\left( x \right) = 0\]

\[ \Rightarrow 3 x^2 + 6x = 0\]

\[ \Rightarrow 3x\left( x + 2 \right) = 0\]

\[ \Rightarrow x = 0 \text { and } - 2\]

\[\text { Thus, x = 0 and x = - 2 are the possible points of local maxima or local minima }. \]

\[\text { Now }, \]

\[f''\left( x \right) = 6x + 6\]

\[\text { At x } = 0: \]

\[ f''\left( 0 \right) = 6\left( 0 \right) + 6 = 6 > 0\]

\[\text { So, x = 0 is the point of local minimum } . \]

\[\text { The local minimum value is given by }\]

\[f\left( 0 \right) = \left( 0 - 1 \right) \left( 0 + 2 \right)^2 = - 4\]

\[\text { At }x = - 2: \]

\[ f''\left( - 2 \right) = 6\left( - 2 \right) + 6 = - 6 < 0\]

\[\text { So, x = - 2 is the point of local maximum} . \]

\[\text { The local maximum value is given by } \]

\[f\left( - 2 \right) = \left( - 2 - 1 \right) \left( - 2 + 2 \right)^2 = 0\]