Make deriv handle sums and products of arbitrary numbers of terms