It's supposed to be ugly since it has so many higher order terms... and you have them all in your lagrangian (I wonder where did you find it).
Not that they don't exist (eg the Kretschmann scalar as I read has applications in quantum gravity), but the Lagrangian looks awful.
As for the post
ChrisVer said:
Also , since you work with variations it's better to work with the action, rather than the lagrangian. The action will be for this R_{abcd}R^{abcd} only term [Kretschmann scalar]:
S = \int d^4 x \sqrt{-g} R_{abcd}R^{abcd}
So when you vary it with respect to the metric, you will get an additional term from the variation of the \sqrt{-g} which will also exist in the equations of motion... I would try to bring it to a form:
\delta S = \int d^4 x [A]_{ij} \delta g^{ij}
And thus the EoM will be \frac{\delta S}{\delta g^{\mu \nu}}=A_{ij} \delta^{i}_\mu \delta^j_\nu=A_{\mu \nu}=0
with A given by the terms coming from the variation of the Kretschmann scalar and the square root of the determinant of the metric...
In your case you have addiitional terms coming from the Ricci scalar^2 and the "Ricci curvature^2"...
I just sketched the idea of working this out... you will have:
S= \int d^4 x \sqrt{-g} L
take variation wrt the metric field:
\delta _g S = \int d^4 x \sqrt{-g} \delta_g L + \int d^4 x L \delta_g \sqrt{-g}
you will somehow try (I don't know whether that is possible or not) to bring \delta_g L= A_{ij} \delta g^{ij}~~(1)
and similar for \delta_g \sqrt{-g} = B_{ij} \delta g^{ij}~~(2) so that:
\delta _g S = \int d^4 x A_{ij} \sqrt{-g} \delta g^{ij}+ \int d^4 x L B_{ij} \delta g^{ij}
or
\delta _g S = \int d^4 x (A \sqrt{-g}+BL)_{ij} \delta g^{ij}= \int d^4 x (C)_{ij} \delta g^{ij}
The EoM will be then C_{ij}=0 where you determine C by A,B which you determine by the variations (1),(2).
In case you have the covarant derivatives of the variations of the metric, you can bring them out using:
\nabla_\alpha ( A B)=A \nabla_\alpha B + (\nabla_\alpha A) B