Home » Blog » Establish some properties of the integral of the floor function

Establish some properties of the integral of the floor function

Define a function

    \[ f(x) =  \begin{dcases}     x - [x] - \frac{1}{2} & \text{if } x \notin \mathbb{Z} \\    0 & \text{if } x \in \mathbb{Z}. \end{dcases} \]

where [x] denotes the greatest integer less than or equal to x, also called the floor function.

Then, define a function

    \[ P(x) = \int_0^x f(t) \, dt \qquad \text{for all } x \in \mathbb{R}. \]

  1. Draw the graph of f(x) for x \in [-3,3] and prove that f is periodic with period 1.
  2. For 0 \leq x \leq 1, prove

        \[ P(x) = \frac{1}{2} (x^2 - x), \]

    and prove that P is also periodic with period 1.

  3. Give a formula for P(x) in terms of the floor of x.
  4. Find a c \in \mathbb{R} such that

        \[ \int_0^1 (P(t) + c) \,dt = 0. \]

  5. For the constant c \in \mathbb{R} from part (d), define

        \[ Q(x) = \int_0^x (P(t) + c) \, dt. \]

    Prove that Q is periodic with period 1 and that if 0 \leq x \leq 1, we have,

        \[ Q(x) = \frac{x^3}{6} - \frac{x^2}{4} + \frac{x}{12}. \]


  1. The graph of f is as follows:

    Rendered by QuickLaTeX.com

    Then, we prove that f is periodic with period 1.
    Proof. We compute to show f(x+1) = f(x) (where I’ve replaced Apostol’s notation [x] with \lfloor x \rfloor since this less likely to cause confusion, also we use the solution to this exercise in the second line)

        \begin{align*}  f(x+1) &= (x+1) - \lfloor x+1 \rfloor - \frac{1}{2} & (\lfloor x \rfloor \text{ denotes floor})\\  &= x - (\lfloor x \rfloor + 1) + \frac{1}{2} & (\lfloor x+1 \rfloor = \lfloor x \rfloor + 1)\\  &= x - \lfloor x \rfloor - \frac{1}{2} \\  &= f(x). \qquad \blacksquare \end{align*}

  2. Proof. First, we establish the requested formula,

        \begin{align*}  P(x) = \int_0^x f(t) \, dt &= \int_0^x \left( t - \lfloor t \rfloor - \frac{1}{2} \right) \, dt \\  &= \int_0^x t \, dt - \int_0^x \lfloor t \rfloor \, dt - \int_0^x \frac{1}{2} \, dt \\  &= \left. \frac{t^2}{2} \right|_0^x - \left. \frac{1}{2} \int_0^x & (\lfloor t \rfloor = 0 \text{ for all } x \in [0,1))\\  &= \frac{1}{2} (x^2 - x). \end{align*}

    This was the requested formula. Next, to show P is periodic with period 1, we show P(x+1) = P(x) for any x,

        \begin{align*}  P(x+1) = \int_0^{x+1} f(t) \, dt &= \int_0^1 f(t) \, dt + \int_1^{x+1} f(t) \, dt \\  &= P(1) + \int_0^x f(t+1) \, dt. \end{align*}

    Then, using the formula in the first part of (b) we have

        \[ P(x) = \frac{1}{2} (x^2 - x) \quad \implies \quad P(1) = \frac{1}{2} (1^2 - 1) = 0. \]

    Further, from part (a) we know f is periodic with period 1, so f(t+1) = f(t), and we have,

        \begin{align*}   P(x+1) &= 0 + \int_0^x f(t) \, dt \\   &= P(x), \end{align*}

    by definition of P(x). Thus, P is periodic with period 1. \qquad \blacksquare

  3. To express P(x) in terms of of \lfloor x \rfloor we compute as follows:

        \begin{align*}  P(x) = \int_0^x f(t) \, dt &= \int_0^1 f(t) \, dt + \int_1^2 f(t) \, dt + \cdots + \int_{\lfloor x \rfloor}^x f(t) \, dt \\  &= 0 + 0 + \cdots + \int_{\lfloor x \rfloor}^x f(t) \, dt \\  &= \int_0^{x - \lfloor x \rfloor} f(t) \, dt, \end{align*}

    where f(t + \lfloor x \rfloor) = f(t) since \lfloor x \rfloor is an integer by definition, and f has period 1, so f(t+n) = f(t) for any integer n. Continuing,

        \begin{align*}  P(x) &= \int_0^{x - \lfloor x \rfloor} \left( t - \lfloor t \rfloor - \frac{1}{2} \right) \, dt \\  &= \left. \frac{t^2}{2} \right|_0^{x - \lfloor x \rfloor} - \left. \frac{t}{2} \right|_0^{x - \lfloor x \rfloor}. \end{align*}

    Here, we know the \lfloor t \rfloor term in the integral is zero since \lfloor t \rfloor = 0 for all t \in [0, \lfloor x \rfloor ] since x - \lfloor x \rfloor < 1. Then,

        \begin{align*} P(x) &= \frac{1}{2} \left( \left( x - \lfloor x \rfloor\right)^2 - x + \lfloor x \rfloor \right) \\  &= \frac{1}{2} \left( x - \lfloor x \rfloor\right)^2 - \frac{1}{2} \left( x - \lfloor x \rfloor \right). \end{align*}

    This is the requested expression of P(x) in terms of \lfloor x \rfloor.

  4. Here we compute the integral, using the formula for P(x) we established in part (c), and solve for the requested constant c,

        \begin{align*}  \int_0^1 \left( P(t) + c \right) \, dt = 0 && \implies && \int_0^1 \left( \frac{1}{2} \left(t - \lfloor t \rfloor \right)^2 - \frac{1}{2}\left(t - \lfloor t \rfloor \right) + c \right) \, dt &= 0 \\ && \implies && \frac{1}{2} \int_0^1 t^2 \, dt - \frac{1}{2} \int_0^1 t \, dt + \int_0^1 c \, dt &= 0 \\ && \implies && \frac{1}{6} - \frac{1}{4} + c &= 0 \\ && \implies && c = \frac{1}{12}. \end{align*}

  5. First we give the proof that Q is periodic with period 1.
    Proof. We compute,

        \begin{align*}  Q(x+1) &= \int_0^{x+1} \left( P(t) + \frac{1}{12} \right) \, dt \\  &= \int_0^1 \left( P(t) + \frac{1}{12} \right) \,dt + \int_1^{x+1} \left( P(t) + \frac{1}{12} \right) \, dt \\  &= 0 + \int_0^x \left( P(t+1) \frac{1}{12} \right) \, dt & (\text{Exp/Cont of interval of int})\\  &= \int_0^x \left( P(t) + \frac{1}{12} \right) \, dt &(P \text{ is periodic with period } 1) \\  &= Q(x). \qquad \blacksquare \end{align*}

    Next, we establish the requested formula. If 0 \leq x \leq 1, we have

        \begin{align*}  Q(x) &= \int_0^x \left( P(t) + \frac{1}{12} \right) \, dt \\  &= \int_0^x \left( \frac{1}{2} \left( t - \lfloor t \rfloor\right)^2 - \frac{1}{2} \left( t - \lfloor t \rfloor \right) + \frac{1}{12} \right) \, dt \\  &= \frac{1}{2} \int_0^x t^2 \,dt - \frac{1}{2} \int_0^x t \, dt + \frac{1}{12} \int_0^x dt \\ \intertext{where all of the $\lfloor t \rfloor$ terms are 0 for $0 \leq t \leq 1$} \\  &= \left. \frac{t^3}{6} \right|_0^x - \left. \frac{t^2}{4} \right|_0^x + \left. \frac{t}{12} \right|_0^x \\  &= \frac{x^3}{6} - \frac{x^2}{4} + \frac{x}{12}.  \end{align*}

    as requested.

3 comments

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