Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a bit confused on this question, I've had a go at it and any help would be much appreciated.

Determine all the optimal points of the following function, and indicate whether the optimal solutions are global or local:

$$f(x) = \left\{ \begin{array}{l l} x^2+1 & \quad -1 \leq x \leq 0\\ x & \quad 0 \leq x \leq 1 \end{array} \right.$$

This is what I have tried so far:

Stationary points:

$$f'(x) = \left\{ \begin{array}{l l} 2x=0 & \quad \Rightarrow x=0\\ 1=0 & \quad \Rightarrow 1 \neq 0 \end{array} \right.$$

Boundary points: $x=-1$ and $x=1$.

Non-differentiable points: $f(0) = 0$, $f(-1) = 2$, $f(1)=2$.

I have followed the technique used by my teacher but not sure where to go from here...

Many thanks in advance for any help.

share|cite|improve this question
up vote 2 down vote accepted

The definition of the function is not correct. You say $f(x)=x^2+1$ for $-1\le x\le 0$ and $f(x)=x$ for $0\le x\le 1$.

Note that you have defined $f(x)$ in two inconsistent ways at $x=0$.

The definition may be $x^2+1$ for $-1\le x\le 0$ and $f(x)=x$ for $0\lt x\le 1$.

Or maybe it is $x^2+1$ for $-1\le x\lt 0$ and $f(x)=x$ for $0\le x\le 1$.

Do check what was written in the actual problem. If it was exactly as you wrote, there is a mistake in the problem.

Whatever the value at $0$ is, the function is decreasing, then increasing. The derivative can tell you that, but you really don't need the derivative.

So the only possible places where the minimum or maximum could be reached are at endpoints $-1$ and $1$, and at the point $0$ where the function is not continuous.

So calculate $f(-1)$, $f(0)$, and $f(1)$. Which is biggest? Which is smallest?

share|cite|improve this answer
f(-1)=f(1)=2 (biggest), f(0)=1 (smallest). what does that suggest? – user54511 Apr 8 '13 at 12:26
You have not corrected the definition of $f$. How is it defined at $0$? Certainly $2$ is the maximum value, attained at $x=-1$. I need to know the actual definition, with typo correction. Is it $x^2+1$ for $-1\le x\lt 1$ and $x$ for $0\le x\le 1$? Then the min value is $0$, reached at $x=0$. Or is it $x^2+1$ for $-1\le x\le 0$ and $x$ for $0\lt x\le 1$? Then there is no minimum. – André Nicolas Apr 8 '13 at 13:27
sorry you were right it is: $-1\leq x < 0$ for $x^2+1$ and $0\leq x \leq 1$ for $x$ – user54511 Apr 8 '13 at 15:29
The answer is then covered by my comment above. The min. value is $0$, reached at $0$. The fact that the derivative of $x^2+1$ is $0$ at $0$ is completely irrelevant. – André Nicolas Apr 8 '13 at 16:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.