yes i think the problem in this case arises because of the two spikes of the function so there is a need to split the integral so that we can solve it separately for each one.

The integral with respect to ##y## came out the "wrong" way. The lower limit was greater than the upper limit. In general, you need to look out for this when integrating:

##\int_a^b = - \int_b^a##

So, for example:

##\int_1^{-1}\delta(x)dx = -1##

I could have avoided this by having ##y = -(x^2 -3x +2)## in that integral. Then the limits would have been the right way round (with respect to ##y##) and the negative sign would have come from ##dy##.

@PRASHANT KUMAR even at this level graphs help. I have a nice graph of ##x^2-3x +2##, so I can see clearly what the function is doing about the zeros and what happens when I substitute ##y## It is easy to miss that the function has a negative gradient around ##x=1## so the natural integral substitution comes out the wrong way.

Where ##y_1, y_2## etc. are the y-values for ##a-\epsilon, a+\epsilon## etc.

Now, from the graph, we have to note that ##y_1 > 0## and ##y_2 < 0##. So, we need to get these limits in the correct order. Also, as we have this in the Dirac function for ##y##, we are simply evaluating at y=0, which equates to ##x =a## and ##x=b## respectively. So:

yes that is true if we change the sign then the limits are interchanged but how can it imply that the lower limit should always be less than the upper limit