When you partially derivate on a variable, you consider all the other variables fixed, you treat them as constants. So basically derivative of r12.p21 in respect to r11 is 0, same for the partial derivative of r13p31 in respect to r11 is 0 as well. The only remaining thing that can be partially derivated to r11 is r11p11 and its value is p11 (since we’re derivating on r11). Hope it’s clearer? Cheers!