MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Symbolic Integration of Sums

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79207] Re: [mg79129] Symbolic Integration of Sums
  • From: Carl Woll <carlw at wolfram.com>
  • Date: Sat, 21 Jul 2007 04:23:07 -0400 (EDT)
  • References: <200707190733.DAA01808@smc.vnet.net>

Peter 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.
>
>  
>
One possibility is to define an UpValue for m:

m /: D[m[i_], m[j_], NonConstants->{m}] := DiscreteDelta[i-j]

Then,

In[16]:= D[Sum[w[i] m[i], {i, 1, n}], m[1], NonConstants -> {m}]

Out[16]= UnitStep[n - 1] w[1]

Note that this will only work in version 6, as there is a bug in 5.2 
that will prevent the above code from working.

Carl Woll
Wolfram Research


  • Prev by Date: Re: Re: buliding on functions
  • Next by Date: Re: Mirror images of a font...
  • Previous by thread: Symbolic Integration of Sums
  • Next by thread: Re: Symbolic Integration of Sums