I have been working on deriving the geodesic action via finding the stationary points of the proper-time integral for a massive point particle. Consider a space-time manifold $M$ ($\dim M=4)$ equipped with a metric $g$. The space-time element in coordinates is then $$ds^2=g_{\mu\nu}dx^\mu dx^\nu$$ where Einstein convention has been used. Setting $c=1$, the infinitesimal proper time, $d\tau=\sqrt{-ds^2}$, is then $$d\tau=\sqrt{-g_{\mu\nu}dx^\mu dx^\nu}$$ The proper time elapsed between two points $x(\chi_1)$ and $x_2(\chi_1)$ on a curve parameterized by $x^\rho=x^\rho(\chi)$ can be found by the following integral $$\mathcal{S}=\int_{\chi_1}^{\chi_2}\sqrt{-g_{\mu\nu} \dot{x}^{\mu}\dot{x}^\nu}d\chi$$ where $\dot{x}=\frac{dx}{d\chi}$. We know that a massive particle will take the path that makes this integral stationary to first order, and this path will be a geodesic (this is correct, assuming that the manifold is nice enough, right?).
My question is this: because it is easier to vary just the square of the integrand, is the following correct $$\delta S=\int_{\chi_1}^{\chi_2}\delta\sqrt{-g_{\mu\nu} \dot{x}^{\mu}\dot{x}^\nu}d\chi=\int_{\chi_1}^{\chi_2}\frac{1}{2\sqrt{-g_{\mu\nu} \dot{x}^{\mu}\dot{x}^\nu}}\delta\left( -g_{\mu\nu} \dot{x}^{\mu}\dot{x}^\nu\right) d\chi ~?$$
I have seen this in a document (I don't remember the source) but wasn't sure if this "Chain-rule" for variations/functional derivatices was correct.
I should mention that I am looking for a proof, if possible.