The evolution of a phragment of the theory of extremal problems, the necessary conditions of extremum, is explained. Four problems of Fermat, Lagrange, Euler and Pontryagin are presented and four classical examples of Euclid, Kepler, Newton and Bernoulli are solved.