Counting total number of local maxima and minima of a function

Find the total number of local maxima and local minima for the function $$f(x) = \begin{cases} (2+x)^{3} &\text{if}\, -3 \lt x \le -1 \\ (x)^\frac{2}{3} &\text{if}\, -1 \lt x \lt 2 \end{cases}$$

My attempt : I differentiated the function for the two different intervals and obtained the following: $$f'(x) = \begin{cases} 3\cdot(2+x)^{2} &\text{if}\, -3 \lt x \le -1 \\ \frac{2}{3}\cdot (x)^\frac{-1}{3} &\text{if}\, -1 \lt x \lt 2 \end{cases}$$ How do I obtain the maxima and minima points from here.

Any help will be appreciated.

• extrema occur where $f'(x) = 0$, $f'(x)$ is undefined, and/or endpoints. Jun 6 '17 at 14:12
• @Dando18, "extrema may occur where..." In the problem given, $f'(-2)=0$ but $(-2,0)$ is not an extrema. Jun 6 '17 at 14:28
• @BernardMassé Yeah I meant $\text{extrema} \implies f'(x)=0,\, \dots$ not the other way around. Jun 6 '17 at 14:30
• Just draw the graph?! Jun 6 '17 at 15:30

You need to study $f'$ :

What is the sign of $f'(x), x\in ]-3 , 2 [$ ?

A local maxima/minima $x_m$ appears when :

• $f'(x_m) = 0$ or $x_m$ is a remarquable point (here $x_m \in \{-3,-1,2\}$)
• $f'$ changes sign before and after $x_m$

If the second condition is not verified, $x_m$ is an inflection point.

• I think x=0 is another remarkable point here, since f'(x) becomes undefined at x=0 . Jun 6 '17 at 15:30
• You're absolutely right, I didn't do the $f'$ study before posting my answer but indeed as pointed out by Dando18 if $f'$ is undefined then you should check the nature of the point. Jun 8 '17 at 2:38