Numerical simulation and automated optimization of Langevin-type ultrasonic transducers are investigated. These kind of transducers are standard components in various applications of high-power ultrasonics such as ultrasonic cleaning and chemical processing. Vibration of the transducer is simulated numerically by standard finite element method and the dimensions and shape parameters of a transducer are optimized with respect to different criteria. The novelty value of this work is the combination of the simulation model and the optimization problem by efficient automatic differentiation techniques. The capabilities of this approach are demonstrated with practical test cases in which various aspects of the operation of a transducer are improved.