working with sums
- To: mathgroup at yoda.physics.unc.edu
- Subject: working with sums
- From: mwl at trantor.jpl.nasa.gov (Martin W. Lo)
- Date: Wed, 3 Mar 93 10:44:34 PST
Dear Mathgroup,
1.) I'm trying to work with sums and can't get the algebra to work.
For example:
In[1]:= << Algebra`SymbolicSum`
In[2]:= s=Sum[a*x[i],{i,1,n}]
Out[2]= Sum[a x[i], {i, 1, n}]
In[3]:= s/a
Sum[a x[i], {i, 1, n}]
Out[3]= ----------------------
a
Of course, the function x[i] is not defined, but surely this simple factor
out to be possible? Using Expand and Simplify do nothing. Although,
differentiation with respect to a works:
In[4]:= D[s,a]
Out[4]= Sum[x[i], {i, 1, n}]
Is there some way to make this work? Or do I have to use Map and get at
the expression at specific levels?
2.) What is the difference between Sum and SymbolicSum?
This is what I get with SymbolicSum (doing the same operations above):
In[5]:= ss=SymbolicSum[a*x[i],{i,1,n}]
Out[5]= SymbolicSum[a x[i], {i, 1, n}]
In[6]:= ss/a
SymbolicSum[a x[i], {i, 1, n}]
Out[6]= ------------------------------
a
In[7]:= D[ss,a]
(1,0)
Out[7]= {x[i] SymbolicSum [a x[i], {i, 1, n}],
(1,0)
> x[i] SymbolicSum [a x[i], {i, 1, n}],
(1,0)
> x[i] SymbolicSum [a x[i], {i, 1, n}]}
What does this last result mean?
Does one have to specify the function x in some way? I need it to be
arbitrary. Thanks in advance.
Martin Lo
jpl 818-354-7169
mwl at trantor.jpl.nasa.gov