Envoyer par SMS: Calculus of variations with applications