You have to explicitly tell that indexed variables can overlap and intersect. Maybe this code fetches you the desired result,
Try to split the sum into parts
dF_dxi = x[i] + sp.Sum(x[j], (j, 1, i-1)) + sp.Sum(x[j], (j, i+1, C)) + x[i]
#outpur: (Sum(x[j], (j, 1, i - 1)) + Sum(x[j], (j, i + 1, C)))*x[i] + x[i]**2