Solution
= Solution
The metric and orientation determine the <Riemannian volume form>: in a positively oriented coordinate chart $(x^1,\ldots,x^n)$,
$$
d\operatorname{vol}_g=\sqrt{\det(g_{ij})}\,dx^1\wedge\cdots\wedge dx^n.
$$
Writing $|g|=\det(g_{ij})$ and $(g^{ij})=(g_{ij})^{-1}$, the <Dirichlet energy on a Riemannian manifold> with source $f$ is
$$
E(u)=\int_M\left(\frac12g^{ij}(x)\,\partial_i u\,\partial_j u-fu\right)\sqrt{|g|}\,dx^1\cdots dx^n.
$$