$f$ has a local maximum at a point $x \in E$. Prove that $f'(x)=0$ Suppose that $f$ is a differentiable real function in an open set $E \subset \mathbb{R^n}$, and that $f$ has a local maximum at a point $x \in E$. Prove that $f'(x)=0$

Suppose that at some point $p=(p_1,p_2,\ldots,p_n)$ and for some $i$, we have  $\frac{\partial f}{\partial x_i}=c\neq0$.
We can regard $f$ as a differentiable function in a single variable $t$, where you only vary $x_i=t$ and leave $x_j$ constant for $j\neq i$. Denote this as $g(t)$. By definition, $g'(p_i)=c$.
Clearly $g(t)$ does not have a local maximum at $t=p_i$. It follows that $f(x)$ does not have a local maximum at $x=p$.
