Re: How to express a Product (special case) in Mathematica?

*To*: mathgroup at smc.vnet.net*Subject*: [mg59125] Re: How to express a Product (special case) in Mathematica?*From*: Bill Rowe <readnewsciv at earthlink.net>*Date*: Fri, 29 Jul 2005 00:42:15 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

On 7/28/05 at 2:28 AM, vdavidster at gmail.com wrote: >If you're familiar with the Lagrange interpolation polynomial, >you'll know that the coefficient term, phi, is defined as follows: > n >phi_j (t) = TT (t - t_i) > i=0 ----------- > i!=j (t_j - t_i) >Or in LaTeX notation: >\phi_j(t) = \prod^{n}_{\stackrel{i=0}{i \neq j}} \frac{(t - >t_i)}{(t_j - t_i)} >Or in graphical form: >http://mathworld.wolfram.com/LagrangeInterpolatingPolynomial.html >How do I do that in Mathematica? How do I specify a product that >skips a value in its iterator, i? (i.e. i != j) One way to do this would be to make use of the KroneckerDelta function. For example: In[11]:= Sum[Subscript[x, i]*Subscript[x, j]*(1 - KroneckerDelta[i,j]), {i, 3}, {j, 3}] Out[11]= 2*Subscript[x, 1]*Subscript[x, 2] + 2*Subscript[x, 3]*Subscript[x, 2] + 2*Subscript[x, 1]*Subscript[x, 3] -- To reply via email subtract one hundred and four