Envoyer par SMS: The calculus of variations and optimal control: an introduction