# If $f$ is two times differentiable on $[a,b]$ and attains maximum at $x_0\in (a,b)$, prove $f''(x_0)\leq 0$.

Let $f:[a,b] \rightarrow \mathbb{R}$ be a two times differentiable function, that attains its maximum value at some $x_0\in (a,b).$ Prove that $f''(x_0)\leq 0.$

Attempt. By defintion, we have $\displaystyle f''(x_0)=\lim_{x \rightarrow x_0}\frac{f'(x)-f'(x_0)}{x-x_0}$, where $f'(x_0)=0$ by Fermat's theorem (since $x_0$ is an interior point of diferentiability of $f$), so: $$\displaystyle f''(x_0)=\lim_{x \rightarrow x_0^+}\frac{f'(x)}{x-x_0}.$$ It is enough to prove that for some $\delta>0$ we have that $f'(x)\leq 0$ for $x\in (x_0,x_0+\delta).$ This is the point I am stuck.

Thank you in advance for the help!

You are stuck, because what you want to prove need not be true: Consider $$f(x)=\begin{cases}x^2(\sin\frac1x-2)&x\ne 0\\0&x=0\end{cases}$$ This has a unique maximum at $x=0$, but oscillates between increasing and decreasing in every interval $(-\delta,\delta)$.

Instead, use that in order for $f''(x)$ to exist in $(a,b)$, the first derivative $f'(x)$ must be continuous. Then if e.g. $f''(x_0)>0$, we have $f'(x)>0$ in some interval $(x_0,x_0+\delta)$. Then conclude from the MWT that $f(x)>f(x_0)$ for all $x\in(x_0,x_0+\delta)$.

If $f$ is twice differentiable then $$f''(x_0)=\lim_{h\to 0^+}\frac{\big(f(x_0+h)-f(x_0)\big)+\big(f(x_0-h)-f(x_0)\big)}{h^2}$$ If $x_0$ is a local maximum, then clearly, $f(x_0+h)-f(x_0)\le 0$ and $f(x_0-h)-f(x_0)\le 0$, and hence $$\frac{\big(f(x_0+h)-f(x_0)\big)+\big(f(x_0-h)-f(x_0)\big)}{h^2}\le 0$$ and finally $$f''(x_0)=\lim_{h\to 0^+}\frac{\big(f(x_0+h)-f(x_0)\big)+\big(f(x_0-h)-f(x_0)\big)}{h^2}\le 0$$

Suppose $f''(x_0)>0.$ Then for $x$ in a small enough interval $(x_0,x_1)$, we have

$$\frac{f'(x)-f'(x_0)}{x-x_0}= \frac{f'(x)}{x-x_0}> (1/2)f''(x_0) >0.$$

This implies $f'>0$ on this interval. Hence $f$ is strictly increasing on this interval, contradicting the fact that $f$ has a maximum at $x_0.$

Since $f(x_0)$ is a maximum, there exists an interval $[x_0, x_0 + \delta)$ such that $f$ is less than $f(x_0)$ on it.

Then for any $c \in [x_0, x_0 + \delta)$ there exists a $\xi \in [x_0, x_0 + \delta)$ such that $$f'(\xi) = \dfrac{f(x_0 + \delta) - f(x_0)}{\delta} \leq 0.$$

Finally, by continuity of $\dfrac{f'(x)}{x-x_0}$, we have a sequence of $\xi_n$ such that $\dfrac{f'(\xi_n)}{\xi_n - x_0} \to a$, where $a \leq 0$, so the limit is $a$, which is $\leq 0$.

• It is true that $\displaystyle f″(x_0)=\lim_{x\rightarrow x_0^+}\frac{f'(x)}{x-x_0}=\lim_{n \rightarrow+\infty}\frac{f′(\xi_n)}{\xi_n−x_0}≤0.$ Where do you use the continuity of f′ at the last part? Jun 5, 2018 at 16:41
• Sequential continuity implies if we can find one sequence converging to $x$ such that the image of the sequence converges to $f(x)$, then all such sequences converging to $x$ have their image converging to the same point $f(x)$. In other words, it is not enough to say that $\lim_{n \to \infty} \leq 0$. But continuity assures us that $\lim_{x \to x_0^+} \leq 0$.
– user211599
Jun 5, 2018 at 17:50
• Fact. If $\displaystyle \lim_{x\rightarrow x_0}f(x)=\ell\in \mathbb{R}\cup\{\pm \infty\}$ and $x_n\rightarrow x_0$, then $f(x_n)\rightarrow \ell$ (and no continuity is needed). (In our case, $\ell=f''(x_0)\in \mathbb{R}$). Please correct me if I am wrong, but I see no problem on the above statement I made. Jun 5, 2018 at 20:27
• True! But you can't apply the converse! Continuity is needed.
– user211599
Jun 5, 2018 at 20:43