# Writing Riemann sums for physics problems

1. If I want to find the mass of a rod of length l and density $\rho = kx$ where $x$ is the distance from one end.

2. If I want to find the gravitational potential due to a hollow sphere at a distance x from the center

I want to know how to set up a Riemann sum for physics problems.

I know for a Riemann sum we need to sum up $\Sigma f(x_i)Δx$ from $i = 1$ to $∞$ where $Δx ->0$ turning this into an integral.

But I don't know how to set it up. For example, in the first part, I've tried $$M =\Sigma \Delta m =\Sigma (kx) \Delta x$$ where $\Delta x$ is a small(finite) length but I don't know how to set up the index and sum it from 0 to l

• ...why would you want to "set up a Riemann sum" and not just integrate in the first place? Or, rather, just take the usual integral and go back to what a Riemann sum is and write it down; where's the physics here? Feb 25 '17 at 10:45
• For the sake for understanding. I obviously wouldn't do this on a test. Feb 25 '17 at 10:46
• Don't you know infinite Riemann sum and integrals are same. If you really want to take a large Riemann sum, I suggest using a computer than doing on a paper.
– user143678
Feb 25 '17 at 10:55
• Related questions by OP : Question about the use of integration in physics and How can we treat dV like this? Feb 26 '17 at 19:56

Since in the limit as $\Delta x \to 0$ a Riemann sum becomes a Riemann integral, if you want to find the corresponding sum, you can do the process in reverse. In the case of a rod of length $\ell$ with density $\rho(x) = kx$, one has that its mass is,

$$m = \int_0^\ell k x \, \mathrm dx = \frac12 k \ell^2.$$

This is equivalent to considering the Riemann sum,

$$\sum_{i=0}^{N-1} \rho(x_i) \, \Delta x = k \sum_{i=0}^{N-1} x_i \, \Delta x$$

where $\Delta x = \ell/N$ for $N$ partitions of the interval. As $N \to \infty$ and thus $\Delta x \to 0$ we recover the integral and thus the exact mass of the rod.

I know for a Riemann sum we need to sum up $\sum f(x_i)Δx$ from $i=1$ to $\infty$

It sounds like you're trying to sum over an infinite range of $x$.

To do this numerically you need to use a finite number of steps (not an infinite number) and use one of the tricks on this page.

• The OP is not trying to actually numerically approximate an integral using a Riemann sum; he just wants to understand how to set up the sum. Feb 25 '17 at 11:27
• That's not my impression. Feb 25 '17 at 11:29
• Read the comments; he says "for the sake of understanding." Feb 25 '17 at 11:31
• That doesn't change my interpretation of his problem. Feb 25 '17 at 11:33