# Thread: Equation for a summed series with a limit

1. ## Equation for a summed series with a limit

Hi,

I'm completely new to this. I am a software developer and haven't had the calculus books open for about a quarter of a century so I do aplologize if this is not in the correct forum. Further I'm not even sure if the question is phrased correctly.

$\lim_{x \to \infty}$ $\sum_{n = 0}^x$ $(1/n)(1/(d-r \cos(2\pi n/x))^2)$

I'm basically trying to figure out the value of the summed series $(1/n)(1/(d-r \cos(2\pi n/x))^2)$
where there are x elements in the series as x gets large. d and r are constants.

Hoping you can help or point me in the right direction.

Cheers,

Colin.

2. Originally Posted by ColinJ
Hi,

I'm completely new to this. I am a software developer and haven't had the calculus books open for about a quarter of a century so I do aplologize if this is not in the correct forum. Further I'm not even sure if the question is phrased correctly.

$\lim_{x \to \infty}$ $\sum_{n = 0}^x$ $(1/n)(1/(d-r \cos(2\pi n/x))^2)$
As it stands, that limit will be infinite, because the series $\textstyle\sum 1/n$ diverges, and the other factor is not small enough to prevent the divergence. [Edit: There's also the fact that if the series starts at n=0 then the first term of the series becomes problematic, with the factor 1/0.]

Did you by any chance mean to write $\lim_{x \to \infty}$ $\sum_{n = 0}^x (1/{\color{red}x})(1/(d-r \cos(2\pi n/x))^2)$ (with an x in place of the n)? That limit does exist, provided that $r. The series is then a Riemann sum, and its limit as $x\to\infty$ is the integral $\int_0^1\frac{d\theta}{(d-r\cos (2\pi\theta))^2}$. That integral can be evaluated, and I get its value to be $\frac{4d}{r^2\sqrt{d^2-r^2}}.$

3. Yes, you are indeed correct, the 1/x term should have been 1/n. I’m just happy the equation actually made sense enough for someone to help.

However, if I take a small series of say, six elements, and sum the values for r = 1 and d = 4 I get a sum of 0.068857. Using a spreadsheet for a series of 360 elements I get a similar sum of 0.68853 but just looking at the series of six, for values of n = 0 to 5 are;
0.018518519
0.013605442
0.008230453
0.006666667
0.008230453
0.013605442

Giving a sum of 0.068856975. I’m pretty sure this thing converges around 0.06 for d=4 and r = 1.

However, your equation returns a value of 4.131 for r = 1 and d = 4.

What am I missing?

4. Originally Posted by ColinJ
Yes, you are indeed correct, the 1/x term should have been 1/n. I’m just happy the equation actually made sense enough for someone to help.

However, if I take a small series of say, six elements, and sum the values for r = 1 and d = 4 I get a sum of 0.068857. Using a spreadsheet for a series of 360 elements I get a similar sum of 0.68853 but just looking at the series of six, for values of n = 0 to 5 are;
0.018518519
0.013605442
0.008230453
0.006666667
0.008230453
0.013605442

Giving a sum of 0.068856975. I’m pretty sure this thing converges around 0.06 for d=4 and r = 1.

However, your equation returns a value of 4.131 for r = 1 and d = 4.

What am I missing?
My fault – I never checked my answer for the integral, which I did in a hurry. The correct answer should be

$\boxed{\frac d{(d^2-r^2)^{3/2}}}.$

When d=4 and r=1, this gives 0.068853, just as the numerical simulation suggests.

5. Over the coming months I’ll try and work this into a 3D problem and also try and figure out how you got this result.

Thanks for this. I normally frequent IT forums as a part of my work and this forum is truly refreshing. The forum has genuine information from people that actually know what they’re talking about, without malicious comments directed at those seeking answers to questions that seem, to them, complex. Thanks again.

6. Originally Posted by ColinJ
I normally frequent IT forums as a part of my work and this forum is truly refreshing. The forum has genuine information from people that actually know what they’re talking about, without malicious comments directed at those seeking answers to questions that seem, to them, complex. Thanks again.
Thank our Moderators for that. They work very hard to keep a close eye on every post, to ensure high standards of behaviour and crack down on inappropriate postings.

7. ## Re: Equation for a summed series with a limit

I've taken my project to the next step using the equation you provided earlier and my next hurdle occurs with the addition of a second variable r2 and substituting the denominator of the original equation as the d variable in your solution. The latex probably explains better what I’m chasing;

$\lim_{x \to \infty} \sum_{n = 0}^x (1/x) \frac { d-r_{1}cos(2\pi n/x)} { ((d-r_{1} \cos(2\pi n/x))^2 – r_{2}^2)^{(3/2)}}$

Is this still a Riemann sum?

If I've got this right this should also converge to around 0.06 for d=4 and r = 1.

8. ## Re: Equation for a summed series with a limit

Originally Posted by ColinJ
I've taken my project to the next step using the equation you provided earlier and my next hurdle occurs with the addition of a second variable r2 and substituting the denominator of the original equation as the d variable in your solution. The latex probably explains better what I’m chasing;

$\lim_{x \to \infty} \sum_{n = 0}^x (1/x) \frac { d-r_{1}cos(2\pi n/x)} { ((d-r_{1} \cos(2\pi n/x))^2 – r_{2}^2)^{(3/2)}}$

Is this still a Riemann sum?

If I've got this right this should also converge to around 0.06 for d=4 and r = 1.
Yes it is still a Riemann sum, and the limit is equal to the integral

$\int_0^1\!\!\frac{d-r_1\cos(2\pi x)}{\bigl((d-r_1\cos(2\pi x))^2 - r_2^2\bigr)^{3/2}}\,dx.$

That is a far more elaborate integral than the one in the previous problem, and I doubt whether it is possible to give the answer in a closed form. For particular values of d, r_1 and r_2, you can presumably get Mathematica or Wolfram to churn out an answer.

9. ## Re: Equation for a summed series with a limit

Hi,

I've spent a fair amount of time on my project and discovered that I need another term in the denominator (as below).

$\lim_{x \to \infty} \sum_{n = 0}^x (1/n)(1/((d-r \cos(2\pi n/x))^2 + (r \sin(2\pi n/x))^2 ))$

I'm guessing this becomes the integral;
$\int_0^1\frac{d \theta}{\bigl(d-r\cos(2\pi \theta))^2 + (r \sin(2 \pi \theta))^2 }$.

But, I can't for the life of me solve this thing. Any help is appreciated once again. I'm fairly sure it converges to around 0.0412468 for d = 5 and r = 1.

Regards,

Colin.

10. ## Re: Equation for a summed series with a limit

Originally Posted by ColinJ
Hi,

I've spent a fair amount of time on my project and discovered that I need another term in the denominator (as below).

$\lim_{x \to \infty} \sum_{n = 0}^x (1/n)(1/((d-r \cos(2\pi n/x))^2 + (r \sin(2\pi n/x))^2 ))$

I'm guessing this becomes the integral;
$\int_0^1\frac{d \theta}{\bigl(d-r\cos(2\pi \theta))^2 + (r \sin(2 \pi \theta))^2 }$.

But, I can't for the life of me solve this thing. Any help is appreciated once again. I'm fairly sure it converges to around 0.0412468 for d = 5 and r = 1.
You are right about the integral. As it happens, this complicated-looking integral can be evaluated fairly easily by using complex numbers and the method of contour integration. If you make the substitution $z = e^{2\pi i\theta}$ then the integral becomes

$\frac i{2\pi}\oint_C\frac{dz}{rdz^2 - (r^2+d^2)z + rd},$ (**)

where the integral is taken round the unit circle C. If $r then Cauchy's integral formula gives the answer as $\boxed{\frac1{d^2-r^2}}$ (I have skipped all the details of the calculation). If d=5 and r=1, that becomes $1/24\approx0.0416667,$ fairly close to the answer that you wanted.

(**) Edit. I have just seen that this integral looks confusing. The "dz" in the numerator is just the usual notation for an integral with respect to z, but in the denominator "d" is a constant and " $dz^2$" means d times z squared.

11. ## Re: Equation for a summed series with a limit

Thanks once again.

My fault on that confusing integral. Obviously d is an inappropriate variable where integrals are involved. And, I have some reading to do.

Much appreciated.

12. ## Re: Equation for a summed series with a limit

would you mind posting some of the details of the calculation? i cant follow (at least the algebra) in converting from $\theta$ to z.
i got to a point like this and gave up:
$\frac{4\,{z}^{2}}{{i}^{2}\,{r}^{2}\,{z}^{4}+{r}^{2 }\,{z}^{4}-4\,d\,r\,{z}^{3}-2\,{i}^{2}\,{r}^{2}\,{z}^{2}+2\,{r}^{2}\,{z}^{2}+4 \,{d}^{2}\,{z}^{2}-4\,d\,r\,z+{i}^{2}\,{r}^{2}+{r}^{2}}$
after making the substitution.
though i think i may be hijacking this thread.. if i am please correct me.
Originally Posted by Opalg
You are right about the integral. As it happens, this complicated-looking integral can be evaluated fairly easily by using complex numbers and the method of contour integration. If you make the substitution $z = e^{2\pi i\theta}$ then the integral becomes

$\frac i{2\pi}\oint_C\frac{dz}{rdz^2 - (r^2+d^2)z + rd},$ (**)

where the integral is taken round the unit circle C. If $r then Cauchy's integral formula gives the answer as $\boxed{\frac1{d^2-r^2}}$ (I have skipped all the details of the calculation). If d=5 and r=1, that becomes $1/24\approx0.0416667,$ fairly close to the answer that you wanted.

(**) Edit. I have just seen that this integral looks confusing. The "dz" in the numerator is just the usual notation for an integral with respect to z, but in the denominator "d" is a constant and " $dz^2$" means d times z squared.

13. ## Re: Equation for a summed series with a limit

Originally Posted by phycdude
would you mind posting some of the details of the calculation? i cant follow (at least the algebra) in converting from $\theta$ to z.
The integral was $\int_0^1\frac{d \theta}{\bigl(d-r\cos(2\pi \theta))^2 + (r \sin(2 \pi \theta))^2 }$. If you make the substitution $z=e^{2\pi i\theta}$ then $\cos\theta = \tfrac12(z+z^{-1}),$ $\sin\theta = \tfrac1{2i}(z-z^{-1})$ and the differential $dz=2\pi ie^{2\pi i\theta}d\theta = 2\pi izd\theta,$ so that $dz = \tfrac{d\theta}{2\pi iz}.$ As θ goes from 0 to 1, z goes right round the unit circle. Thus the integral becomes

$\oint_C \frac1{\bigl(d-\frac r2(z+z^{-1})\bigr)^2 + \bigl(\frac r{2i}(z-z^{-1})\bigr)^2}\,\frac{dz}{2\pi iz}.$

Multiply top and bottom by 4z to get

$\frac1{2\pi i}\oint_C\frac{4z}{\bigl(2dz-r(z^2+1)\bigr)^2 - r^2(z^2-1)^2}dz.$

The denominator is

$4d^2z^2 - 4rdz(z^2+1) + r^2(z^4+2z^2+1) - r^2(z^4-2z^2+1)$

which simplifies to $-4rdz(z^2+1) + 4z^2(d^2+r^2).$

Substitute that into the denominator of the integral, cancel 4z top and bottom, change the sign of the denominator and move the "i" in the constant outside the integral from the denominator to the numerator to compensate. The result is

$\frac i{2\pi}\oint_C\frac1{rd(z^2+1)-(d^2+r^2)z}dz.$