Solution (source code)

= Solution

Adopt the printed <Riemann curvature tensor> convention and contract $R_{ab}=R^c{}_{acb}$. At an arbitrary point choose <normal coordinates> for the original <metric tensor>. There the original connection coefficients vanish. Varying the coordinate curvature formula leaves
$$
\delta R^a{}_{bcd}=\partial_c C^a{}_{bd}-\partial_d C^a{}_{bc}.
$$
At that point these partial derivatives equal the <covariant derivatives> of the tensor $C$. Both sides are tensors, so the result is valid in every coordinate system:
$$
\delta R^a{}_{bcd}=\nabla_c C^a{}_{bd}-\nabla_d C^a{}_{bc}.
$$
Contracting its first and third indices proves the <Palatini identity>
$$
\boxed{\delta R_{ab}=\nabla_c\delta\Gamma^c{}_{ab}-\nabla_b\delta\Gamma^c{}_{ac}.}
$$
The normal-coordinate argument is applied independently at every point; it does not assume a flat background or set derivatives of the original connection to zero.