Home » Blog » Compute the integrals of some step functions

Compute the integrals of some step functions

Compute the following integrals where [x] is the greatest integer less than or equal to x.

  1. \displaystyle{\int_{-1}^3 [x] \, dx}.
  2. \displaystyle{\int_{-1}^3 \left[ x + \frac{1}{2} \right] \, dx}.
  3. \displaystyle{\int_{-1}^3 \left( [x] + \left[ x + \frac{1}{2} \right] \right) \, dx}.
  4. \displaystyle{\int_{-1}^3 2[x] \, dx}.
  5. \displaystyle{\int_{-1}^3 [2x] \, dx}.
  6. \displaystyle{\int_{-1}^3 [-x] \, dx}.

  1. \displaystyle{ \int_{-1}^3 [x] \, dx = (-1 \cdot 1)+(0 \cdot 1) + (1 \cdot 1) + (2 \cdot 1) = 2}.
  2. \displaystyle{ \int_{-1}^3 \left[ x + \frac{1}{2} \right] \, dx = \left( -1 \cdot \frac{1}{2} \right) + (0 \cdot 1) + (1 \cdot 1) + (2 \cdot 1) + \left( 3 \cdot \frac{1}{2} \right) = 4}.
  3. \displaystyle{ \int_{-1}^3 \left( [x] + \left[ x + \frac{1}{2} \right] \right) \, dx = \int_{-1}^3 [x] \, dx + \int_{-1}^3 \left[ x + \frac{1}{2} \right] \, dx = 2 + 4 = 6}.
  4. \displaystyle{ \int_{-1}^3 2[x] \, dx =  2 \cdot \int_{-1}^3 [x] \, dx = 4}.
  5. \displaystyle{ \int_{-1}^3 [2x] \, dx = \int_{-1}^3 \left( [x] + \left[ x + \frac{1}{2} \right] \right) \, dx = 6}. (See, 1.11 #4 (d) here).
  6. \displaystyle{ \int_{-1}^3 [-x] \, dx = -\int_1^{-3} [x] \, dx = \int_{-3}^1 [x] \, dx =  (-3 \cdot 1) + (-2 \cdot 1) + (-1 \cdot 1) + (0 \cdot 1) = -6}.

11 comments

  1. Hellow says:

    i don’t understand, why is #2 4? I mean, if you add 1/2 to x and take the greatest integer of it, it should equal the same as the greatest integer of x, right? So shouldn’t the answer be 2?

    • Daniel says:

      No. Let x = -1.75. Then [x] = -2. Nevertheless, if x = 1.75, then [x] = 1.

      If by chance you are reading the Spanish version of Apostol, leave it. It’s bad translated (even worse, it’s not just bad translated, but some parts are completely invented by the translator), concretely when it claims that “[x] is the integer part of x”, which is clearly false when x < 0. Follow the English version, which doesn't give misleading definitions.

  2. Anonymous says:

    Hi, I have problem about question f). First, [-x] = -[x] or [-x] = -[x] – 1 if we take -[x], the integral will be like question a) (negative of a) in the same interval.). If we take -[x] – 1, then we will have negative of a) plus integral of “-1” between [-1,3]. Can you help me to understand? Thank you.

    • Jake says:

      There is a part in Apostol that addresses this, I’ll paraphrase here and then explain how I applied it to part (f).

      “The ordinate set of any nonnegative step function s consists of a finite number of rectangles, one for each interval of constancy; the ordinate set may also contain or lack certain vertical line segments, depending on how s is defined at the subdivision points”

      Basically this means that, at the subdivision points, the value s(x) can be different than the value over the open subinterval.

      When I read (f), I see that the subdivision points, or the partition points of [-1, 3], are at the integer. So the value of s(x) at those points are [x] and the value over the open subintervals is -[x] - 1. You can then rewrite the problem as

          \[\int_{-1}^{3} -[x] - 1 = \int_{-1}^{3} -[x] + \int_{-1}^{3} - 1\]

          \[= - \int_{-1}^{3} [x] - \int_{-1}^{3} 1\]

          \[= - 2 - (1\cdot(3 -(-1)))\]

          \[= -6\]

  3. Anonymous says:

    So today we were doing these exercises and I got very confused because my math teacher was talking nonsense. First, I want to ask, in the function [x], for example, if x equals the value -0.5, [-0.5] = -1 ?? Is this correct? Second, how did you make your partition for exercise a) ? I mean, what subintervals did you use in order to get the result? We got 3 and our teacher said it was fine u_u which obviously is wrong. Thanks for the website!!!

    • RoRi says:

      Hi! Yes, [-0.5] = -1. The reason is that [x] is defined (at the top of this section of exercises on page 70 of my edition of Apostol) to be the greatest integer less than x. So if x = -0.5 then -1 is the biggest integer that is still less than x. (The other option people might want to write would be that it is 0, but this cannot be right since 0 > -0.5.)

      This causes some confusion since these days (Apostol was writing this book in the 60’s) this function is often called the “floor” function, but that was not the terminology used back then. It can be confused with the function that takes the “integer part” of x. The “integer part” of x (these days) means to just throw away everything after the decimal, so then you would get 0 if x = -0.5. So, your teacher probably wasn’t being crazy, just interpreting what Apostol meant by [x] slightly differently.

      Anyway, as for the partition, we use

          \[ P = \{ -1, 0, 1, 2 \}. \]

      Then using the definition of the integral of step function we have

          \begin{align*}  \int_{-1}^3 [x] \, dx &= -1 \cdot (0-(-1)) + 0 \cdot (1-0) + 1 \cdot (2-1) + 2 \cdot (3-2) \\  &= -1 + 0 + 1 + 2 \\  &= 2. \end{align*}

      There is some discussion of exactly this exercise and issue on math.stackexchange here. It even has pictures of the slight difference between the two functions.

      Hope this helps!

      • Anonymous says:

        Wow! That explains A LOT! Thank you very, very much for the website and for the quick response. I’ll stick around ’cause I’ve got a lot of homework and in case I get stuck I’ll just take a peek at your solutions. :D

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):