taking partial derivatives with respect to vector elements: need help with syntax

*To*: mathgroup at smc.vnet.net*Subject*: [mg72859] taking partial derivatives with respect to vector elements: need help with syntax*From*: kai_spam at web.de*Date*: Tue, 23 Jan 2007 04:27:05 -0500 (EST)

Hi, I'd appreciate any help on the following simply(?) syntax problem: I would like to take a partial derivative with respect to a variable which is indexed within a sum. Among other things I'm trying the following: Sum[x[[i]], {i, N}] which works when I specify x={1,2,3} and N=3, but I want to keep x and N unspecified. In which case it produces the message: Part:::pspec : Part specification i is neither an integer nor a list of integers. I am aiming for something similar to the following: D[Sum[x[[i]],{i,N}],x[2]] or even D[Sum[x[[i]],{i,N}],x[j]] I realize this is quite a rookie-question but I couldn't figure it out with the mathematica help + book. Thanks in advance, Kai