I don't understand what EuclideanDistance[Subscript[v, i], Subscript[v, i + 1]] means.
EuclideanDistance[Subscript[v, i], Subscript[v, i + 1]]
EuclideanDistance[u,v] is the distance between two points in space, but you are applying it to two coordinates of the same point.
EuclideanDistance[u,v]
Without working code, D[EuclideanDistance[xi, xj], xi] doesn't make a lot of sense to me, since D[] is the partial derivative operator. Thus xi etc. should be scalars for D[] and vectors for EuclideanDistance[]. But if the xi etc. are stand-ins for other values, maybe it could make sense somehow.
D[EuclideanDistance[xi, xj], xi]
D[]
xi
EuclideanDistance[]
Ah that's my bad, the xi's in the EuclideanDistance[] should probably be labeled vi, as they're vectors, and I'm taking the derivative with respect to their x components.