Spivak Calculus Chapter 7 Problem 1 (vi) There is already a very helpful post about part (v) of this question on this site here . I thought that the answer to problem (vi) would be similar with minor differences, but somehow it is not. The problem reads as follows:

1. For each of the following functions, decide which are bounded above or below on the indicated interval, and which take on their maximum or minimum value. (Notice that $f$ might have these properties even if $f$ is not continuous, and even if the interval is not a closed interval.)

*

*(vi) $f(x)=\begin{cases} x^2,& x<a\\ a+2,& x\geq a \end{cases} \mbox{ on  } [-a-1, a+1].$

Spivak's answer:

(vi) Bounded above and below. As in part (v), it is assumed that $a> -1$. If $a \leq -\frac 12$, then $f$ has the minimum and maximum value $\frac 32$. If $ a \geq 0$, then $f$ has the minimum value $0$, and the maximum value $max(a^2, a+2)$. If $-\frac 12 <a<0$, then $f$ has the maximum value $\frac 32$ and no minimum value.

My objections to his solution:

*

*If $a=-1$, then $[-a-1, a+1]$ contains $0$. So for $a=-1$, $f(0)=a+2=-1+2=1$.

*If $a\leq -\frac 12$, for example let $a=-\frac 23$, then $[-a-1, a+1]=[-\frac 13, \frac 13]$ and $f(x)=a+2= -\frac 23 + 2= \frac 43$ for all $x$ of that interval. In this case $f$ has the minimum and maximum value $\frac 43$ and not $\frac 32$. (Maybe he meant that the "maximum" minimum and maximum value for $a\leq -\frac 12$, which appear for $a=-\frac 12$, is $\frac 32$, but I am not sure...)

*If $a\geq 0$, for example let $a=3$, then $[-a-1, a+1]=[-4, 4]$ and $f(-4)=16>a^2=9>a+2=5$. $f$ has the maximum value $(-a-1)^2$ for this $a$, so I suspect on this issue $f$ behaves similar to the function of part (v).

*If $-\frac 12<a<0$, for example let $a=-\frac{4}{10}$, then $[-a-1, a+1]=[-\frac{6}{10}, \frac{6}{10}]$ and $f(0)=a+2=-\frac{4}{10}+2=\frac{16}{10}>\frac{3}{2}$. In this case $f$ has the maximum value $\frac{16}{10}$ and not $\frac{3}{2}$.

Am I missing something or is there a mistake in every sentence of Spivak's answer?
 A: Spivak's answer to the previous step (v) says

"It is understood that $a> -1$ so that $-a-1 < a+1$."

This makes sense especially for the open interval $(-a-1,a+1)$ in that part of the problem.
However, for this part of the problem (which uses a closed interval) we can instead allow $a = -1$, in which case your solution would be correct.
Spivak's repeated use of $3/2$ instead of $a+2$ appears to be a typo. I think you're right there as well.
His answer misses another thing probably worth mentioning: if $a = 0$, the interval becomes $[-1, 1]$. Here, $f$ approaches the minimum value of $0$ from the left, but never takes on that value.
A: I drew the graph of $f$ for various values of $a$.
First, I drew some graphs for $a \geq 0$:

Note

*

*these graphs all have the same shape: an interval where $f(x)=x^2$, and an interval where $f(x)=a+2$. These parts of the graph are separated by a point of discontinuity, at $a$.


*the length of the horizontal portion $f(x)=a+2$ is always 1
Next I drew some graphs for $-1 \leq a < 0$:

When we put them together I think we can see what happens across all values of a.
For $a=-1$, the interval $[-a-1,a+1]$ is $[0,0]$, ie a single point. As we increase $a$ up to $\frac{1}{2}$, we get graphs which are horizontal lines representing closed intervals.
For $a > \frac{1}{2}$, we start to have a discontinuity at $x=a$. The horizontal portion of the graph remains, and always has length 1 for these values of $a$. The other portion of the graphs, to the left, are where $f(x)=x^2$, and this portion grows as $a$ increases above $\frac{1}{2}$. When $a$ reaches 0, we are back to the situation depicted in the first graph. But essentially the shape of the graphs are similar for any $a>\frac{1}{2}$.
One further detail to note is:

*

*As $a$ increases past $\frac{1}{2}$, we can see that the horizontal portion of the graph is going up the $y$ axis, and the leftmost part of the non-horizontal part of the graph is also going up. At some point this leftmost part is above the horizontal part, and that means that the maximum of $f$ changes from $a+2$ (horizontal part) to $(-a-1)^2=(a+1)^2$.

This happens when $a+2<(-a-1)^2$, which happens when $a \geq \frac{-1+\sqrt{5}}{2}$.
Anyways, I think looking at these graphs gives a pretty good idea what happens in this very tricky function.
And for the record I also believe the solution manual is incorrect.
Finally, to help you understand the actual values I plotted above, here is a table I used (actually I used this for item v of this problem; note that in that case when $a=-1$ the interval is $(0,0)$, but in item $vi$ it should actually be $[0,0]$ in this table):

