Fixes issue 8504

#8504 

While evaluation sum as euler maclaurin formula with limits as integers check whether the expression is polynomail or not.
I intially wrote that but when ran the code It gave me an error say f is an instance of `Add` and doesn't have `is_polynomial`