Re: Simple Sum does not simplify
- To: mathgroup at smc.vnet.net
- Subject: [mg55490] Re: [mg55472] Simple Sum does not simplify
- From: "David Park" <djmp at earthlink.net>
- Date: Sat, 26 Mar 2005 02:39:21 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Alix, I think that Mathematica would definitely benefit by having a good sum manipulation package (or maybe it has one that I don't know about?). In any case, the following, which takes a little work, will simplify your expression. Sum[n*a[i] - Sum[a[j], {j, 1, n}], {i, 1, n}]; % /. HoldPattern[Sum[(a_) - Sum[b_, iter2_], iter1_]] :> Sum[a, iter1] - Sum[b, iter1, iter2] % /. HoldPattern[Sum[x_ /; FreeQ[x, n], p___, {_, 1, n}, q___]] :> Sum[n*x, p, q] % /. j -> i Sum[n*a[i], {i, 1, n}] - Sum[a[j], {i, 1, n}, {j, 1, n}] Sum[n*a[i], {i, 1, n}] - Sum[n*a[j], {j, 1, n}] 0 It is quite often the case with Mathematica (or any CAS) that you will have to write a set of rules or definitions to handle the area of mathematics you are dealing with - even if that area seems to you to be very common. If Mathematica had every possible useful relation it would end up with millions of commands. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Alix [mailto:ali_tofigh at hotmail.com] To: mathgroup at smc.vnet.net Here is a simple symbolic sum: Sum[n a[i] - Sum[a[j], {j, n}], {i, n}] This should simplify to 0, but it doesn't. Why and is there a way to get mathematica to work with these kind of sums? I'm using mathematica 5.0.