I have a difficulties in understanding Maxima behaviour.
There are 3 scripts:
#1
a(x):=sum(w[i]*x[i],i,0,inf);
diff(a(xx), xx[1]);
kill(w,xx,layer_size);
#2
declare(layer_size, constant);
a(x):=sum(w[i]*x[i],i,0,layer_size);
diff(a(xx), xx[1]);
kill(w,xx,layer_size);
#3
a(x):=sum(w[i]*x[i],i,0,2);
diff(a(xx), xx[1]);
kill(w,xx,layer_size);
Scripts #1 and #2 gives me 0 as a result of differentiating. But script #3 works fine and returns w[1];
It looks strange for newbies like me. Can anyone show me my mistakes and help to fix script #2? (I do not want to declare exact value for layer_size and want to leave its as unknown constant).