Fixes issue 8504

#8504 

While evaluation sum as euler maclaurin formula with limits as integers check whether the expression is polynomail or not.
Can you explain this?