How to obtain the field equations in Brans-Dicke theory from the action? The action for the Brans-Dicke-Jordan theory of gravity is 
$$
\\S =\int d^4x\sqrt{-g} \; 
\left(\frac{\phi R - \omega\frac{\partial_a\phi\partial^a\phi}{\phi}}{16\pi} + \mathcal{L}_\mathrm{M}\right).
$$
And the field equations of the gravitation field are
$$
G_{ab} = \frac{8\pi}{\phi}T_{ab}+\frac{\omega}{\phi^2}
(\partial_a\phi\partial_b\phi-\frac{1}{2}g_{ab}\partial_c\phi\partial^c\phi)
+\frac{1}{\phi}(\nabla_a\nabla_b\phi-g_{ab}\Box\phi).
$$
I tried to vary this action w.r.t $g_{ab}$ but failed.
How can I obtain these from the action? Where can I get the detailed derivation? Thx!
 A: The action which describes Brans-Dicke theory is given by,
$$S=\frac{1}{16\pi G}\int d^4x \, \sqrt{|g|} \left( -\Phi R + \frac{\omega}{\Phi}\partial_\mu \Phi \partial^\mu \Phi \right)$$
which features a scalar field $\Phi$ coupling to gravity through the Ricci scalar, and with its own kinetic term. To obtain the equations of motion, we vary our action with respect to the scalar and metric, like so,
$$\delta S = \frac{1}{16\pi G} \int d^4x \, \delta \Phi \left( -R - \frac{2\omega}{\Phi} \square \Phi + \frac{\omega}{\Phi^2} \partial_\mu \Phi \partial^\mu\Phi\right)$$
$$-\delta g^{\mu\nu} \left(\Phi G_{\mu\nu}-\frac{\omega}{\Phi} \partial_\mu \Phi \partial_\nu \Phi + \frac{1}{2}g_{\mu\nu}\frac{\omega}{\Phi}\partial_\lambda \Phi \partial^\lambda \Phi\right) + \Phi (\nabla_\mu\nabla_\nu \delta g^{\mu\nu}-\square g_{\mu\nu}\delta g^{\mu\nu})$$
where we have already performed an integration by parts. From the variation, we may deduce,
$$\Phi G_{\mu\nu} - \nabla_\mu \nabla_\nu \Phi + g_{\mu\nu} \square \Phi - \frac{\omega}{\Phi} \left( \partial_\mu \Phi \partial_\nu \Phi - \frac{1}{2}g_{\mu\nu} (\nabla\Phi)^2\right) = 8\pi T_{\mu\nu}$$
for some background matter with stress-energy tensor $T_{\mu\nu}$. There is an additional equation of motion due to the scalar field, namely,
$$\Phi R + 2\omega \square \Phi - \frac{\omega}{\Phi} (\nabla\Phi)^2 = 0$$
which is zero providing the scalar field does not couple to the background matter. We can now take a trace with respect to the metric of the first equation, obtaining,
$$-\Phi R+3\square \Phi + \frac{\omega}{\Phi}(\nabla \Phi)^2 = 8\pi T$$
presuming $d=4$, where $T \equiv T^\mu_\mu$. Adding this equation to the previous, we find,
$$(3+2\omega) \square \Phi = 8\pi T.$$
The parameter $\omega$ measures how strongly $\Phi$ couples to matter content. We can rewrite the 'Einstein' field equations as,
$$R_{\mu\nu}-\frac{1}{\Phi}\nabla_\mu \nabla_\nu \Phi + \frac{1}{\Phi}g_{\mu\nu} \square \Phi - \frac{\omega}{\Phi^2}\partial_\mu \Phi \partial_\nu \Phi = \frac{8\pi}{\Phi}T_{\mu\nu} - g_{\mu\nu}\frac{\omega}{\Phi} \Phi \square \Phi$$
by expanding the Einstein tensor and substituting the relation between the Ricci scalar and field. We can now write a relation between the Ricci tensor, field and stress-energy tensor, namely,
$$R_{\mu\nu}-\frac{1}{\Phi}\nabla_\mu \nabla_\nu \Phi - \frac{\omega}{\Phi^2}\partial_\mu \Phi \partial_\nu \Phi = \frac{8\pi}{\Phi} \left( T_{\mu\nu}-\frac{(\omega+1)}{(3+2\omega)}T g_{\mu\nu} \right)$$
A: I have been in your situation. I agree with Andrew and I've found this helpful
http://arxiv.org/abs/1002.0617v4. Go directly to appendix B, There you will find the answer of an identical problem and you shall use appendix A, as well.
A: In "The Scalar-Tensor Theory of Gravitation", of Yasunori Fujii and Kei-ichi Maeda you can find explicitly the solution, in Appendix C (pag. 195).
Personally, I really didn't like this book and even this demonstration it's very difficult to follow. 
So I did it in another way. Use the usual theory for the GR part, and isolate this term:
$\int d^4 x \sqrt{-g}\Phi \delta R_{\mu\nu}g^{\mu\nu} $
Then you can use the Palatini Identity:
\begin{equation}
\delta R_{\mu\nu}=\left( \delta \Gamma^{\alpha}_{\mu\nu} \right)_{;\alpha}-\left( \delta \Gamma^{\alpha}_{\mu\alpha} \right)_{;\nu}
\end{equation}
So:
\begin{equation}
\begin{split}
\delta R_{\mu\nu}g^{\mu\nu} &=g^{\mu\nu}\left[ \left( \delta \Gamma^{\alpha}_{\mu\nu} \right)_{;\alpha}-\left( \delta \Gamma^{\alpha}_{\mu\alpha} \right)_{;\nu} \right]= \dots \\
& \dots =\left(g^{\mu\nu} \delta \Gamma^{\alpha}_{\mu\nu} \right)_{;\alpha}-\left(g^{\mu\nu} \delta \Gamma^{\alpha}_{\mu\alpha} \right)_{;\nu}=\left(g^{\mu\nu} \delta \Gamma^{\beta}_{\mu\nu} -g^{\mu\beta} \delta \Gamma^{\alpha}_{\mu\alpha} \right)_{;\beta}
\end{split}
\end{equation}
In GR you don't have $\Phi$, so this term simply goes to zero thanks to Gauss's Theorem. Now you need to integrate by parts twice. The second integration by parts comes from the explicit expression  of $\delta \Gamma^{\alpha}_{\mu\nu}$. In order to simplify, go into a Locally inertial frame, where:
\begin{equation}
\delta \Gamma^{\beta}_{\mu\nu}=\frac{1}{2}g^{\rho\beta}[ \left(\partial_\nu \delta g_{\rho\mu}\right)+\left(\partial_\mu \delta g_{\rho\nu} \right)-\left(\partial_\rho \delta g_{\nu\mu} \right) ]
\end{equation}
At the end go to a general frame, so $\partial \rightarrow \nabla$. These are all the difficult steps, there are some simple calculations to be done in the middle.
