Thank you! I'm very new to Mathematica. When I try the same method for my more involved example, it gives the wrong answer:
Assuming[
1 <= k <= N && k \[Element] Integers
&& 1 <= n <= N && n \[Element] Integers,
ff = D[x[k] * Sum[Sum[g[a[i, j],x[j]], {j, 1, N}], {i, 1, N}], x[n]] // Simplify
]
The result it gives is xₖ ∑i D₂ g(aᵢₙ, xₙ) which is only half the answer, omitting the δₙₖ ∑i ∑j g(aᵢⱼ, xⱼ) term. What am I doing wrong?
Is it making an incorrect assumption that n != k? How do I tell it not to assume that?