Solve $\sum\limits_{k=0}^{19} \sqrt{1+u_k^2} \rightarrow \min$, such that $x_0 = 0, x_{20} = 5$ and $x_{k+1} - x_k = u_k$.
I think I know how to solve problems like these recursively, but I don't know how I should attack this specific problem as it involves $20$ different $u_k$'s that need to be calculated (I think there must be a way to solve for general $u_k$ instead of recursively calculating each $u_k$). Could anyone please help?
Hint: This problem is equivalent to minimization of the distance between points $(0,0)$ and $(5,20)$ with the restriction that the path must go through $21$ point whose ordinates are $0,1,\ldots,20$. Clearly the optimal path is a straight line.