MathGroup Archive 2005

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

Search the Archive

Re: Re: Sum


>> x[k_]:= Exp[-k]
>> Sum[x, {k, 0, Infinity}]
>> - works fine

No, but this does:

x[k_] := Exp[-k]
Sum[x[k], {k, 0, Infinity}]
E/(-1 + E)

That's probably what you meant.

Bobby

On Thu, 17 Mar 2005 03:28:33 -0500 (EST), Ofek Shilon <ofek at simbionix.com> wrote:

> I believe the answer lies in an innocent looking line in the
> Mathematica book, under "Sum":
> "If a sum cannot be carried out explicitly by adding up a finite number
> of terms, Sum will attempt to find a symbolic result. In this case, f
> is first evaluated symbolically. "
> (f refers to the syntax Sum[f, {i, a}]).    i.e., when the Sum cannot
> be converted to Plus, f (your x) is evaluated BEFORE the iterator
> variable i (your k). Thus, x is converted to the form Exp[-k] first,
> and is not affected by the "change" in k - in an infinite sum, the
> iterator does not really iterates \inf times.
>
> an easy workaround is to define the k-dependence explicitly:
>
> x[k_]:= Exp[-k]
> Sum[x, {k, 0, Infinity}]
>
> - works fine  in Mathematica 5.1.0 on windows. no need to copy/paste
> long expressions, just add the index dependence as above.
>
>
>
>



-- 
DrBob at bigfoot.com


  • Prev by Date: Re: GridLines
  • Next by Date: nonLinearFit and nonLinearRegress
  • Previous by thread: Re: Sum
  • Next by thread: Re: Sum