Home » Blog » Calculate the values of an integral of a step function

Calculate the values of an integral of a step function

For p \in \mathbb{Z}_{>0} define a step function on the interval [0,p] by

    \[ s(x) = \begin{cases} (-1)^n \cdot n & \text{if } n \leq x < n+1, \ n=0,1, \ldots, p-1 \\ 0 & \text{if } x =p. \end{cases} \]

Then, define

    \[ f(p) = \int_0^p s(x) \, dx. \]

  1. Calculate f(3), f(4), f(f(3)).
  2. Find all values of p such that |f(p)| = 7.

  1. We calculuate:

        \begin{align*} f(3) &= \int_0^3 s(x) \, dx = (-1)^0 0 (1-0) + (-1)^1 (1) (2-1) + (-1)^2 (2)(3-2) = 0 - 1 + 2 &= \phantom{-}1.\\ f(4) &= \int_0^4 s(x) \, dx = \int_0^3 s(x) \, dx + \int_3^4 s(x) \, dx = 1 + (-1)^3 (3) (4-3) &= -2. \\ f(f(3)) &= f(1) = \int_0^1 s(x) \, dx = (-1)^0 0 (1-0) &= \phantom{-}0. \end{align*}

  2. p = 14,15.

Note: There is an error in the book. The answers in the back of the book claim that f(4) = -1, which is incorrect.

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