Differential and integral formulations of sensitivity analysis of a general boundary-integral functional are presented for a heat-conduction problem. By using the adjoint-variable method of optimization, adjoint differential and integral equations are derived for the two formulations. Some distinguishing differences appear in the boundary-integral equations of the relevant adjoint functions and also in the sensitivity expressions of the objective function. Discretizations of all equations are achieved by the BEM. Analytical expressions are checked with available exact results, and comparisons of the numerical solutions are made. A problem of the optimal cooling of turbine blades is also analyzed by the proposed formulations.