$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$
 A: this is the case for $n=1.$ what is $f^\prime(x)$ for $x$ in $R^n, n > 1?$
you can argue by contradiction. suppose $f$ has a local maximum and $f^\prime(a) \neq 0.$  we can assume that $f^\prime(a) > 0$ for if not take $-f$ instead.
since $f^\prime(a) > 0,$ from the definition of derivative you have 
$\dfrac{1}{2}f^\prime(a) \le \dfrac{f(x) - f(a)}{x - a} \le \dfrac{3}{2}f^\prime(a)$
for $x$ suffciently near $a.$ this can be rewrittens as 
$$f(a) + \dfrac{1}{2}f^\prime(a)(x-a) \le f(x) \le f(a) + \dfrac{3}{2}f^\prime(a)(x-a) $$
this implies $f$ is increasing around $a$ and contradicts that $f$ has a local maximum at $x = a.$
A: 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$.
