This should be pretty simple to check if you know the basics of variational calculus. I feel like I am making an obvious mistake somewhere like not using chain rule somewhere. Let $g : \mathbb{R}^n \times \mathbb{R}^n \rightarrow \mathbb{R}$ be a smooth metric on some domain in $\mathbb{R}^n$, and let $\gamma : [0,1] \rightarrow \mathbb{R}^n$ be a smooth path in this domain. I'm trying to show that minimising the length functional $$A(\gamma) = \int_0^1 \sqrt{g(\dot{\gamma},\dot{\gamma})} dt$$ is equivalent to minimising the action functional $$E(\gamma) = \frac{1}{2} \int_0^1 g(\dot{\gamma},\dot{\gamma}) dt.$$ I can do this in coordinates no problem, but this calculation is a bit messy. In general, the Lagrangian $L$ is not linear, but in this case $g$ is bilinear.
Let $v \in C^1$, $v(0) = v(1) = 0$. Question: is this use of the metric $g$ correct, and can we conclude the result via this calculation, or am I forgetting to use the chain rule somewhere? \begin{align*} A(\gamma+tv) &= \frac{d}{dt}\bigg|_{t=0} \int_0^1 \sqrt{g(\dot{\gamma}+t\dot{v},\dot{\gamma}+t\dot{v})} dt \\ &= \frac{d}{dt}\bigg|_{t=0} \int_0^1 \sqrt{g(\dot{\gamma},\dot{\gamma}) + 2t g(\dot{v},\dot{\gamma}) + t^2 g(\dot{v},\dot{v})} dt \\ &= \int_0^1 \frac{1}{\sqrt{g(\dot{\gamma},\dot{\gamma})}}g(\dot{v},\dot{\gamma})dt \end{align*}
By comparison, the first variation of the action functional is $$\frac{d}{dt}\bigg|_{t=0} E(\gamma+tv) = \int_0^1 g(\dot{\gamma},\dot{v})dt.$$ So if $\gamma$ has constant speed, i.e. if $g(\dot{\gamma},\dot{\gamma})$, then it seems that minimizing these functionals is identical. But this seems too easy (no derivatives of $g$ coming out)! Also, I can't get the Euler-Lagrange equations for geodesics to come out of this computation (integration by parts, right? -- so that's where the derivatives of $g$ would come out?).
A simple "incorrect" will be appreciated, and an explanation why even more so. Thanks!
Thanks to user98130's comment. Came back later and it seemed obvious. Anyway, because there is no dependence on $\gamma$ (which I'll call $f$ for simplicity) or $v$, the Euler-Lagrange equation is "homogeneous": \begin{align*} \int_0^1 g(\dot{f},\dot{v}) dt &= \int_0^1 g_{ij}\dot{f}^i\dot{v}^j dt \\ &= g_{ij}\dot{f}^iv(t)\bigg|_{t=0}^{t=1} - \int_0^1 \frac{d}{dt}(g_{ij}\dot{f}^i)v dt \\ \frac{d}{dt}(g_{ij}\dot{f}^j) &= \frac{\partial g_{ij}}{\partial f^k}\dot{f}^k\dot{f}^i + g_{ij}\ddot{f}^j = 0, \end{align*} which are the geodesic equations when $g(\dot{f},\dot{f}) = 0$.