We study N=2 supersymmetric gauge theories on the product of a two-sphere and
a cylinder. We show that the low-energy dynamics of a BPS sector of such a
theory is described by a quantum integrable system, with the Planck constant
set by the inverse of the radius of the sphere. If the sphere is replaced with
a hemisphere, then our system reduces to an integrable system of the type
studied by Nekrasov and Shatashvili. In this case we establish a correspondence
between the effective prepotential of the gauge theory and the Yang-Yang
function of the integrable system.Comment: 24 pages. v2: references added; v3: minor changes, published versio