Spivak chapter 7 exercise 1(v), find bounds, min and max of the function on an interval Decide if the function is bounded above or below on the indicated interval, if it takes on its max or min value.
$$f(x)=\begin{cases} x^2, x\leq a\\ a+2, x>a \end{cases} \mbox{ on the interval } A=(-a-1, a+1)$$ There's the function on Desmos https://www.desmos.com/calculator/tntequ1lv4.
I'm somewhat struggling to come up with a clean analysis of the problem. Is what I've done correct, is it how the exercise is supposed to be done?
First note that $-a-1<a+1 \implies a>-1$, otherwise the interval is empty.
Case 1. $-1<a\leq-a-1\implies-1<a\leq-\frac12$.
$\forall x\in A(f(x)=a+2)$ because $x>a$. Upper and lower bounds, max and min are $a+2$.
Case 2. $-\frac12<a<0$.
This interval is chosen because from $0$ and on the minimum and the lower bound is clearly $0$, so it should probably be treated as the separate case #3.
$-\frac12<a\implies -a<\frac12 \implies -a-1<-\frac12 \implies -a-1<-\frac12<a$
It follows that the interval $(-a-1, a]$ is not empty as there is at least one number in it as shown above. $\forall x\in (-a-1, a](f(x)=x^2)$ since $x\leq a$. $f(x)$ is decreasing on the interval and $\forall a \in (-\frac12,0) \forall x \in (-\frac12,a)(x^2<a+2)$, hence the minimum value and the lower bound for this case is $a^2$.
Case 3. $a\geq0$.
Clearly the min and the lower bound is the tip of the parabola $f(x)=0$ at $x=0$ because $0\leq a, f(0)=x^2$ and $a+2\gt0$.
Finally the maximum value and the upper bound for the cases 2 and 3 is either $a+2$ or $(a+1)^2$, whichever is greater.
$a+2\geq(a+1)^2$ for all $a \in \left[\frac{-1-\sqrt{5}}2, \frac{-1+\sqrt5}2\right]$, hence $a+2$ is the maximum and the upper bound for all $a\leq\frac{-1+\sqrt5}2$, and $(a+1)^2$ for all $a>\frac{-1+\sqrt5}2$
Looks a bit too much for 1/12 of the first exercise.
 A: I drew the graph for different values of $a$ to see what is happening with a little more clarity.
Here are the graphs for $a=0$, $a=1$, and $a=2$. Note that as $a\geq 0$ increases, the interval $(-a-1,a+1)$ expands. The general characteristics of the function on the interval for such values of $a$ are:

*

*open on each end of the interval


*discontinuous at $a$


*limit from below exists at $a$ but not from above


*$(a, a+1)$ portion of the interval always has length $1$, is open on both sides, and $f$ takes on the value $a+2$ on it.


*if $a > \frac{-1+\sqrt{5}}{2}$ then $f$ does not take a max on the interval. This is because for a given such $a$, the left portion of the graph (where $f(x)=x^2$) has values larger than the $(a, a+1)$ portion on the right. But the left portion has no max since it is open at $-a-1$.

Now let's consider values $a<0$:

Note that:

*

*if $-1<a<-\frac{1}{2}$  then $-a-1>a$, thus $\forall x \in (-a-1,a+1), f(x)=a+2$. This is the case represented by the blue horizontal lines, e.g. $a=-0.9$. max and min of $f$ coincide in this case.


*As $a$ increases past $-\frac{1}{2}$, the function becomes discontinuous. The left portion of the graph (where $f(x)=x^2$) becomes larger as we increase $a$, until this left portion reaches $x=0$, and we are in the situation depicted in the first graph. Also, the right, horizontal portion of the graph keeps moving to the right, but it keeps its length of 1.


*when $-\frac{1}{2} < a < 0$, the min is the rightmost portion of the left part of the graph, ie $a^2$. From $a=0$ and up, the min of $f$ is at $f(0)=0$.
