Zaslat SMS: Calculus of variations with applications