Calculus of Variations on the Tech Tree