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.

  • 2
    $\begingroup$ Could you provide an example of two of the series you wish to look at? $\endgroup$
    – rcollyer
    Commented Jul 4, 2012 at 20:22
  • $\begingroup$ 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} $\endgroup$
    – Rob
    Commented Jul 4, 2012 at 20:26
  • $\begingroup$ Are you using Series or Sum? $\endgroup$
    – rcollyer
    Commented Jul 4, 2012 at 20:30
  • $\begingroup$ Incidentally, math mode is invokable only using $ for inline formulas and $$ for \[ \]. $\endgroup$
    – rcollyer
    Commented Jul 4, 2012 at 20:32
  • $\begingroup$ 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)$). $\endgroup$
    – Rob
    Commented Jul 4, 2012 at 20:37

2 Answers 2


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.

  • $\begingroup$ very sneaky... :) $\endgroup$
    – sebhofer
    Commented Jul 5, 2012 at 8:25

Starting in M10, another possibility quite similar to @Leonid's answer is to use Inactive. For example:

Simplify @ D[Inactive[Sum][(x+y+z)^n/n!, {n,0,m}], {x,2}]

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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