Step-by-step explanation:
Take the first derivative


Set the derivative equal to 0.




or

For any number less than -1, the derivative function will have a Positve number thus a Positve slope for f(x).
For any number, between -1 and 1, the derivative slope will have a negative , thus a negative slope.
Since we are going to Positve to negative slope, we have a local max at x=-1
Plug in -1 for x into the original function

So the local max is 2 and occurs at x=-1,
For any number greater than 1, we have a Positve number for the derivative function we have a Positve slope.
Since we are going to decreasing to increasing, we have minimum at x=1,
Plug in 1 for x into original function


So the local min occurs at -2, at x=1