I came across the following problem:
Let $f: \mathbb{R}^n \to \mathbb{R}$ be partial differentiable to every variable and let $\nabla f(x)=0, \forall x \in \mathbb{R}^n $
Proof that $f$ is constant.
Intuitively I understand that this is true and I sort of understand how to proof it. For a function from $\mathbb{R}$ to $\mathbb{R}$ I know this is true, but now I need to go to a N-dimensional function.
My idea is as follows. Let $x,y \in \mathbb{R}^n$, now we need to show that $f(x)=f(y)$. For the one dimensional case this is already proven. So I would start by proving that $f(x_1,...,x_n) =f(y_1,x_2,...,x_n)$ and then the next step would be $f(y_1,x_2,...,x_n)=f(y_1,y_2,x_3...,x_n)$ etc.
How would I do this formally and is this the correct approach?
My second question is what would happen if we have a function $g : \mathbb{R}^n \to \mathbb{R}^p$ and the total derivative $Dg(x)=0, \forall x\in \mathbb{R}^n$. This function $g(x)$ should also be constant. How can I use this question to proof that?
My thoughts on this case are that I should use a family of functions defined by:
$\phi _i: \mathbb{R}^n \to \mathbb{R}, x \mapsto g_i(x)$
Then by using the first question all $g_i(x)$ are constant, but can I than say that the composition of all $g_i(x)$ is also constant?