The solution is different. The left rectangle is a left sum, the right one a right sum (heights taken from f(-1) and f(1)). Try this to match:
riemann(f, -1, 0, 5; method="left") + riemann(f, 0, 1, 5; method="right")
The solution is different. The left rectangle is a left sum, the right one a right sum (heights taken from f(-1) and f(1)). Try this to match:
riemann(f, -1, 0, 5; method="left") + riemann(f, 0, 1, 5; method="right")