\[ \newcommand{\d}{\mathrm{d}} \newcommand{\e}{\mathrm{e}} \newcommand{\i}{\mathrm{i}} \DeclareMathOperator{\grad}{grad} \]

Let \((M,g)\) be a smooth Riemannian manifold and \(f\) a real-valued smooth function on \(M\). Due to the representation in local coordinates of the tangent-cotangent isomorphism as well as the representation in local coordinates of \(df\), the gradient is represented in local coordinates as follows

\begin{equation*} \grad f = g^{ij} \frac{\partial f}{\partial x^j} \frac{\partial }{\partial x^i}. \end{equation*}
Remarks
  • For the euclidean metric we obtain the usual gradient \begin{equation*} \grad f = \delta^{ij} \frac{\partial f}{\partial x^j} \frac{\partial }{\partial x^i}= \sum_{i=1}^{n} \frac{\partial f}{\partial x^i} \frac{\partial }{\partial x^i}. \end{equation*}