The built-in integration function cannot handle functions with if statements and integration variables with units.
You can use cases() for piecewise continuous functions and you can make the integration variable dimensionless.
You might want to increase the number of intervals for integration (Tools> Settings) in order to get more precise results (no adaptive numeric procedure).

Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx