Suppose f is your probability density function for the quantity X you’re interested in.
Then the expectation of D is the integral of D(x)f(x), which equals the integral of [max(0,l-x)+max(0,x-r)]f(x). When we differentiate w.r.t. r, the first term obviously goes away because it’s independent of r, so we get the integral of [d/dr max(0,x-r)] f(x). That derivative is 0 for x<r and 1 for x>r, so this is the integral of f(x) from r upwards; in other words it’s Pr(X>r). So d(score)/dr = 1-20Pr(X>r).
The calculation for l is exactly the same but with a change of sign; we end up with 20Pr(X<l)-1.
would you mind spelling out the integral part?
Suppose f is your probability density function for the quantity X you’re interested in.
Then the expectation of D is the integral of D(x)f(x), which equals the integral of [max(0,l-x)+max(0,x-r)]f(x). When we differentiate w.r.t. r, the first term obviously goes away because it’s independent of r, so we get the integral of [d/dr max(0,x-r)] f(x). That derivative is 0 for x<r and 1 for x>r, so this is the integral of f(x) from r upwards; in other words it’s Pr(X>r). So d(score)/dr = 1-20Pr(X>r).
The calculation for l is exactly the same but with a change of sign; we end up with 20Pr(X<l)-1.