`WeightedSum` should be defined as a general mathematical tool. It is not specific to numerical integrations.