  We provide an upper bound for the number of limit cycles that planar
polynomial differential systems of a given degree may have. The bound turns out
to be a polynomial of degree four in the degree of the system. The strategy of
proof brings variational techniques into the differential-system field by
transforming the task of counting limit cycles into counting critical points
for a certain smooth, non-negative functional, through Morse inequalities, for
which limit cycles are global minimizers. We thus solve the second part of
Hilbert's 16th problem providing a uniform upper bound for the number of limit
cycles which only depends on the degree of the polynomial differential system.
We would like to highlight that the bound is sharp for quadratic systems
yielding a maximum of four limit cycles for such subclass of differential
systems.
