Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm dealing with finite sums of infinite series. Each of the infinite series possesses a different starting index, i.e. each of the series begins at n = 0, n = 1, or n = 2. As a result, it's important to keep track of the indices for each of the series.

In addition, Mathematica cannot evaluate the series, because it's too complicated and undesirable for what's to be accomplished. I've only written the series in this manner to allow for efficient symbolic manipulation.

The problem is that Mathematica takes a long time "trying" to evaluate each of the series. I've tried Hold, HoldAll, Unevaluated, and HoldForm. HoldForm seems like the correct choice, but there's a problem. Although I don't want to evaluate the series themselves, I'd still like to be able to perform operations on the series, such as differentiation.

So, does anyone know of a way to differentiate a series without evaluating the series itself?

I'm new to Mathematica, so the answer might be simple. Thanks for your time.

share|improve this question
Could you provide an example of two of the series you wish to look at? – rcollyer Jul 4 '12 at 20:22
I'm only concerned with series of the general form... \begin{equation} \sum _{n=0}^N f_n(x,y,z) \end{equation} In my problem, however, $f_n$ takes the form: \begin{equation} – Rob Jul 4 '12 at 20:26
Are you using Series or Sum? – rcollyer Jul 4 '12 at 20:30
Incidentally, math mode is invokable only using $ for inline formulas and $$ for \[ \]. – rcollyer Jul 4 '12 at 20:32
I'm using Sum. As I attempted to write before, the function $f_n$ is a product of other functions of (x,y,z), some of which are specified (i.e. by a specified function, I mean something like $x^2$) and some of which are left unspecified (i.e. by which I mean something like $g_n(y)$). – Rob Jul 4 '12 at 20:37

You could define your own sum, and add rules to integrate it with various operators such as differentiation. This may be a lot of work however, since many built-in rules exist which inter-related Sum with other operations.

Below is an attempt to take another route and piggyback on the system:

SetAttributes[withInertSum, HoldAll];
withInertSum[code_] :=
  Block[{Sum}, Block[{sum = Sum}, code] /. Sum -> sum];

If you now define your own inert head sum with no rules attached to it, then you can, e.g., do the following:

mySum = sum[(x + y + z)^n/n!, {n, 0, m}]

(*   sum[((-1+n) n (x+y+z)^(-2+n))/n!,{n,0,m}]   *)

What happens is that sum becomes Sum temporarily, inside withInertSum, but only after all direct rules for Sum have been temporarily switched off. Then, we try to compute things, and finally, replace Sum with sum once again. At least for the simple example above, this works, because apparently at least some of the rules relating Sum and D were attached to D rather than to Sum.

share|improve this answer
very sneaky... :) – sebhofer Jul 5 '12 at 8:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.