Horrendous definite integral

swanstuff

New member
Joined
Jun 17, 2020
Messages
11
Hi
I'm trying to design a board with a set of nested polygons offset at various angles. In order to do this as neatly as possible, I am eager to find a formula for the average distance between a point on one polygon (with N+1 sides and "radius" r+d) to a point on the next polygon in (with N sides and radius r), as the inner polygon rotates through an angle of 2π/N.

I believe that, to do this, I need the value of the following horrid definite integral, but my integration skills are poor and nowhere near good enough for this. Is anyone able to give me a value, in terms of r, d, and N (which can all be regarded as constants for this purpose)?

1/4 × definite integral from 0 to π/N of
[square root of
(r + d - r cos(2πz/N) )² + (r sin(2πz/N) )²]
dz

I am using "radius" to mean the distance between the centre and any vertex of the polygon.

Thanking you in anticipation.
 
1/4 × definite integral from 0 to π/N of [square root of (r + d - r cos(2πz/N) )² + (r sin(2πz/N) )²] dz

In order to solve the integral you can ignore the 1/4 in front for now.

\(\displaystyle \int_0^{π/N} \sqrt{(r+d-rcos(2πz/N))^2 + (r sin(2πz/N) )^2}dz\)

You need to show us what you get after cleaning up what is under the sqrt sign. You say, and might be right, that the integral looks horrendous but until you do some work you don't know this yet.
 
Thank you, Steven G and blamocur, for responding so quickly, and especially to Steven G for formatting the integral neatly..

I've attempted to simplify the portion under the square-root sign, and also have used y to stand for 2πz/N, and remembered that
cos²A + sin²A = 1, to get:

r² + d² + 2rd - 2r (r + d) cos y + 1 r²
= 2r² + d² + 2rd - 2r (r + d) cos y
= d² + [ 2r (r + d) ] ( 1 - cos y)

This is where I get a bit woolly, but I presume that, as I have used y = 2πz/N, then z = yN/2π, and so, if I change the 'dz' at the end to 'dy', I would need to alter the upper limit of integration (the lower limit would remain as 0). When z = π/N, y = 2π²/N².

Since r and d are constants as far as this stage of the fun is concerned, I suppose I can simplify the integrand some more.
Using G = 2 r (r + d) , gives the somewhat less (but still quite) scary

d² + G (1 - cos y).

To answer blamocur, I think [if I understand the terminology correctly] I will eventually look to plug numbers in to represent N, r and d, and hence get a simply numeric answer, but since at this stage I am only working with general N, r, d, I will need a formula (closed-form?) that relates these three numbers to 0.25 of the integral.
 
Last edited:
No! If z = yN/2π, taking the differential of both sides instead of just randomly saying that dy = dz, we get dz =N/()dz (does brackets are important)

Ignoring constants that can be factored out, you are left with:

\(\displaystyle \int \sqrt{d^2 + G(1-cosy)}dy\)

Unless I made a mistake, using the substitution u=1-cosy (which means cosy = 1-u => a triangle) will work.
 
Thank you once again, Steven G, for your helpful insights and your patience.

I am pleased to see that I was at least partly on the right lines, even if I made some mistakes along the way. Doubtless I will make some more as I ponder, below, on your hints.

so, if I put u = 1 - cos y into the part of the expression within the square root sign, I get d² + Gu

I need to change the dy to a du somehow, in order to integrate this, so I presume I proceed as follows:
u = 1 - cos y
differentiate each side with respect to y to get
du/dy = sin y
du = sin y dy
dy = csc u du [where csc u = cosecant u = 1/(sin u) ]

So my required result is now

0.25 x integral [ sqrt (d² + Gu) csc u du ] between some limits of u.

Next I have to work out those limits of integration for my definite integral.

The original ones were

z runs from 0 to π/N

I substituted y = 2πz/N so I suppose I next needed

y runs from 2π/N·0 to 2π/N·π/N =>
y runs from 0 to 2π²/N²

Then I substituted u = 1 - cos y suggesting

u runs from 1 - cos(0) to 1 - cos (2π²/N²) =>
u runs from 0 to 1 - cos (2π²/N²); alternatively
u runs from 0 to 2 sin² (π²/N²)

I am not sure how to proceed from here, though, or how to integrate the expression...
 
Draw the triangle that lives up to cosy = 1-u. Label all three sides in term of u.

du = sin y dy
dy = csc u du

Where did csc u come from! You can't write what you want. You can only write what you have. And yes I know that csc A = 1/sin A
 
Ooops - I meant to write:

du/dy = sin y
du = sin y dy
dy = csc y du

Hopefully this will work OK!

image_2022-11-02_165412907.png

By Pythagoras, 1 = sin²y + (1-u)² = (sin y)² + 1 - 2u + u²

(sin y)² = 2u - u²

This looks like it's going to get messy again ... but here goes:

sin y = sqrt (2u - u²)

csc y = 1 / sqrt (2u - u²) = (2u - u²) ^ (-½)

So the integral I need becomes:

0.25 x integral [ sqrt (d² + Gu) csc y du ] between those limits

= 0.25 x INTEGRAL [ sqrt (d² + Gu) · (2u - u²) ^ (-½) du ] btl

= 0.25 x INTEGRAL [ sqrt [(d² + Gu) / (2u - u²) ] du ] evaluated between u = 0 and u = 2 sin² (π²/N²)


Am I getting any warmer? I feel like I am getting further away!
 
Ooops - I meant to write:

du/dy = sin y
du = sin y dy
dy = csc y du

Hopefully this will work OK!

View attachment 34462
Where did siny come from in your triangle? Did you take into account that the hypotenuse is 1?
In the hypotenuse is v and one leg is w, then the other leg must be sqrt(v^2-w^2)

So the opposite side to angle y is sqrt(1^2 - (1-u)^2) = sqrt{(1 +(1-u))(1-(1-u))} = sqrt{u(2-u)}, which is what you said.

Yes, you are getting warmer. For now, just work on the integral and after solving that, you can work on the limits on your own.
 
Thanks once again.

I think I am getting lost, but ...

You suggested a substitution u=1-cos y, [which means cos y = 1-u ]

I then attempted to differentiate each side of " u=1-cos y " with respect to y, to get

du / dy = d (1) / dy - d (cos y) / dy

du / dy = 0 - (- sin y) = sin y

du = sin y dy

OR dy = ( 1 / sin y ) du = csc y du

So instead of writing dy at the end of my integral, I put csc y du

And then proceeded as per the diagram as before...

Sorry if I am being thick.
 
Thanks once again.

I think I am getting lost, but ...

You suggested a substitution u=1-cos y, [which means cos y = 1-u ]

I then attempted to differentiate each side of " u=1-cos y " with respect to y, to get

du / dy = d (1) / dy - d (cos y) / dy

du / dy = 0 - (- sin y) = sin y

du = sin y dy

OR dy = ( 1 / sin y ) du = csc y du

So instead of writing dy at the end of my integral, I put csc y du
... now use the triangle to write csc y in terms of u.
 
Ahh I see (maybe) ...

From the triangle above, (1 - u)² + sin²y = 1²
so sin²y = 1 - (1-u)² = 1 - (1 - 2u + u²) = 2u - u²
sin y = sqrt (2u - u²)
csc y = (2u - u²) ^ (-½)

But I feel that this has only brought me to the same place I was in my earlier message (the one with the triangle diagram)...
 
Top