The classical Heisenberg model has been effective in modelling exchange interactions in molecular magnets. In this model, the partition function is important as it allows the calculation of the magnetization and susceptibility. For an ensemble of N-spin sites, this typically involves integrals in 2N dimensions. Here, for two-, three-and four-spin nearest neighbour open linear Heisenberg chains these integrals are reduced to sums of known functions, using a result due to Gegenbauer. For the case of the three-and four-spin chains, the sums are equivalent in form to the results of Joyce. The general result for an N-spin chain is also obtained.