So I have missed one of our lectures and I am finding it hard to understand how this works out with a split function, example below:

for $c_1 \neq c_2$ (constants)

$f(x) = \begin{cases} c_1 \space \text{if} \space 0 \le x< 1 \\ c_2 \space \text{if} \space 1 \le x\le 2 \end{cases}$

I need to calculate reimann sum for the Partition: $P = \{x_0=0,x_1=0.3,x_2=0.7,x_3=1.5,x_4=1.8,x_5=2\}$

and for these values: $A.{w_1=0.2,w_2=0.5,w_3=0.9,w_4=1.7,w_5=1.9}$ and $B.{w_1=0.2,w_2=0.5,w_3=1.4,w_4=1.7,w_5=1.9}$

Using the Reimann formula I came up with $1.5c_1+0.5c_2$ as a result for A but I am unsure of how should a splitted function be treated.

An explanation would be greatly appreciated.

  • $\begingroup$ A typo: Riemann sum, not "reimann sum". $\endgroup$ Commented Jun 3, 2016 at 9:02
  • $\begingroup$ @DietrichBurde You know you can also edit the question, right? $\endgroup$
    – 5xum
    Commented Jun 3, 2016 at 9:04
  • $\begingroup$ @5xum Maybe the OP should correct his own typos himself ? $\endgroup$ Commented Jun 3, 2016 at 9:11
  • $\begingroup$ @DietrichBurde I guess... but if you put in the effort to point out the typo, I don't see why you wouldn't just correct it. It would actually be quicker... $\endgroup$
    – 5xum
    Commented Jun 3, 2016 at 9:12
  • $\begingroup$ @5xum Quicker, yes, and more convenient for the OP yes. But will he learn it that way ? No. $\endgroup$ Commented Jun 3, 2016 at 9:12

1 Answer 1


The riemann sum, by definition, is

$$\sum_{i=0}^{n-1} (x_{i+1}-x_i)\cdot w_{i+1}$$

In your case, this results in

$$(x_1-x_0)f(w_1) + (x_2-x_1)f(w_2) + (x_3-x_2)f(w_3) + (x_4-x_3)f(w_4) + (x_5-x_4)f(w_5) =\\ =0.3\cdot f(0.2) + 0.4\cdot f(0.5) + 0.8\cdot f(0.9) + 0.3\cdot f(1.7) + 0.2\cdot f(1.9)$$

Now just plug in the numbers and you get

$$0.3\cdot c_1+0.4\cdot c_1+0.8\cdot c_1 +0.3\cdot c_2+0.2\cdot c_2 = 1.5c_1+0.5c_2$$

so you are correct.

The Riemann sum doesn't care that the function is a "splitted function". The sum only cares about what the value of $f$ at the points $w_i$ is, and how long the intervals are. That's all. The value of $f\left(\frac1\pi\right)$ can be $23849234$, but that won't affect the riemann sum in question.

  • $\begingroup$ Thanks a lot. correct me if I am wrong but the method is basically a way of calculating the area between the function and the x coordinate, how, then, the area will accurately be calculated if the function is splited, in this case my concerns were by executing (x3-x2)*f(w3). $\endgroup$
    – Tom.A
    Commented Jun 3, 2016 at 9:22
  • $\begingroup$ @Tom.A Each Riemann sum on its own is not the area between the function and the $x$ coordinate. The limit of the Riemann functions is the area. $\endgroup$
    – 5xum
    Commented Jun 3, 2016 at 9:24
  • $\begingroup$ Thanks a lot! I believe that makes the result for B. 0.7c1+1.3c2, since f(w3) = c2 in this case. $\endgroup$
    – Tom.A
    Commented Jun 3, 2016 at 9:49
  • $\begingroup$ @Tom.A Exactly. remember, if this answer is what you were looking for, you can also upvote and/or accept it. $\endgroup$
    – 5xum
    Commented Jun 3, 2016 at 9:49
  • $\begingroup$ .if I want to prove integrability by definition between [0,2]? this seems odd, yet again I keep on having issues with the fact that it's splited. $\endgroup$
    – Tom.A
    Commented Jun 3, 2016 at 12:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .