How can the law of definite proportions be used to differentiate between compounds?