MathGroup Archive 2002

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

Search the Archive

RE: Re: symbolic and indefinite differentiation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35460] RE: [mg35415] Re: symbolic and indefinite differentiation
  • From: "DrBob" <majort at cox-internet.com>
  • Date: Sat, 13 Jul 2002 03:48:50 -0400 (EDT)
  • Reply-to: <drbob at bigfoot.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Your solution raises questions:

expr = Sum[a[k]*x^k, {k, 1, p}];
d = D[expr, x];
d[[1]]
d[[2]]
Sum[d[[1]], d[[2]]]
Sum[d[[1]], Evaluate@d[[2]]]

k*x^(-1 + k)*a[k]
{k, 1, p}
Sum[dã??1ã??, dã??2ã??]
k*p*x^(-1 + k)*a[k]

First of all, d[[1]] evaluates rather than remaining in the partial derivative form.  Yet your solution had to force evaluation.

Second, d[[2]] "does not have the correct form for an iterator" even though it IS the iterator of a perfectly good Sum.

Third, Evaluate@d[[2]] is accepted as an iterator, even though there's no evaluation to do.

(I do know the explanation for those three points... Sum has the HoldAll attribute.)

Fourth, the correct result comes without Evaluate@d[[1]].  That's what confuses me.  How did this evaluation occur, if the original Sum wouldn't evaluate it, and your solution had to force evaluation?  It seems as if

Sum[d[[1]], Evaluate@d[[2]]]

should be identical to the original Sum, but it isn't.

Bobby Treat

-----Original Message-----
From: Jens-Peer Kuska [mailto:kuska at informatik.uni-leipzig.de] 
To: mathgroup at smc.vnet.net
Subject: [mg35460] [mg35415] Re: symbolic and indefinite differentiation

Hi,

expr = Sum[a[k]*x^k, {k, 1, p}];
D[expr, x] /. HoldPattern[Sum[a_, b__]] :> Sum[Evaluate[a], b]

???

Regards
  Jens

Philippe Huber wrote:
> 
> Hello,
> 
> I have a dummy question: I would like to know if it is possible (and how) to
> differentiate a symbolic sum like
> 
> f(x1,...,xn)=Sum[x^2[[k]],{k,1,p}]
> 
> with respect to xi. I should obtain 2xi.
> 
> Thank you for your help
> 
> Philippe





  • Prev by Date: Re: Mathematica Animation Problem
  • Next by Date: Changing delayed formula
  • Previous by thread: Re: symbolic and indefinite differentiation
  • Next by thread: Re: symbolic and indefinite differentiation