Is there a built-in feature for handling things like:
$$\sum_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$ and $$\prod_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$
or should I work out some sort of Do statement?
|
Is there a built-in feature for handling things like: $$\sum_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$ and $$\prod_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$ or should I work out some sort of Do statement? |
|||
|
The documentation for
and similarly for
|
|||
|
|
|
J. M.'s method is appropriate for sums (and products) that will be computed iteratively. You could use
The output of the symbolic sum is itself a
(Symbol One can also compute infinite sums in this fashion, e.g.:
It may be simpler to compute two sums and subtract when possible:
Beware when using conditions that evaluate on non-numeric arguments (e.g.
|
|||
|
|
If[]orBoole[]is useful. – J. M.♦ Aug 10 '12 at 13:32Product[If[k != j, (x - l[[j]])/(l[[k]] - l[[j]]), 1], {j, 1, Length[l]}], just wondering if there was something built in to take care of things like this. Thanks for the suggestions! – Michael Boratko Aug 10 '12 at 13:39