Abstract
We study the second shape derivative of an optimal design functional involving a nonlocal term in order to prove rigidity of the ball. Our approach relies on a continuity argument that relates the second variation to that of the corresponding local problem. The model serves as a prototype for a broader class of shape optimization problems to which the same strategy may be adapted.