# mean curvature is trace of second fundamental form?

My understanding was that, from the Weingarten equations, mean curvature $H$ of a surface in $\mathbb{R}^3$ satisfied

$$2H = \operatorname{tr}(g^{-1} b),$$

where $g$ is the first fundamental form (metric of the surface) and $b$ is the second fundamental form.

However, on Wikipedia at the article on Mean Curvature, I find the following sentence:

More abstractly, the mean curvature is the trace of the second fundamental form divided by n (or equivalently, the shape operator).

Which asserts that $$2H = \operatorname{tr}(b).$$ Which is it? Are the two expressions somehow equal?

They are the same thing written in different notation - the second equation would probably be clearer if written $2 H = \mathrm{tr}_g (b)$.
Because the second fundamental form is a $(0,2)$-tensor, it does not have a trace in the simplest sense. If you naively write down $\mathrm{tr}(b) = \sum_i b_{ii}$ then you have an expression that depends on the coordinate system/frame you compute it in. However, the metric $g$ gives us a way of taking the trace of any tensor in a meaningful way.
The "trace with respect to $g$" is this trace when calculated in an orthonormal frame, or equivalently $$\mathrm{tr}_g(b) := \mathrm{tr}(g^{-1} b) = \sum_{i,j} g^{ij} b_{ij}.$$ Since $g^{-1} b$ is a $(1,1)$-tensor, this trace does not depend on the orthonormal frame chosen - it is a function on the surface independent of the coordinates chosen.