MathGroup Archive 2001

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

Search the Archive

Bug in Sum on symbolic differentiation

  • To: mathgroup at
  • Subject: [mg30702] Bug in Sum on symbolic differentiation
  • From: "ChiaMing Yu" <yucalf at>
  • Date: Sat, 8 Sep 2001 02:23:16 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Dear Sir,

Excuse me!
When I want to differentiate through a Sum, such as (in LaTeX format):
d (\Sum^n_{i=1} q_i) / d q_i

The answer should be "1", because in the above equation, (d q_i) means
respect to q_1, or q_2, or q_3, ..., etc, one and only one variable of the
set {q_i | i=1, .., n}.

But when I excute following command, Mathematica give me the wrong answer
D[ Sum[q[i], {i,1,n}], q[i] ]

It may because Mathematica first differentiate the inner expression of
Sum[], that is q[i],
respect to q[i] and get the result 1, then Mathematica Sum these 1 with n
times, that is
Sum[1, {i,1,n}], and return the output to be "n".

When we assign a specific number to n, for example n=10, the operation will
be fine,
for example,
D[Sum[x[i], {i, 1, 10}], x[5]]

But when the variable n is Not assign any number, the situation described
previously will
appear. This may imply the limitation of Sum[] on symbolic operation,
espetially differentiation opration. How can I refine the situation and get
my right answer "1" from Mathematica?

Thank you for any suggestion!

Chia-Ming Yu, September 5, 2001
National Taipei University

  • Prev by Date: Re: plotting cadlag point process
  • Next by Date: Re: thickness and fonts of axes & labels
  • Previous by thread: Engineer's Stunt
  • Next by thread: Re: Bug in Sum on symbolic differentiation