A geometric derivation of transversality and corner conditions of the calculus of variations via dynamic programming | lit.salon