Double contraction of curvature tensor -> Ricci scalar times metric

Main Question or Discussion Point

Double contraction of curvature tensor --> Ricci scalar times metric

I'm trying to follow the derivation of the Einstein tensor through double contraction of the covariant derivative of the Bianchi identity. (Carroll presentation.) Only one step in this derivation still puzzles me.

What I understand:
You take the derivative of each of the 3 Bianchi terms (curvature tensor with first 3 indices permuted), then double contract by multiplying whole expression by two contravariant metric tensors. On two terms, one of the raising indices matches the covariant derivative index, leaving one to raise an index on the curvature tensor, so that you get two copies of the (derivative of the) Ricci tensor. On the third term, both indices match indices on the curvature tensor, so it gets doubly contracted to Ricci scalar. Then you move the derivative operator outside the remaining expression (=Einstein tensor), showing that covariant derivative of Einstein tensor is zero, as required.

What I don't understand:
Ricci scalar ends up multiplying metric tensor. I can see that the final expression needs double-indexed tensors to balance out (and match stress-energy tensor). But how exactly did metric tensor get there, as result of double contraction? Normally this contraction is shown as just leaving scalar R. Does it depend on the contraction occurring inside a derivative?

Related Special and General Relativity News on Phys.org
Bill_K

Following what you described, you got

2 Rμν;ν + R = 0

Rewrite the last term as (gμνR) and you will have it.

I see, I forgot to raise the index of the third derivative operator, to match the other two.
Thanks!