Integrate functions multiplied by Heavisides

- uses manualintegrate to deal with complicated cases