Re: partial derivative of a sum
- To: mathgroup at smc.vnet.net
- Subject: [mg59814] Re: partial derivative of a sum
- From: "James Gilmore" <james.gilmore at yale.edu>
- Date: Mon, 22 Aug 2005 02:48:45 -0400 (EDT)
- Organization: Yale University
- References: <de9cut$q78$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
When you specify Infinity or N below as the upper bound on the sum, it remains in unevaluated form. Sum has the attribute HoldAll. This code will get you the desired result: SumDerivative[ni_, j_] := If[ni > j, 0, D[Sum[n[i]*l[i], {i, 1, j}], n[ni]]] SumDerivative[ni_, Infinity] := l[ni] Note that you need to supply the upper bound of the sum. -- James Gilmore Graduate Student Department of Physics Yale University New Haven, CT 06520 USA "Daniel Roy" <droy at MIT.EDU> wrote in message news:de9cut$q78$1 at smc.vnet.net... > I'm wondering if Mathematica can handle expressions such as: > > ClearAll[n, l] > D[Sum[n[i] l[i], {i, 1, Infinity}], n[10]] > > The answer should be l[10], but Mathematica returns 0. > > ClearAll[n, l] > D[Sum[n[i]l[i], {i, 1, 100}], n[10]] > > return l[10] as expected. More generally, > > ClearAll[n, l] > Assumptions[N \[Element] Integers && N>10, > D[Sum[n[i] l[i],{i,1,N}], n[10]] > > Thanks, > Dan Roy > > >