Geodesic equation derivation I am having some issues completing the derivation of the geodesic equation using the Lagrangian and also trying by differentiating the metric with respect to the path length parameter.
When attempting to  do it using calculus of variations, I am struggling to understand where the Lagrangian comes from and how to use it.
When attempting by differentiating the metric with respect to the path length paramter, I am confused on how to replace
\begin{equation}
\frac{\partial g_{\mu\nu}}{\partial x^\sigma}
\end{equation}
with
\begin{equation}
\left[2\frac{\partial g_{\mu\nu}}{\partial x^\sigma} - \frac{\partial g_{\sigma\mu}}{\partial x^\nu} - \frac{\partial g_{\sigma\nu}}{\partial x^\mu}\right] \frac{dx^{\mu}}{ds} \frac{dx^{\nu}}{ds}   \frac{dx^{\sigma}}{ds}.
\end{equation}
I was trying to follow the derivation on this website but got confused at this point.
I would like to understand both ways purely so that I can continue my education on how particles move on curved spaces.
 A: The spacetime action can be be written in the form where the Lagrangian is expressed as the relativistic energy-mass relation $L=mc^2$. Where ${ds}=c{\,}{d\lambda}=\sqrt{{\mp}g_{{\mu}{\nu}}{\,}{dq^{\mu}}{dq^{\nu}}}$ is the spacetime line element of any choosen space- or timelike curve, for which there exists a parameterization that is infinitely many times continuously differentiable and maps a non-empty interval of real numbers onto a compact subset on the Minkowski space of the spacetime continuum. Hence
\begin{align}
S=\int{mc^2}{d\lambda}={mc}\int{ds}
\end{align}
If we now follow the principle of stationary action and therefore vary this term, one can conclude that the variation $\delta{ds}$ has to be zero.
\begin{align}
0&=\delta{ds}=
{dq^{\mu}}{dq^{\nu}}\delta{g_{{\mu}{\nu}}}+2g_{{\mu}{\nu}}{dq^{\mu}}\delta{dq^{\nu}}
=\partial_{\omega}g_{{\mu}{\nu}}\frac{dq^{\mu}}{d\lambda}\frac{dq^{\nu}}{d\lambda}\delta{q^{\omega}}+2g_{{\mu}{\nu}}\frac{dq^{\mu}}{d\lambda}\frac{d\delta{q^{\nu}}}{d\lambda}
\end{align}
Furthermore using the product rule we can further reduce the second term.
\begin{align}
g_{{\mu}{\nu}}\frac{dq^{\mu}}{d\lambda}\frac{d\delta{q^{\nu}}}{d\lambda}
=\frac{d}{d\lambda}\bigg(g_{{\mu}{\nu}}\frac{dq^{\mu}}{d\lambda}\delta{q^{\nu}}\bigg)-\frac{d}{d\lambda}\bigg(g_{{\mu}{\nu}}\frac{dq^{\mu}}{d\lambda}\bigg)\delta{q^{\nu}}
{\,}{\equiv}{\,}-\frac{d}{d\lambda}\bigg(g_{{\mu}{\nu}}\frac{dq^{\mu}}{d\lambda}\bigg)\delta{q^{\nu}}
\end{align}
Since, total derivatives only yield on boundary manifolds when integrated, therefore vanish elsewhere, these terms do not contribute to the variation and can be omitted. Now our term becomes:
\begin{align}
0&=\delta{ds}
=\partial_{\omega}g_{{\mu}{\nu}}\frac{dq^{\mu}}{d\lambda}\frac{dq^{\nu}}{d\lambda}-2\frac{d}{d\lambda}\bigg(g_{{\mu}{\omega}}\frac{dq^{\mu}}{d\lambda}\bigg)
\\&=-\partial_{\omega}g_{{\mu}{\nu}}\frac{dq^{\mu}}{d\lambda}\frac{dq^{\nu}}{d\lambda}+\bigg(\partial_{\alpha}g_{{\mu}{\omega}}\frac{dq^{\mu}}{d\lambda}+\partial_{\alpha}g_{{\omega}{\nu}}\frac{dq^{\nu}}{d\lambda}\bigg)\frac{dq^{\alpha}}{d\lambda}+2g_{{\mu}{\omega}}\frac{d^2q^{\mu}}{d\lambda^2}
\\&=\frac{1}{2}g^{{\alpha}{\omega}}(\partial_{\nu}g_{{\mu}{\omega}}+\partial_{\mu}g_{{\omega}{\nu}}-\partial_{\omega}g_{{\mu}{\nu}})\frac{dq^{\mu}}{d\lambda}\frac{dq^{\nu}}{d\lambda}+\frac{d^2q^{\alpha}}{d\lambda^2}
\end{align}
And, considering we can represent the Christoffel symbol as the following metric connection $\Gamma^{\alpha}_{{\mu}{\nu}}=\frac{1}{2}g^{{\alpha}{\omega}}(\partial_{\nu}g_{{\mu}{\omega}}+\partial_{\mu}g_{{\omega}{\nu}}-\partial_{\omega}g_{{\mu}{\nu}})$
our equation can finally be described in the following term:
\begin{align}
\Gamma^{\alpha}_{{\mu}{\nu}}\frac{dq^{\mu}}{d\lambda}\frac{dq^{\nu}}{d\lambda}+\frac{d^2q^{\alpha}}{d\lambda^2}=0
\end{align}
This Geodesic-Equation can now be interpreted as equation of motion for the metric field of any curve that represents the shortes path between two points in a Riemannian manifold.
$\mathfrak{Q.E.D.}$
