A question in calculus of variations Consider the functional
$$\int_0^1 \sqrt{\left(\frac{dx}{dt}\right)^2+\left(\frac{dy}{dt}\right)^2}\,dt$$ 
where (x(t),y(t)) is a $C^2$ curve in the plane. Firstly, How can I derive Euler-Lagrange equations? 
Secondly, How to prove that the smooth path of least length between the two points $(0, 0)$ and $(1, 0)$ in the plane is a
straight line. That is, prove that $x = t; y = 0$ has the least length among all $C_2$ curves $(x(t), y(t))$ with $(x(0), y(0))= (0; 0),(x(1); y(1))= (1; 0)$, and $dx=dt$ and $dy=dt$ never simultaneously zero.
 A: APPROACH $1$:  HEURISTIC APPROACH 
We can approach the problem heuristically (i.e., this is not  a rigorous development) as follows.  
Let $J[x,y]=\int_0^1 \sqrt{x'^2(y)+y'^2(t)}\,dt$ and let $\delta x$ and $\delta y$ be "small" variations in $x$ and $y$, respectively, such that $\delta x(0)=\delta x(1)=\delta y(0)=\delta y(1)=0$.  
Then, we have
$$\begin{align}
\delta J[x,y]&=\int_0^1 \left(\sqrt{(x'+\delta x')^2+(y'+\delta y')^2}-\sqrt{x'^2(y)+y'^2(t)}\right)\,dt\\\\
&=\int_0^1 \frac{x'(t)\delta x'(t)+y'(t)\delta y'(t)}{\sqrt{x'^2(y)+y'^2(t)}}\,dt+\underbrace{O(\delta^2x',\delta^2 y')}_{\text{Higher Order "Small" Terms}}\\\\
&\overbrace{=}_{IBP}\underbrace{\left.\left(\frac{x'(t)\delta x(t)}{\sqrt{x'^2(y)+y'^2(t)}}+\frac{y'(t)\delta y(t)}{\sqrt{x'^2(y)+y'^2(t)}}\right)\right|_{t=0}^{t=1}}_{=0\,\text{Since the variations vanish at the end points}}\\\\
&-\int_0^1 \left(\delta x(t)\frac{d}{dt}\left(\frac{x'(t)}{\sqrt{x'^2(t)+y'^2(t)}}\right)+\delta y(t)\frac{d}{dt}\left(\frac{y'(t)}{\sqrt{x'^2(t)+y'^2(t)}}\right)\right)\\\\
&+\underbrace{O(\delta^2x',\delta^2 y')}_{\text{Considered Negligibly Small}}\\\\
\end{align}$$
If $\delta J[x,y]=0$ for all $\delta x$ and $\delta y$, then the first variation is $0$ when
$$\frac{d}{dt}\left(\frac{x'(t)}{\sqrt{x'^2(t)+y'^2(t)}}\right)=0 \tag 1$$
and
$$\frac{d}{dt}\left(\frac{x'(t)}{\sqrt{x'^2(t)+y'^2(t)}}\right)=0\tag 2$$
Integrating $(1)$ and $(2)$, solving the resulting expressions, and enforcing the initial and final conditions reveals 
$$x(t)=t$$
and 
$$y(t)=0$$

APPROACH $2$:  RIGOROUS APPROACH 
Note that the integrand of the functional $J[x,y]$ depends explicitly on only $x'$ and $y'$, not $x$ and $y$.  The Euler-Lagrange Equations are given by $(1)$ and $(2)$ since 
$$\frac{\partial }{\partial x}\sqrt{x'^2(t)+y'^2(t)}\,dt =\frac{\partial }{\partial x}\sqrt{x'^2(t)+y'^2(t)}\,dt=0$$
and
$$\frac{\partial }{\partial x'}\sqrt{x'^2(t)+y'^2(t)}\,dt =\frac{x'(t)}{\sqrt{x'^2(t)+y'^2(t)}}$$
and 
$$\frac{\partial }{\partial y'}\sqrt{x'^2(t)+y'^2(t)}\,dt =\frac{y'(t)}{\sqrt{x'^2(t)+y'^2(t)}}$$
Therefore, starting with $(1)$ and $(2)$ and proceeding as outlined in Approach $1$.
