# Integral to Riemann sum

I am trying to convert an integral to a Riemann sum like this:

$$\int_a^b f(x) \,dx = \lim_{n\to \infty} \sum_{k=1}^n f(x_i)\Delta x$$

Where, $\Delta x = \frac{b-a}{n}$ and $x_i = a + i \Delta x$.

My attempt:

$$\int_1^{n+1} f(x)\, dx = \lim_{n\to \infty} \sum_{k=1}^n f(1+k)$$

Since $\Delta x = 1$ and $x_i = 1+i$

I do believe this is wrong though. How do I take into account the upper bound $n+1$?

Thank you.

• This is not right. Since you have an $n$ that is on the left-hand side, you can't take $\lim_{n \rightarrow \infty}$. You'll have to use a different variable for the limit. – Jair Taylor May 20 '18 at 19:28
• So if I change n to p on the right hand side it is ok? My hope was that since there is a "n+1" the expression on the right hand side would be something different. – What Gives May 20 '18 at 20:02
• There's no need to replace b with n+1. It should have been left as b. The summation in the final line is also incorrect; $\Delta x$ and n change as n changes. – NicNic8 May 20 '18 at 20:03
• @NicNic8 The integral that I am working with looks like that, it is not something I have constructed on my own. – What Gives May 20 '18 at 20:04
• @WhatGives No, that's not enough. Your computation for $\Delta x$ will also change. If you are using $p$ for the number of subintervals then your $\Delta x$ would become $(b-a)/p$. – Jair Taylor May 20 '18 at 20:07

In this case you've got $\Delta x = \frac{n}{k}$ and $x_i = 1 + \frac{in}{k}$ so that $$\int_1^{n+1} f(x) \, dx = \lim_{k\to\infty} \sum_{i=1}^k f(1 + \frac{in}{k})\frac{n}{k}.$$
Note that $n$ is a constant in this example, so you need to choose another letter, say $k$, to represent the variable that determines the number of rectangles in your approximation. Then the variable i'' is the `dummy variable' that tells which rectangle to refer to when computing the sum.
• @WhatGives the number of terms of the form $f(x)$ become greater. Think about the average, defined as $\frac{1}{n}\sum_{k=1}^n f(k)$. As $n \to \infty$ averages don't always tend to zero. In this case case we are just taking values of $f$ at $1+\epsilon$ for small epsilon. – Brevan Ellefsen May 20 '18 at 21:39
• @WhatGives I challenge you to take $f(x) = x$, $n =2$, and $k = 4$ (forget about the limit for the moment). Then I would ask you to explicitly write down each term of the Riemann sum. This may help you a little bit. – treble May 21 '18 at 0:33