The study of shape optimization problems is a very wide field, both classical, as the isoperimetric problem and Newton problem of the best aerodynamical shape show, and modern, for all the recent results obtained in the last two, three decades. The fascinating feature is that the competing objects are shapes, i.e. domains of Rn, instead of functions, as usually occurs in problems of calculus of variations. This constraint often produces additional difficulties that lead to a lack of existence of a solution and the introduction of suitable relaxed formulations of the problem. However, in a few cases an optimal solution exists, due to the special form of the cost functional and to the geometrical restriction on the class of competing domains. This volume collects the lecture notes of two courses given in the academic year 2000/01 by the authors at the University of Pisa and at the Scuola Normale Superiore respectively. The courses were mainly addressed to Ph. D. students and required a background in the topics in functional analysis that are usually taught in undergraduate courses.