Fixes issue 8504

#8504 

While evaluation sum as euler maclaurin formula with limits as integers check whether the expression is polynomail or not.
> Then for the remaining terms we use the euler_maclaurin formula i.e, we integrate the function and calculate other terms & error term.

Indeed.  That make sense.