# [C (gcc)](http://gcc.gnu.org), 67 bytes

    f(n,m){double a,b;for(;n<=m;a+=n,b+=pow(n++,2));return pow(a,2)-b;}

[Try it online!](https://tio.run/##bZBBbsMgEEX3PsXIVSq7JolqqYuKOEfoBdIsMAYbFYYIsKMqytVLbSdpKrVsGN78P5oPX7acxweFXPeNgI0PjbKrbpvckWGhm0hj@1oLkJnCAEhgukxOk1tjvYY3G6Bjg8IWQqc8aIUCjtZ9jKXlTOtPAgdnjfJiFWWGxOSnq5uRmkrrMoqbylBWVEjqojrYY4ZFQco8p06E3iFMiI1gWdNznHdgCuedmGs5Ad4x9zSWw26fnxIYj5LZ1NqW1/fMLhkM/SHec4azctg97wmkiyYl8Ij5/5LyLjG/JAc3TpZZupDvmJJLxGv7DEJ7Aac/2unXBNq@7aYIvREY/Gq033zJOcaX@PrFpWatj0ttvgE "C (gcc) – Try It Online")