# Taking a derivative involving Einstein summation

Suppose I have something like $f = g_{\mu \nu} x^{\mu} x^{\nu}$, where the Einstein summation convention is implied. Now suppose I want to to take the derivative $\partial_{\mu}f = \frac{\partial f}{\partial x^{\mu}}$. How would I go about doing this? I figure it's not just going to be $\partial_{\mu} f = g_{\mu \nu} x^{\nu}$.

-

Use the product rule: \begin{align*} \partial_\lambda(g_{\mu\nu} x^\mu x^\nu) &= g_{\mu\nu,\lambda} x^\mu x^\nu + g_{\mu\nu} x^\mu_{,\lambda} x^\nu + g_{\mu\nu} x^\mu x^\nu_{,\lambda} \\&= g_{\mu\nu,\lambda} x^\mu x^\nu + g_{\mu\nu} \delta^\mu_\lambda x^\nu + g_{\mu\nu} x^\mu \delta^\nu_\lambda \\&= g_{\mu\nu,\lambda} x^\mu x^\nu + g_{\lambda\nu} x^\nu + g_{\mu\lambda} x^\mu \\&= g_{\mu\nu,\lambda} x^\mu x^\nu + 2 g_{\lambda\nu} x^\nu \end{align*} where I've used the convention $T^{\mu...}_{\nu...,\lambda} \equiv \partial_\lambda T^{\mu...}_{\nu...}$, the fact that $x^\mu_{,\lambda}=\delta^\mu_\lambda$ and the symmetry of $g_{\mu\nu}$.

-
Assuming that $g_{\mu \nu}$ is the Minkowski metric. One can say that
$\partial_{\mu}x^{\alpha} = \frac{\partial x^{\alpha}}{\partial x^{\mu}} =\delta_{\mu}^{\alpha}$
Therefore $\partial_{\mu} f = 2 g_{\mu \nu} x^{\nu}$
If $g_{\mu \nu}$ is not a constant there is another term containing derivative of $g_{\mu \nu}$.