How can I calculate the partial derivative of a series like e.g. $$ a = \sum _{i=1}^n \left(2 x_i^2+z\right) $$
with respect to $x_{1}, x_{2},... x_{n}$ using Wolfram Mathematica?
I tried it with:
D[a, Subscript[x, 1]]
But it results in null, which obviously isn't true. I also tried it with:
D[a, x]
But the result of this isn't what I expected as well. I hope that anybody can help me. Thanks in advance!
nto some large number,D[Sum[2 Subscript[x, i]^2 + z, {i, 1000000}], Subscript[x, 1]]does what you appear to wish. – bbgodfrey Jul 07 '15 at 16:21a = Sum[2 x[i]^2 + z, {i, n}]; deriv[i_] := D[a /. n -> i, x[i]]; deriv[3]– Dr. belisarius Jul 07 '15 at 16:40