Let's say I have a floor function that I want to integrate, $$\int_{-1}^{3} \left[ x + \dfrac{1}{2} \right] \; dx$$
and I graphed it as shown below,
Would it be correct to evaluate it saying that for example from $-1$ to $-0.5$ the step function is $-1$ looking at the $y$-axis? and from $2.5$ to $3$ it is equal to $3$? I have tried that and I got a correct answer, but I don't know if this is definitely correct or it was just a coincidence for this particular floor function. I know I can solve this by finding the area under each graph, but I just want to know if this method that I mentioned above is correct or not?
Solving this another method, I got for example that from $-1$ to $0$, the step function is equal to $-\dfrac{1}{2}$, which I also noticed that from the graph from $-1$ to $0$, the open circle lies at $-0.5$, is that a correct way of solving? by looking at each open circle and where it lies?