Finding a differential equation for a scalar field, given a stress energy tensor For a given scalar field $\phi$, the stress energy tensor is
\begin{equation}
T_{\mu\nu}=\partial_{\mu}\phi\partial_{\nu}\phi - \frac{1}{2} g_{\mu\nu}(\partial_{\alpha}\phi\partial^{\alpha}\phi).
\end{equation}
How can I get a second order differential equation for $\phi$, assuming that the metric $g_{\mu\nu}$ satisfies Einstein's equation?
I tried to use the identity $\nabla^{\mu}G_{\mu\nu}=0$, getting the following equation
\begin{equation}
0=\nabla^{\mu}T_{\mu\nu}=g^{\mu\rho}\nabla_{\rho}T_{\mu\nu}=g^{\mu\rho}(\partial_{\rho}T_{\mu\nu}-\Gamma^{\alpha}_{\rho\mu}T_{\alpha\nu}-\Gamma^{\alpha}_{\nu\rho}T_{\mu\alpha}).
\end{equation}
But turns out that this is not a second order differential equation. How can I get such equation?
 A: HINT:  It'll be easiest to just write the stress-energy tensor in terms of the covariant derivative (note that these are equivalent for scalar fields):
$$
T_{\mu \nu} = \nabla_\mu \phi \nabla_\nu \phi - \frac{1}{2} g_{\mu \nu} \nabla^\rho \phi \nabla_\rho \phi
$$
Now take the divergence of $T_{\mu \nu}$ without writing down any Christoffel symbols;  leave all your derivatives in terms of $\nabla_\mu$, rather than $\partial_\mu$.  Use the facts that $\nabla_\mu$ obeys the product rule, and that by definition $\nabla_\mu g_{\rho \sigma} = 0$.
BTW, the assumption that $g_{\mu \nu}$ satisfies Einstein's equations is completely unnecessary for this derivation.  
A: Note that what you did does not provide a second order differential equation for $\phi$, since $T_{\mu\nu}$ is already second order in the derivatives.
The stress-energy tensor of a matter sector is given by:
$$
T_{\mu\nu}=\frac{1}{\sqrt{g}}\frac{\delta S_m}{\delta g^{\mu\nu}}
$$
so we need to find an action $S_m=\int d^4x\,\sqrt{g}\,\mathcal{L}[\phi,\partial_\mu\phi]$ such that 
$$
T_{\mu\nu}=\partial_{\mu}\phi\partial_{\nu}\phi - \frac{1}{2} g_{\mu\nu}(\partial_{\alpha}\phi\partial^{\alpha}\phi)
$$
and since $\phi$ is scalar, and $T_{\mu\nu}$ is second order in the derivatives, we can easily conclude that:
$$
\mathcal{L}=g^{\mu\nu}\partial_{\mu}\phi\partial_{\nu}\phi
$$
Now, you calculate the equations of motion for $\phi$:
$$
\frac{\delta S_m}{\delta \phi}=0
$$
that is:
$$
\partial_{\mu}(\sqrt{g}\,\frac{\partial\mathcal{L}}{\partial(\partial_\mu\phi)})=0
$$
a second order differential equation for $\phi$, for a given $g_{\mu\nu}$ determined.
