# Then determine the relative and absolute extrema

Consider the function $f(x)=\begin{cases} 2x^3-3x^2-12x+9 , & x \leq 3 \\ 9x-x^2-18 , & x>3 \end{cases}$

over the interval $\ [-2,5]\$

Then determine the relative and absolute extrema . Also find the interval where $\ f(x) \$ is increasing or decreasing .

The given function is continuous at $\ x=3 \$

At first we have to find the derivative of $f(x) \$ to calculate the critical points.

Now,

$f'(x)=\begin{cases} 6x^2-6x-12 , & x \leq 3 \\ 9-2x, & x >3 \end{cases} \$

Now $f'(x)=0 \ \Rightarrow 6x^2-6x-12= 0 , \ \ x \leq 3 \tag 1$

Also $f'(x)=0 \ \Rightarrow 9-2x= 0 , \ \ x > 3 \tag 2$

From $(1) \$, we get

\begin{align} & 6x^2-6x-12=0 \\ \Rightarrow & x^2-x-2=0 \\ \Rightarrow & x^2-2x+x-2=0 \\ \Rightarrow & x=2, \ -1 \end{align}

From $(2) \$, we get

$$9-2x=0 \\ \Rightarrow x=\frac{9}{2} \$$

Thus $x=-1, \ 2 , \ \frac{9}{2} \$ gives the extreme points.

Am I right so far ?

If right , then how to find the relative and absolute extrema?

$x=-1, \ 2 , \ \frac{9}{2} \$ are the relative/local extreme points. The absolute ones are at $-1$ and $2$.
First we start by finding if its continuous. It is easy to find that the function is continuous at $[-2,5]$. Next we find the derivative:f'(x)= \left\{\begin{aligned} &6x^2-6x-12,\space x<3\\ &-2x+9,\space x>3 \end{aligned} \right. (Notice we don't use $x\le3$ in the derivative because we don't know if its differentiable at that point$x=3$. You can see that it is not differentiable by making the graph or finding the derivative using the definition). The zero's of the derivative is at $x=-1,2,{9\over2}$ which are the extreme points but we cannot forget that extreme points we can find in the ends of closed intervals so $x=-2,5$ are also extreme points. If you want to find if these points are local or absolute you should make a graph or (which i think is the correct way) to make a table which shows the monotony and extreme point and determine from the table which of these points are local or absolute
About the monotony of $f$ it is easy to find that $f$ is increasing at$[-2,-1],[2,4.5]$ and decreasing at $[-1,2],[4.5,5]$