1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Integrating a floor function?

  1. Feb 1, 2010 #1
    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. jcsd
  3. Feb 1, 2010 #2

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  4. Feb 1, 2010 #3
    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.
     
  5. Feb 1, 2010 #4
    Thanks, I did construct the graph. I guess I should have worded the question better. Can a step function have area?
     
  6. Feb 1, 2010 #5

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    Why not? The area under a step function is just the sum of the signed areas of some rectangles, isn't it?
     
  7. Feb 1, 2010 #6
    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
     
  8. Feb 1, 2010 #7
    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.
     
  9. Feb 1, 2010 #8

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  10. Feb 1, 2010 #9
    Thanks for your help!
     
  11. Feb 1, 2010 #10
    in general if you want to integrate the floor function from say 0 to x where n<x<n+1, then what you need to do is break your integral at each point of discontinuity and use it as your integration limit, this way you will get a sum of integrals, and the last integral will be from n to x.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Integrating a floor function?
  1. Floor function proof (Replies: 3)

Loading...