MathGroup Archive 2002

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

Search the Archive

RE: differentiation of a product


It looks like Mathematica doesn't implement the Leibniz rule on indefinite
products. Here is my attempt to implement it. I hope I haven't slipped up.
You may get some other better answers. I am not going to paste in all the
output because you can duplicate it in your own notebook.

First I define your f, separating the parameters from the variable s.

f[a_, b_, n_][s_] := Product[a + b*Exp[s*x[i]], {i, 1, n}]

You could differentiate with respect to s by


but Mathematica doesn't evaluate. However, if you specify an integer for n,
Mathematica will evaluate.


For a symbolic differentiation, I wrote the following routine.

LeibnizD::usage =
    "LeibnizD[product, x] will differentiate an indefinite product
expression \
with respect to x using the Leibniz rule. The product must be of the form \
Product[factor, {iter, min, max}].";
LeibnizD[p_Product, x_] :=
  Module[{factor, term, piter, pmin, pmax},
    {piter, pmin, pmax} = Rest[p];
    factor = First[p];
    term = (D[factor, x])/factor ;
    p Sum[term // Evaluate, {piter, pmin, pmax} // Evaluate]]

Then the following gives the differentiation in terms of the original
product times a sum.

LeibnizD[f[a, b, n][s], s]

Checking one case..

f[a, b, 3]'[s] == (LeibnizD[f[a, b, n][s], s] /. n -> 3) // Simplify

And if it correct for one case it must be correct for all. Right?

David Park
djmp at

From: Luca [mailto:bosatta at]
To: mathgroup at

How do I evaluate this product in mathematica:
f[s_]=Product[a+b*Exp[s*x[i]],{i,1,n}] ?

D[f[s],s] does not evaluate the terms.

  • Prev by Date: Re: The Essence of Mathematica
  • Next by Date: RE: ParametricPlot Question
  • Previous by thread: differentiation of a product
  • Next by thread: ParametricPlot Question