Connected semi-riemannian manifold is an Einstein manifold. I'm reading the proof of the next proposition:
A semi-riemannian manifold $M$ is an Einstein manifold provided $Ric=cg$ for some constant $c.$ If $M$ is connected, $n=dim(M)\geq 3$ and $Ricfg=fg,$ then $M$ is Einstein.
The proof is the next:
Suposse $Ricfg=fg.$ Because of contraction $S=nf.$ Then, for the second Bianchi identity $dS=2divRic,$ so $ndf=2df.$ Then $f$ is constant.
I have two doubts: How the contraction gives the equality $S=nf?$ I don't get it. 
I've tried utilizing the second identity of Bianchi to get $dS=2divRic,$ but I don't get any useful.
If the previous holds, because of $M$ is connected and $n\geq 3$ the equality $ndf=2df$ implies $df=0.$ Then $f$ is constant and the proof is done.
Any kind of help is thanked in advanced.
 A: Note that $s = g^{ij}\operatorname{Ric}_{ij} = g^{ij}(fg_{ij}) = f\delta^i_i = nf$.
The second Bianchi identity reads 
$$R_{ijkl;m} + R_{ijlm;k} + R_{ijmk;l} = 0.$$
Tracing the $i$ and $l$ indices, we get
\begin{align*}
g^{il}R_{ijkl;m} + g^{il}R_{ijlm;k} + g^{il}R_{ijmk;l} &= 0\\
(g^{il}R_{ijkl})_{;m} + (g^{il}R_{ijlm})_{;k} + R_{ijmk}^{\;\;\;\;\;;i} &= 0\\
\operatorname{Ric}_{jk;m} - (g^{il}R_{ijml})_{;k} + R_{ijmk}^{\;\;\;\;\;;i} &= 0\\
\operatorname{Ric}_{jk;m} - \operatorname{Ric}_{jm;k} + R_{ijmk}^{\;\;\;\;\;;i} &= 0.
\end{align*}
Now, tracing the $j$ and $k$ indicies, we see that
\begin{align*}
g^{jk}\operatorname{Ric}_{jk;m} - g^{jk}\operatorname{Ric}_{jm;k} + g^{jk}R_{ijmk}^{\;\;\;\;\;;i} &= 0\\
(g^{jk}\operatorname{Ric}_{jk})_{;m} - \operatorname{Ric}_{jm}^{\;\;\;;j} + (g^{jk}R_{ijmk})^{;i} &= 0\\
s_{;m} - \operatorname{Ric}_{jm}^{\;\;\;;j} - (g^{jk}R_{jimk})^{;i} &= 0\\
s_{;m} - \operatorname{Ric}_{jm}^{\;\;\;;j} - \operatorname{Ric}_{im}^{\;\;\;;i} &= 0.\\
\end{align*}
So $ds = \nabla s = s_{;m} = 2\operatorname{Ric}_{im}^{\;\;\;;m} = 2\operatorname{div}\operatorname{Ric}$.
