  We compute bilinear integrals involving Macdonald and Gegenbauer functions.
These integrals are convergent only for a limited range of parameters. However,
when one uses generalized integrals they can be computed essentially without
restricting the parameters. The generalized integral is a linear functional
extending the standard integral to a certain class of functions involving
finitely many homogeneous non-integrable terms at the edpoints of the interval.
For generic values of parameters, generalized bilinear integrals of Macdonald
and Gegenbauer functions can be obtained by analytic continuation from the
region in which the integrals are convergent. In the case of integer parameters
we obtain expressions with explicit additional terms related to an anomaly,
namely the failure of the generalized integral to be scaling invariant.
