We derive a set of integral equations of the TBA type for the generalized
cusp anomalous dimension, or the quark antiquark potential on the three sphere,
as a function of the angles. We do this by considering a family of local
operators on a Wilson loop with charge L. In the large L limit the problem can
be solved in terms of a certain boundary reflection matrix. We determine this
reflection matrix by using the symmetries and the boundary crossing equation.
The cusp is introduced through a relative rotation between the two boundaries.
Then the TBA trick of exchanging space and time leads to an exact equation for
all values of L. The L=0 case corresponds to the cusped Wilson loop with no
operators inserted. We then derive a slightly simplified integral equation
which describes the small angle limit. We solve this equation up to three loops
in perturbation theory and match the results that were obtained with more
direct approaches.Comment: 63 pages, 12 figures. v2: references added, typos correcte