Prove that if $D^kf=0$ then $f$ is polynomial Let $E\subseteq\mathbb{R}^n$ an open connected set and let $f:E\rightarrow \mathbb{R}$ a $k+1$ times differentiable function such that $D^kf=0$. Show that $f$ is a polynomial in $x_1,...,x_n$ at a degree of at most $k$.



For any $\pi\in\{1,...,n\}^n$ we're given that $\frac{\partial^{k+1}f}{\partial x_{\pi (1)}...\partial x_{\pi (k+1)}}=0$. Thus $\frac{\partial^{k}f}{\partial x_{\pi (1)}...\partial x_{\pi(k)}}=c_k$ and by induction $f=\partial^0 f=x_{\pi(1)}(x_{\pi(2)}(...(x_{\pi(k)}c_k+c_{k-1})...)+c_1)+c_0$ for some $c_i\in\mathbb{R}, \forall 1\leq i \leq n$. I feel that this proof doesn't hold but I don't know where is the mistake and what is the right way. Thanks
Abridged solution. Proceed by induction on $k.$ The case $k = 0$ is very standard; consider a "base point" $a \in E$ and the set $\mathrm{X}$ of points in $x \in \mathrm{E}$ such that $f(x)=f(a).$ Then $\mathrm{X}$ is closed in $\mathrm{E}$ as $f$ is continuous. Now, $\mathrm{X}$ is also open in $\mathrm{E}$ for if $x \in \mathrm{X}$ then there is a small enough ball centred at $x$ contained in $\mathrm{E}$ and for such ball the mean value theorem (applied to the line segment between $x$ and another point in the ball) gives that $f$ is constant in such ball, so such ball is subset of $\mathrm{X}$ and then $\mathrm{X}$ is open as claimed. Being $\mathrm{E}$ connected, $\mathrm{X} = \mathrm{E}$ and the base case $k = 0$ is proved.

For the general case, assume $f$ satisfies $f^{(k+1)}=0$ on $\mathrm{E}.$ The case $k = 0$ shows that $f^{(k)}$ is a constant $k$-linear function on $\mathrm{E},$ call it $M.$ We show that $\varphi:x \mapsto f(x) - \dfrac{1}{k!}M(x, \ldots, x)$ satisfies $\varphi^{(k)}=0$ on $\mathrm{E}$ and hence the result. By standard results about derivatives of multilinear functions and the chain rule, we get at once that $\varphi^{(k)}=f^{(k)}-\dfrac{1}{k!} k!M = 0.$ Q.E.D.
Another alternative proof (which I guess is worng as well because I don't use the fact that $E$ is open and connected):

From Taylor's formula we know that
$$
\\  f(x_1,...,x_n)=\sum_{i_1=1}^\infty ...\sum_{i_n=1}^\infty \frac{(x_1-a_1)^{i_1}\cdot...\cdot(x_n-a_n)^{i_n}}{i_1!\cdot...\cdot i_n!}\cdot\frac{\partial ^{i_1+...+i_n}f}{\partial x_1^{i_1}...\partial x_n^{i_n}}(a_1,...,a_n) \
$$
Let $0\leq i_1,...,i_n\leq k$. If $\sum_{j=1}^n i_j&gt;k$ then $\frac{\partial ^{i_1+...+i_n}f}{\partial x_1^{i_1}...\partial x_n^{i_n}}(a)=0$. Otherwise, $\frac{(x_1-a_1)^{i_1}\cdot...\cdot(x_n-a_n)^{i_n}}{i_1!\cdot...\cdot i_n!}$ is polynom of a degree at most $k$, and $\frac{\partial ^{i_1+...+i_n}f}{\partial x_1^{i_1}...\partial x_n^{i_n}}(a_1,...,a_n)$ is a constant linear tranformation. Thus $f(x_1,...,x_n)$ is a polynom of degree at most $k$.