Dirichlet energy in local coordinates

Let $f \colon (M,\gamma) \to (N,g)$ be a map between Riemannian manifolds. Choose local coordinates $(x^\alpha)$ on $N$ and $(y^i)$ on $N$. We shall regard $df$ as a section of the vector bundle $T^*M \otimes f^*(TN) \to M$, so that in our chosen coordinates: $$df = \frac{\partial f^i}{\partial x^\alpha}\,dx^\alpha \otimes \frac{\partial}{\partial y^i}$$ There are several metrics in play here:

  • Since $\gamma$ is a metric on $M$, each $\gamma|_x$ is an inner product on $T_xM$, which induces an inner product on $T_x^*M$. This latter inner product has components $$(\gamma^{\alpha \beta}).$$ Note that $(\gamma^{\alpha \beta})$ is the inverse matrix of $(\gamma_{\alpha \beta})$.

  • Similarly, since $g$ is a metric on $N$, each $g|_{f(x)}$ is an inner product on $T_{f(x)}N$, which induces (via the map $f \colon M \to N$) an inner product on $(f^*TN)_x$. This latter inner product has components $$(g_{ij} \circ f).$$

  • Using these two metrics, we get a metric --- which I'll denote $\langle \cdot, \cdot \rangle$ --- on $T^*M \otimes f^*(TN)$.

Putting this all together, we can now compute: \begin{align*} |df|^2 = \left\langle df, df \right\rangle & = \left\langle \frac{\partial f^i}{\partial x^\alpha}\,dx^\alpha \otimes \frac{\partial}{\partial y^i}, \, \frac{\partial f^j}{\partial x^\beta}\,dx^\beta \otimes \frac{\partial}{\partial y^j} \right\rangle \\ & = \frac{\partial f^i}{\partial x^\alpha}\, \frac{\partial f^j}{\partial x^\beta}\,\left\langle dx^\alpha \otimes \frac{\partial}{\partial y^i}, \,dx^\beta \otimes \frac{\partial}{\partial y^j} \right\rangle \\ & = \frac{\partial f^i}{\partial x^\alpha}\, \frac{\partial f^j}{\partial x^\beta}\,\gamma^{\alpha \beta}\, (g_{ij} \circ f). \end{align*} If the metric $g$ on $N$ is flat, then we can choose our coordinates $(y^i)$ so that $g_{ij} = \delta_{ij}$. In that case, our formula reduces to the one you wrote: $$|df|^2 = \frac{\partial f^i}{\partial x^\alpha}\, \frac{\partial f^i}{\partial x^\beta}\,\gamma^{\alpha \beta}$$


To add to Jesse's brilliant answer: if $V$ and $W$ are equipped with inner products, one can induce an inner product in ${\rm Hom}(V,W)$ by $\langle T,S\rangle = {\rm tr}(TS^*)$, where $S^*$ is the adjoint of $S$. This construction goes up to the level of bundles equipped with Riemannian fiber metrics, so it applies for the bundle morphism ${\rm d}f\colon TM\to TN$, and $$|{\rm d}f|^2 = \langle {\rm d}f,{\rm d}f\rangle = {\rm tr}({\rm d}f\,({\rm d}f)^*)$$makes sense. I'll use Jesse's notation for the metrics $\gamma$ and $g$, as well as coordinates $(x^\alpha)$ and $(y^i)$ for $M$ and $N$, respectively. Write ${\rm d}f(\partial_\beta) = (\partial_\beta f^i)\partial_i$ and $({\rm d}f)^*(\partial_j) = A_j^\alpha \partial_\alpha$, for some coefficients $A^\alpha_j$ to be found. The relation $$\gamma(\partial_\beta, ({\rm d}f)^*(\partial_j)) = g({\rm d}f(\partial_\beta),\partial_j)$$reads $$\gamma_{\beta\alpha}A^\alpha_j = (\partial_\beta f^i)g_{ij} \implies A^\alpha_j = \gamma^{\alpha\beta} (\partial_\beta f^i)g_{ij},$$so that we conclude again that $$\langle {\rm d}f,{\rm d}f\rangle = (\partial_\alpha f^i)A^\alpha_i = (\partial_\alpha f^i)\gamma^{\alpha\beta}(\partial_\beta f^j)g_{ji}, $$as wanted.