I want to simplify the sum
smp.Sum(smp.Sum(smp.Indexed('x',i), (i, 0, n)),(j,0,n))
where x, i, j, and n are standard defined sympy variables. Note that this is a double sum, but the variable being summed over (x_i) only depends on i. Hence, when simplifying this expression, I should get n*sum_i x_i but this is not the case. In other words
smp.Sum(smp.Sum(smp.Indexed('x',i), (i, 0, n)),(j,0,n)).simplify()
Does not remove the outer sum (over j) and replace it with a multiplicative factor of n, like it should.
Am I using simplification wrong here? Or is this not implemented in sympy yet...?
question from:https://stackoverflow.com/questions/66058091/double-summation-simplifcation-in-sympy