Say we have two functions $f, g: \mathbb{R}^n \rightarrow \mathbb{R}$ and we have a matrix $M \in \mathbb{R}^{n \times n}$ which is constant, i.e. not a function of $x$. Say we know that $\nabla f = M \nabla g$, then can we say anything about the relationship between $f$ and $g$?
What about in the case that $M$ is a function of $x$?
I have not been able to discover any relation between $f$ and $g$ in either case, but I feel like there should be something. I know that we can apply the chain rule in the case where we have $\nabla f = \lambda(g(x)) \nabla g$ and $\lambda: \mathbb{R} \rightarrow \mathbb{R}$