Prove that the function is constant 
Let $f:\mathbb{R}^2\rightarrow \mathbb{R}$ be a differentiable function such that for all $x\in\mathbb{R}^2$, 
  $$
\frac{\partial f}{\partial x_2}(x)=2\cdot\frac{\partial f}{\partial x_1}(x).
$$ 
  Prove that for every $c\in\mathbb{R}$ function $f$ is constant on $$M_c=\left\{x\in\mathbb{R}^2: 2x_2+x_1=c\right\}.$$

I don't know how to approach.
 A: Consider the map $\phi \colon \mathbb{R} \to \mathbb{R}^2$ defined by
$$
\phi(t) = \begin{pmatrix}
c-2t \\
t \end{pmatrix}.
$$
Now try to compute
$$
\frac{d}{dt}\left( f\circ \phi \right) = \frac{\partial f}{\partial x_1} \cdot (-2) + \frac{\partial f}{\partial x_2}
$$
and use the assumption. What can you conclude from this?
A: Note that by the given assumption the gradient of $f$ is orthogonal to $\mathbf{d}=(2,-1)$ at any point $\mathbf{x}$ in the domain of $f$, i.e. $\nabla{f(\mathbf{x})}\cdot{\mathbf{d}}=0$ all $\mathbf{x}\in\mathbb{R^n}$ Now use the mean value theorem in several variables which states that for a differentiable function $f:\mathbb{R}^n\mapsto\mathbb{R} $  for every $\mathbf{a},\mathbf{b}\in \mathbb{R^n}$ there is a $\mathbf{c} \in [\mathbf{a},\mathbf{b}]$, where  $$[\mathbf{a},\mathbf{b}]:=\{\mathbf{x}\in  \mathbb{R^n}| \mathbf{x}=t\mathbf{a}+(1-t)\mathbf{b},  t \in [0,1]\subset \mathbb{R}\}$$
such that $f(\mathbf{a})-f(\mathbf{b})=\nabla{f(\mathbf{c})\cdot{}(\mathbf{a}-\mathbf{b})}$. 
Now pick a point $\mathbf{a}=(a_1,a_2) \in M_c$, and let $\mathbf{b}=(b_1,b_2)\in M_c$ be arbitrary. Then clearly $\mathbf{a}=(c-2a_2,a_2)$ and $\mathbf{b}=(c-2b_2,b_2)$. From the mean value theorem above it follows that $f(\mathbf{a})-f(\mathbf{b})=\nabla{f(\mathbf{c})}\cdot(\mathbf{a}-\mathbf{b})=\nabla{f(\mathbf{c})}\cdot{}(2,-1)(b_2-a_2)=(b_2-a_2)\nabla{f(\mathbf{c})}\cdot \mathbf{d}=0$.    
A: Well! we  can  generalize this :
$f$  is  constant on  all   subset  $M_{u,v,I}$ of  $\mathbb R^2$ where :$$M_{u,v,I}=\{(u(t),v(t)) \mid   t  \in  I  \}$$   where : $I$  is  an  open intervall  and  $u,v$  having   $C^1$ class   on  $I$   to  $\mathbb R$  such  that :  $u' + 2  v'=0$
In  our  example we   have  :  $I=\mathbb R$  and  $u(t)=t$  and  $v(t)=\frac{c-t}2$
