# How does one prove if a multivariate function is constant?

Suppose we are given a function $f(x_{1}, x_{2})$. Does showing that $\frac{\partial f}{\partial x_{i}} = 0$ for $i = 1, 2$ imply that $f$ is a constant? Does this hold if we have $n$ variables instead?

-
Essentially yes, if the function's domain is both open (so that you can take derivatives to begin with) and connected. If it is not connected, then this is false already for $n=1$. For instance, $f: (0,1) \cup (2,3) \to \mathbb{R}$ defined by $f(x) = 0$ for $x \in (0,1)$ and $f(x)=1$ for $x \in (2,3)$ is nonconstant but its derivative is zero at any point in its domain. –  Mark Oct 2 '11 at 17:29

Yes, it does, as long as the function is continuous on a connected domain and the partials exist (let's not get into anything pathological here).

And the proof is the exact same as in the one variable case (If there are two points whose values we want to compare, they lie on the same line. Use the multivariable mean variable theorem to show that they must have the same value. This proof is easier if you know directional derivatives and/or believe that you can assume that the partial derivative in the direction of this line is zero because all other basis-partials are zero.)

-