Python, 67 bytes
lambda a,b: 2*sum(x*y for x in range(a,b+1) for y in range(x+1,b+1))
with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)
Python, 67 bytes
lambda a,b: 2*sum(x*y for x in range(a,b+1) for y in range(x+1,b+1))
with @Dennis formulae and w/o recursion, yet another Python solution (as I cannot comment @leaky-nun solution (not enough reputation)