Constrained extrema of bilinear functionals