Take a look at the applet: ??
If you have a function with function rule $f\left(x\right)$ then you can determine the extrema of this function as follows:
find the derivative of the function using differentiation and solve $f\text{'}\left(x\right)=0$ , taking into account the domain of the function;
look at the graph of the derivative function, or set up a sign plot for the derivative;
if $f\text{'}\left(x\right)$ moves from negative to positive for $x=a$ (where $a$ is within the domain of the function) then $f$ has a (local) minimum of $f\left(a\right)$ ;
if $f\text{'}\left(x\right)$ moves from positive to negative at $x=b$ (where $b$ is within the domain of the function) then $f$ has a (local) maximum of $f\left(b\right)$ .
If the sign of the derivative does not change, then there are no extrema!
Here you see an example of a sign plot for the derivative.