Interpolatory integration formulas for optimal composition