Let $(M, g)$ be a Riemannian manifold of dimension $n$. We define the Laplace operator by $\Delta = dd^* + d^*d$, where $d$ is the exterior derivative and $d^* = (-1)^{nk + 1} * d~*: \Omega^k(M) \to \Omega^{n - 1}(M)$ its formal adjoint (with $*$ the Hodge operator). I am trying to compute the Laplace operator on $C^\infty(M)$. I know it should look like $$\Delta f = \frac{1}{\sqrt{|g|}}\partial_i\left(\sqrt{|g|} ~g^{ij}\partial_j f\right),$$ where $|g| = \text{det}(g_{ij})$ and $g^{ij} = (g^{-1})_{ij}$, but I do not get the right answer when I try to do it myself. Here is my attempt:
For $f \in \Omega^0(M) = C^\infty(M),$ we have $$\Delta f = d^* d = -*d* df.$$ Therefore, we have $$df = \sum_j \partial_j f dx^j \quad \Rightarrow \quad *df = \sum_j \partial_jf \sqrt{|g|} ~(-1)^{j-1}dx^1 \wedge \ldots \wedge \widehat{dx^j} \wedge \ldots \wedge dx^n$$ as the Riemannian volum form is given by $$\text{vol} = \sqrt{|g|}~dx^1 \wedge \ldots \wedge dx^n.$$ From this we deduce that \begin{align} d*df &= \sum_i \partial_i\left(\sum_j \partial_j f \sqrt{|g|}\right)(-1)^{j-1} dx^{i} \wedge dx^1 \wedge \ldots \wedge \widehat{dx^j} \wedge \ldots \wedge dx^n \\ &= \sum_j \partial_j\left(\partial_j f \sqrt{|g|}\right) dx^{1} \wedge \ldots \wedge dx^n\\ &= \frac{1}{\sqrt{|g|}}\sum_j \partial_j\left(\partial_j f \sqrt{|g|}\right)\text{vol}, \end{align} so that $$\Delta f = - \frac{1}{\sqrt{|g|}}\sum_j \partial_j\left(\partial_j f \sqrt{|g|}\right).$$ Is it the right way to do that ? Where is my mistake ?
Your mistake is in the computation of $\ast \, df$: The formula for the Hodge star operator is $\alpha \wedge \ast \beta = \langle \alpha , \beta \rangle \, \mathrm{vol}$, which also involves the inverse metric. The relevant consequence is
$$ \ast \, dx^i = \sum_{j=1}^n (-1)^{j-1} \sqrt{\lvert g \rvert} g^{ij} dx^1 \wedge \dotsm \wedge \widehat{dx^j} \wedge \dotsm \wedge dx^n . $$
The apparent sign error is because your expected formula is incorrect. The Hodge Laplacian as you define it is a nonnegative operator, while your expected operator is nonpositive (check by integrating by parts).