In this paper, problem of optimizing the two first eigen frequencies of a torsional shaft using Pontryagin's maximum principle, an optimal control one, is presented. Where, control variables are diameters of elements, objective function contains the first or second eigen frequencies of the shaft. Results of the paper allow determining sign of ratio coefficient of optimal condition, the equivalent optimal configurations and eigen frequencies of shafts subjected to different boundary conditions.