# (1)Determination of local and global maximum/minimum points

Be $I=[-2,2]\subset \mathbb{R}$ and a function $f:I \Leftarrow \mathbb{R}$ (continuous and differentiable on $I$)

$$f(x) = \begin{cases} xe^{x-1} & \text{if x \leq 0}\\ xe^{1-x} & \text{if x>0 } \end{cases}$$

Determine the local & global maximum and minimum points of $f$ on $I$.

1) For $x\leq 0:$
$f'(x)=(1+x)e^{x-1}=0$
$\Leftrightarrow x=-1$

$f''(x)=(2+x)e^{x-1}$
$f''(-1)=e^{-2}>0$
So that there is a local minimum point for x=-1.
$f(-2)=-2e^{-3}$
$f(-1)=-e^{-2}<-2e^{-3}=f(-2) \Leftrightarrow f(-1)$is also the global minimum point.

2) For $x>0:$
$f'(x)=(1-x)e^{1-x}=0$
$\Leftrightarrow x=1$

$f''(x)=(x-2)e^{1-x}$
$f''(1)=-e^{0}=-1<0$
So that there is a local maximum point for x=1.
$f(2)=2e^{-1}$
$f(1)>f(2) \Leftrightarrow f(1)$is also the global maximum point.

My questions:

1) Is this correct?

2) and is it enough or do I also have to regard the limits for -2 and 2 (or is this unnecessary by saying the function is continuous & differentiable on I)?

-

The solution is not entirely correct. For example, it contains the assertion that $f'(x)=(1+x)e^{x-1}$ for $x\le 0$.

This is not quite true. The derivative is correct for $x\lt 0$. But $f$ is not differentiable at $x=0$. You will be able to quickly check that $$\lim_{x\to 0^-}\frac{f(h)-f(0)}{h} \ne \lim_{x\to 0^+}\frac{f(h)-f(0)}{h},$$ so the two-sided limit of the difference quotient does not exist.

Now in fact there is no real "trouble" at $0$, we do not have a local max or min at $0$. But one has to say that, with some explanation, since we cannot use the derivative criterion.

Remark: Perhaps one could get away with the mistake about the derivative, if the (incorrect) assertion that the function is differentiable was part of the problem statement.

-
Ok, is it possible to have a global max or min in point which is not differentiable? – Phil Jun 27 '13 at 6:48
Oh yes! The standard simple example is $f(x)=|x|$, global min at $0$, not differentiable there. One can change it a bit so that the resulting function has derivative $0$ at some places, but global min is still at a point of non-differentiability. – André Nicolas Jun 27 '13 at 6:58
Differentiability has nothing to do with something being global max or min, a global min occurs at a point $a$ if $f(a) \leq f(x) \ \forall x \in D$ where $D$ is the domain of your function. – firemind Jun 27 '13 at 16:25

That's correct. You don't have to take any limits, you already evaluated your function at the boundary points of your domain and confirmed that they're not global max or global min.

On the other hand, your boundary points are local extrema: -2 is a local max and 2 is a local min. Why is that? Because your function is decreasing strictly between $[-2,-1)$ and $(1,2]$.

-