# Integrate 1/r over a cylinder

1. Sep 15, 2008

### bdforbes

I have a cylinder of height 2a and radius R centered at the origin, and I want to integrate 1/r over it. Ie:

$$I=\int_{V}\frac{1}{\left|\texbf{x}\right|}d^{3}\texbf{x}$$

I know how to do it:

$$I=\int^{}_{}\int^{}_{}\int^{}_{}\frac{\rho d\phi d\rho dz}{\sqrt{\rho^2+z^2}}$$

But I'm wondering about why the integral is convergent. I understand that the volume elements for a given cylindrical partition depend on rho and thus get very small at the origin, compensating for the unbounded integrand, but if we think about it in cartesian coordinates it doesn't work. In cartesian coords the volume elements for a given partition are the same size everywhere, so as we make the partition finer, there is nothing to compensate for the unbounded integral.
Even if we can't use cartesian coordinates to calculate the integral exactly, in theory shouldn't we be able to numerically calculate the limiting value by using Riemann sums in cartesian coords? I haven't attempted to do this yet, but as far as I can tell, it will diverge.
Am I wrong about that? If so, can anyone give me a intuitive reason for why I should expect the cartesian Riemann sums to converge?

2. Sep 15, 2008

### Dick

Whether an integral converges or not is independent of the coordinates. That's why you can do a change of variables to solve integrals. Why do you need an intuitive reason why the integral converges in cartesian coordinates? Isn't that good enough?

3. Sep 16, 2008

### bdforbes

In terms of answering the question, it's good enough. But just answering questions is boring, I like to understand what's going on. Don't you agree that convergence is not obvious in cartesian coordinates?

4. Sep 16, 2008

### nathan12343

What you've written isn't exactly right, it isn't
$$I=\int_{V}\frac{1}{\left|\texbf{x}\right|}d^{3}\texbf{x}$$

It's,
$$I=\int_{V}\frac{1}{\texbf{r}}d^{3}\texbf{x}$$

with $r = \sqrt{x^2 + y^2 + z^2}$. Try doing that integral, it'll converge.

5. Sep 16, 2008

### Dick

The volume elements in cartesian coordinates can become 'very small at the origin'' just as easily as in cylindrical coordinates if you choose a nonuniform grid. And I don't think convergence in cylindrical coordinates is obvious either until I work it out. Why do you think it is?

6. Sep 16, 2008

### bdforbes

nathan12343:
The x in my equation was supposed to be a boldface vector x, so |x| = r. I know it converges, I just want to be able to use intuition.

Dick:
The integrand in cylindrical coordinates is bounded at the origin due to the extra factor of rho. In cartesian coordinates, the integrand diverges at the origin. To me that makes it obvious that in cylindrical coordinates the integral converges.
Regarding a non-uniform grid, shouldn't the integral converge no matter what grid we use? So we could use a uniform grid of cubes, correct?

7. Sep 16, 2008

### HallsofIvy

Staff Emeritus
$$I=\int^{a}_{-a}\int^{2\pi}_{0}\int^{R}_{0}\frac{\rho d\phi d\rho dz}{\sqrt{\rho^2+z^2}}$$
$$=2\pi\int^{a}_{-a}\int^{R}_{0}\frac{\rho d\rho dz}{\sqrt{\rho^2+z^2}}$$
Now, with the $\rho$ in the numerator, you can make the substitution $u= \rho^2+ z^2$ to do the $d\rho$ integration.

8. Sep 16, 2008

### Dick

Ok. The only reason I can think of that a Riemann sum approximation in cartesian coordinates will converge to a limit (after working around the singularity at r=0) is that I know it does in cylindrical coordinates. But there are many cases where some property of a function is obvious in a particular set of coordinates and extremely non-obvious in another.

9. Sep 16, 2008

### bdforbes

HallsofIvy:
You don't appear to have read all the posts. I know how to solve the problem, I'm really asking more of a meta-mathematical question, thanks.

Dick:
I guess I'll accept that. I have a habit of not being satisfied with technical arguments, but sometimes it is unrealistic to look for intuitive arguments. What I am going to do is write a simple program to calculate the Riemann sums, and see what happens when I use different partitions, hopefully I will gain some insight into the workings of Riemann integrals. I feel that this is something that is overlooked in calculus courses. In first year they taught us the definition of a Riemann integral, but after that we never referred to it again, we just apply rules that other people have derived for us. I find this to be unsatisfying.
Thanks for the help!

10. Sep 16, 2008

### Dick

Sure. Write a program. It should be instructive, though difficult - it's a 3-d integral of a not very well behaved function. To get any sort of convergence you'll have to make the cubes smaller and smaller as you approach the origin. And you'll have to avoid the origin itself altogether.