Integrate Bangbang function