Variation of term like $\frac{\partial R_{ab} R^{ab}}{\partial R_{abcd}}$, $\frac{\partial R_{abcd} R^{abcd}}{\partial R_{efgh}}$ This is related to my previous question Variation with respect to $R_{abcd}$? How to compute$\frac{\partial R}{\partial R_{abcd}}=\frac{1}{2}(g^{ac} g^{bd} - g^{ad} g^{bc})$? 
In this case i'd like to compute Ricci tensor 
\begin{align}
\frac{\partial R_{ab} R^{ab}}{\partial R_{abcd}}=
\end{align}
In this case how do i compute the derivatives? 
And further for 
\begin{align}
\frac{\partial R_{abcd} R^{abcd}}{\partial R_{efgh}}
\end{align}
can i use former derivatives $(X^2)'= 2X$, and say above thing as $2 R_{efgh}$?
 A: We begin by noting that $$\frac{\partial R_{ab}}{\partial R_{cdef}}=\frac{\partial\left(R_{caeb}g^{ce}\right)}{\partial R_{cdef}}=\frac{\partial\left(R_{cdef}\delta_{a}^{d}\delta_{b}^{f}g^{ce}\right)}{\partial R_{cdef}},$$ 
suggesting an answer along the lines of $\delta_{a}^{d}\delta_{b}^{f}g^{ce}$. But by the antisymmetry properties of the Riemann tensor, there's more than one way to write $R_{ab}$ as a contradiction of $R_{cdef}$ with a tensor.
We need an antisymmetry when exchanging $c$ with $d$, suggesting an answer along the lines of $\frac{1}{2}\left(\delta_{a}^{d}\delta_{b}^{f}g^{ce}-\delta_{a}^{c}\delta_{b}^{f}g^{de}\right)$. But that can't be quite right either: we also need an antisymmetry when exchanging $e$ with $f$, suggesting an answer along the lines of $\frac{1}{4}\left(\delta_{a}^{d}\delta_{b}^{f}g^{ce}-\delta_{a}^{c}\delta_{b}^{f}g^{de}-\delta_{a}^{d}\delta_{b}^{e}g^{cf}+\delta_{a}^{c}\delta_{b}^{e}g^{df}\right)$. But we still need $cdef\to efcd$ to be a symmetry, giving the final result 
$$\frac{\partial R_{ab}}{\partial R_{cdef}}=X_{ab}^{cdef}:=\frac{1}{8}\left(\left(\delta_{a}^{d}\delta_{b}^{f}+\delta_{a}^{f}\delta_{b}^{d}\right)g^{ce}-\left(\delta_{a}^{c}\delta_{b}^{f}+\delta_{a}^{f}\delta_{b}^{c}\right)g^{de}-\left(\delta_{a}^{d}\delta_{b}^{e}+\delta_{a}^{e}\delta_{b}^{d}\right)g^{cf}+\left(\delta_{a}^{c}\delta_{b}^{e}+\delta_{a}^{e}\delta_{b}^{c}\right)g^{df}\right).$$ 
Note that every term has $ab$ as lower indices and $cdef$ as upper indices.
By the product rule, $$\frac{\partial\left(R_{ab}R^{ab}\right)}{\partial R_{cdef}}=\frac{\partial R_{ab}}{\partial R_{cdef}}R^{ab}+R_{ab}\frac{\partial R^{ab}}{\partial R_{cdef}}.$$ 
We can change the heights of $a,\,b$ in the second term, viz. $$\frac{\partial\left(R_{ab}R^{ab}\right)}{\partial R_{cdef}}=2R^{ab}X_{ab}^{cdef}.$$ 
Expressions such as $R^{ab}\delta_{a}^{d}\delta_{b}^{f}g^{ce}=g^{ce}R^{df}$ give $$\frac{\partial\left(R_{ab}R^{ab}\right)}{\partial R_{cdef}}=\frac{1}{2}\left(g^{ce}R^{df}-g^{de}R^{cf}-g^{cf}R^{de}+g^{df}R^{ce}\right).$$
Note that every term has $cdef$ as upper indices and $ab$ don't exist on the right-hand side, since they're dummy indices contracted out on the left-hand side.
For the second derivative, imagine we instead wanted $\frac{\partial \left(V_aV^a\right)}{\partial V_b}$ for a vector; the answer would be $2V^b$, suggesting an answer like $2R^{efgh}$. This already has the right properties, so we're done.
A: From the helpful comment @J.G., 
\begin{align}
  \frac{\partial (R_{ab} R^{ab})}{\partial R_{cdef}} = 2 R^{ab} X^{cdef}_{ab}, \qquad X^{cdef}_{ab} = \frac{\partial R_{ab}}{\partial R_{cdef}} 
\end{align}
Try to compute
\begin{align}
  R_{\mu\nu} &= R_{abcd} g^{bd} \delta_\mu^a \delta_\nu^c  \\
    & = \frac{1}{8} R_{abcd} (g^{bd} \delta_\mu^a \delta_\nu^c + g^{bd} \delta_\mu^c \delta_\nu^a
  - g^{ad} \delta_\mu^b \delta_\nu^c - g^{ad} \delta_\mu^c \delta_\nu^b
  - g^{bc} \delta_\mu^d \delta_\nu^a - g^{bc} \delta_\mu^a \delta_\nu^c
  + g^{ac} \delta_\mu^d \delta_\nu^b + g^{ac} \delta_\mu^b \delta_\nu^d)   
\end{align}
where i antisymmetrized (a,b) and (c,d) and symmetrized the pairs (ab, cd), and symmetrized $\mu,\nu$ in side paranthesis
Thus i guess that
\begin{align}
  X^{abcd}_{\mu\nu} =\frac{\partial R_{\mu\nu}}{\partial R_{abcd}}
  =\frac{1}{8} (g^{bd} \delta_\mu^a \delta_\nu^c + g^{bd} \delta_\mu^c \delta_\nu^a
  - g^{ad} \delta_\mu^b \delta_\nu^c - g^{ad} \delta_\mu^c \delta_\nu^b
  - g^{bc} \delta_\mu^d \delta_\nu^a - g^{bc} \delta_\mu^a \delta_\nu^c
  + g^{ac} \delta_\mu^d \delta_\nu^b + g^{ac} \delta_\mu^b \delta_\nu^d) 
\end{align}
\begin{align}
  \frac{\partial R_{\mu\nu} R^{\mu\nu}}{\partial R_{abcd}}
   & = R^{a[c} g^{b]d} + R^{b[d} g^{a]c}  
 =\frac{1}{2} \left( R^{ac} g^{bd} - R^{bc} g^{ad} - R^{ad} g^{cb} + R^{bd} g^{ca}\right)
\end{align}
Am i right?
