# Integrating a floor function?

1. Feb 1, 2010

### Integral8850

1. The problem statement, all variables and given/known data
Integral [x] - 2[x/2] dx limits are 0 to 2

I am using [] to represent the floor function.

2. Relevant equations

3. The attempt at a solution
Of course normal integration gives

x^2/2 - x^2/2 which gives 0 for all cases, So is it right to assume a floor function (not continuous) is always 0?
Thanks!

2. Feb 1, 2010

### Dick

You don't 'assume' something is equal to zero. You 'show' something is equal to zero. Draw a graph of [x]+2*[x/2] between 0 and 2. It's just a step function.

3. Feb 1, 2010

### elect_eng

I don't think it's a good idea to use the answer for the continuous functions as a basis for the answer for the floor function. There are too many pitfalls with doing this.

In this case, the answer is clearly not zero. You can quickly graph out the functions and see the answer by inspection.

In more difficult cases, there are probably good methods to use. I've never had to do this before, but it seems to me you can probably convert some integrals (such as your case) to summation expressions.

4. Feb 1, 2010

### Integral8850

Thanks, I did construct the graph. I guess I should have worded the question better. Can a step function have area?

5. Feb 1, 2010

### Dick

Why not? The area under a step function is just the sum of the signed areas of some rectangles, isn't it?

6. Feb 1, 2010

### Integral8850

I can clearly see that the graphs area is 1, however integrating [x]-2[x/2] conventionally will always give 0. I guess I should ask is there a special integration for a step function? Thanks

7. Feb 1, 2010

### elect_eng

Personally, I would attempt to convert the problem to a summation (when possible), rather than an integral. There are techniques and tables for evaluation of summations, just as there are for integrals.

8. Feb 1, 2010

### Dick

If you can see that the graphs area is 1, then I think you've solved the problem. You can certainly write down special rules for integrating step functions. But they are going to look complicated, and on a simple problem like this, it's really not worth it.

9. Feb 1, 2010