Pay attention, it's the x that is important in this lemma. x is not our integration variable, rather it is the upper limit of the definite integral and we are differentiating with respect to that variable. 