The problem of determining the optimum shape of a homogeneous Euler–Bernoulli beam of a circular cross-section, in which the coupled axial and bending vibrations arose due to complex boundary conditions, is considered. The beam mass is minimized at prescribed fundamental frequency. The problem is solved applying Pontryagin’s maximum principle, with the beam cross-sectional diameter derivative with respect to longitudinal coordinate taken for control variable. This problem involves first-order singular optimal control, the calculations of which allowed the application of the Poisson bracket formalism and the fulfillment of the Kelley necessary condition on singular segments. Numerical solution of the two-point boundary value problem is obtained by the shooting method. An inequality constraint is imposed to the beam diameter derivative. Depending on the size of the diameter derivative boundaries, the obtained solutions are singular along the entire beam or consist of singular and non-singular segments, where the diameter derivative is at one of its boundaries. It is shown that such system is self-adjoint, so that only one differential equation of the costate equations system was integrated and the rest costate variables were expressed via the state variables. Also, the paper shows the fulfillment of necessary conditions for the optimality of junctions between singular and non-singular segments, as well as the percent saving of the beam mass compared to the beams of constant diameter at identical value of the fundamental frequency.