Orbital equations in primitive permutation groups