Sincep(d) is a product of rule weights and pruning mask bits at d's leaves ( §5.1), each appearing at most once, bothr and Z vary linearly in any one of these inputs provided that all other inputs are held constant.
the exact effect onr or Z of changing an input m ik can be found from the partial derivatives with respect to it.