MathGroup Archive 2010

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

Search the Archive

Re: Converting the integral of a sum into a sum of integrals

  • To: mathgroup at
  • Subject: [mg109090] Re: Converting the integral of a sum into a sum of integrals
  • From: "David Park" <djmpark at>
  • Date: Mon, 12 Apr 2010 23:00:04 -0400 (EDT)

I don't know why you have patterns in the rhs of the rule. In any case, the
following works. I set the a_i coefficients to 1 in the last step to obtain
a complete evaluation.

  Sum[Times[Power[x, i], Subscript[a, i]], {i, 0, k}], x] 
% /. Integrate[Sum[term_, range_], variable_] :> 
  Sum[Integrate[term, variable], range] 
% // ReleaseHold 
% /. Subscript[a, i] -> 1 

David Park
djmpark at  

From: Kurt TeKolste [mailto:tekolste at] 

If I ask Mathematica to perform an indefinite integrate on a symbolic
summation (with terms of the form a_i x^i),


it does nothing.  If I try to tell it that summation and integration
commute by applying the rule:


I get a strange result equivalent to

term * range

or, in this case,

Times[Power[x,i],Subscript[a,i]] * {i,0,k}
{i a_i x^i, 0, k a_i x^i}

Any ideas as to what's going on?


1)  If you use rules to extract each of term, range, and variable and
then take Sum[Integral[...],...] the correct answer is returned.

2)  if you use a rule that changes Sum to Power, i.e.

Integrate[Sum[term_,range_],variable_] ->

you get exponents

term^(range - 1)



  • Prev by Date: Re: beginner question about syntax
  • Next by Date: Re: beginner question about syntax
  • Previous by thread: Re: Support for PlotLegend in DateListPlot
  • Next by thread: Using package functions in Manipulate/DynamicModule