It is straightforward to have diff(x[i],x[j]) give kron_delta(i,j). The
problem, though, is that you get messy expressions which Maxima doesn't know
how to simplify usefully.
For example, diff( sum( x[i]*x[n-i+1], i, 1, n) , x[j] ) would result in
'sum(kron_delta(i,j)*x[n-i+1]+x[i]*kron_delta(n-i+1,j),i,1,n)
The hard part is getting that to simplify to
if n>=j then 2*x[n-j+1] else 0
As far as I know, no one has implemented such simplifications. It would
certainly be a useful area to work on; an important special case of the more
general problem of simplifying expressions involving conditionals.
-s
On Tue, Jun 7, 2011 at 10:44, David Simcha <dsimcha at gmail.com> wrote:
> Let's say I want to differentiate a sum w.r.t. one of its terms. Below is
> a trivial case, though my real case is more complex.
>
> (%i1) expr : sum(x[i], i, 1, N);
> N
> ====
> \
> (%o1) > x
> / i
> ====
> i = 1
> (%i2) diff(expr, x[1]);
> (%o2) 0
> (%i3)
>
> Of course the answer I'm looking for is 1. I want Maxima to treat the
> summation as if I had written out, for some fixed N:
>
> expr : x[1] + x[2] + x[3] + ... + x[N];
>
> How do I get Maxima to behave more intelligently w.r.t. subscripts?
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>