I am trying to solve a summation equation, for the derivative with respect to x[0], where x is a vector of numbers.
If I try something like this:
diff(sum(x[k]*f(k), k = 0 .. m)+sum(x[s]*f(s^2), s = 0 .. m),x[0])
I get the response "0" from Maple.
To give scope on exactly why I am trying to do, and why some very naive solutions haven't worked for me (e.g. just enumerating it out to some constant) I'm doing something more like this (where the summations are interleaved, and inside and out of functions):
sum((sum(unary[r][u]*g[u](w[r]*(sum(unaryi[r][ui]*g[ui](wi[r]*inputi[r]), ui)+sum(sum(binaryi[r][bi]*f[bi](srcWi[r][si]*inputi[si], wi[r]*inputi[r]), si), bi))), u)+sum(sum(binary[r][b]*f[b](srcW[r][s]*(sum(unaryi[s][ui]*g[ui](wi[s]*inputi[r]), ui)+sum(sum(binaryi[s][bi]*f[bi](srcWi[s][si]*inputi[si], wi[s]*inputi[s]), si), bi)), w[r]*(sum(unaryi[r][ui]*g[ui](wi[r]*inputi[r]), ui)+sum(sum(binaryi[r][bi]*f[bi](srcWi[r][si]*inputi[si], wi[r]*inputi[r]), si), bi))), s), b)-answer[r])^2, r)
I'm trying to find the derivative of that with respect to srcWi[0][0], and many of the other indexed variables, 6 of them to be exact.
EDIT: another issue is just how many variable substitutions are required just to set one of the subscripts to 0!
Update: Things are getting harder, mostly because I have to manually go through and simplify summations each time, I have to look for patterns and similarities and I am making couple mistakes as a go along, I don't actually use maple often either. Quite tedious. I'll be printing out a couple versions today, to see if I can put this to rest!
Update2: Problem in complexity appears to be the issue is that the summation disappears and I need to infer where the summation SHOULD be, so I have to collapse all these equations carefully and correctly.
Update3: haven't made much progress yet, I should have by now
Excuse me if I'm being daft, but when you take the derivative with respect to $x_{0}$, all the other terms disappear, correct? So $$\frac{d}{dx_{0}} \left(\sum_{k=0}^{m} x_{k}f(k) + \sum_{x=0}^{k} x_{s}f(s^{2})\right) = \frac{d}{dx_{0}} \left( x_{0}f(0) + x_{0}f(0) \right) = \frac{d}{dx_{0}} 2x_{0}f(0) = 2f(0),$$ assuming that $f$ is not a function of $x_{0}$.
It should be the same in your big ugly formula, you can just ignore all the terms where your variable of interest does not appear.
[Edit:] Probably what you need to do, is to define your big summation as a multivariate polynomial, and compute it out (determine all coefficients). Then once you have that polynomial, Maple shouldn't complain about taking the derivative with respect to a given variable. (Disclosure: I don't use Maple, but this is what I would do in Magma)