Re: Symbolic Integration of Sums
- To: mathgroup at smc.vnet.net
- Subject: [mg79194] Re: [mg79129] Symbolic Integration of Sums
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Fri, 20 Jul 2007 03:37:52 -0400 (EDT)
- Reply-to: hanlonr at cox.net
portM = Sum[w[i] m[i], {i, 1, n}];
D[portM[[1]] /. i -> 1, w[1]]
m[1]
D[portM[[1]], w[i]] /. i -> 1
m[1]
Bob Hanlon
---- Peter <pjcrosbie at gmail.com> wrote:
> I am having trouble figuring out how to Mathematica to recognize sums when I
> take derivates.
>
> Here is a very simple example, define
>
> portM = Sum[w[i] m[i], {i, 1, n}]
>
> Then, if I try to take the derivative of portM wrt say w[1] I get 0
> instead of m[1].
>
> D[portM, w[1]] --> returns 0
>
> If I spell the sum out explicitly using say for n=10:
>
> portM = Sum[w[i] m[i], {i, 1, 10}]
>
> I get the correct answer but this is often messy with the real
> problems I am working with and it also removes the ability to work
> with the length of sum in the other parts of the analysis I am doing.
>
> Is using Sum in this way simply a level of abstraction more than Mathematica
> can do or am I asking it the wrong question?
>
> Many thanks.
>
>