do not evaluate the summation



Hello!

I would like to have a simple Lagrangian with an index, like
L[i] : x[i]^(1-alfa)*sum(g[i],i,1,2)^alfa - lambda[i]*(g[i]+x[i]-m[i]);

And after when solving, I have to take the derivatives, but given that
the sum(g[i],i,1,2) is evaluated to g1+g2, when I take
diff(L[i],g[i]), I get only -lambda[i], instead of alfa *
x[i]^(1-alfa) * sum(g[i],i,1,2)^(alfa-1)-lambda[i].

If I understood well the manual, then probably I should use the noun
form somehow, but could not figure out how. As you can see I am really
novice to maxima, and I would appreciate a lot any help.

Regards, Viktor