  Erd\H{o}s and Tur\'an proved a classical inequality on the distribution of
roots for a complex polynomial in 1950, depicting the fundamental interplay
between the size of the coefficients of a polynomial and the distribution of
its roots on the complex plane. Various results have been dedicated to
improving the constant in this inequality, while the optimal constant remains
open. In this paper, we give the optimal constant, i.e., prove the sharp
Erd\H{o}s-Tur\'an inequality. To achieve this goal, we reformulate the
inequality into an optimization problem, whose equilibriums coincide with a
class of energy minimizers with the logarithmic interaction and external
potentials. This allows us to study their properties by taking advantage of the
recent development of energy minimization and potential theory, and to give
explicit constructions via complex analysis. Finally the sharp
Erd\H{o}s-Tur\'an inequality is obtained based on a thorough understanding of
these equilibrium distributions.
