I need to integrate a complicated expression numerically. However, I am not sure how to implement the DiracDelta and its corresponding derivative into code that makes sense.
Here is an example
func = 2 (3-2 x) x^2 HeavisideTheta[1-x]-4 (11/2 DiracDelta[-1+x]-x^2 (6+5 x) HeavisideTheta[1-x])-2 (1/6 DiracDelta[-1+x]-5/3 x^3 HeavisideTheta[1-x]+1/6 (DiracDelta^\[Prime])[1-x])
NIntegrate[func,{x,0,1}]/.HeavisideTheta[0]->1//Simplify
The result of the integral is -15/2 with symbolic integration. I know that DiracDelta is tricky in numerical integration since it will evaluated as zero, however, I really need a trick how to deal with this numerically, especially the derivate