The legs of animals, and their movements, have presumably been optimized by evolution and/or learning for the functions required of them in life. This paper presents a series of studies in which attempts have been made to formulate optimization problems, to which the legs and their movements may be solutions. These are studies of the ratio of radius to wall thickness in tubular bones; of the strengths of bones; of tendon thickness; of the gaits of turtles and of mammals; and of the technique of human high jumping. They illustrate some serious difficulties that may arise in inverse optimization studies but also show that the approach is helping to improve our understanding of legs and gaits.