I have a question in relation to this previous question:
I understand the answer and its derivation, however, I do not understand the starting point of:
$$ E(d) = \frac{1}{2 \pi} \int_{0}^{2\pi} \sqrt{r^{2} + R^{2} + 2 r R \cos \phi} \ \mathrm{d} \phi\ . $$
To my understanding, the formula should start with the law of cosines, which states: $c^2 = a^2 + b^2 − 2ab\cos(C)$ and (in this context) would translate into:
$$d^2 = r^{2} + R^{2} - 2 r R \cos \phi$$
putting this into an integral yields:
$$ E(d) = \frac{1}{2 \pi} \int_{0}^{2\pi} \sqrt{r^{2} + R^{2} - 2 r R \cos \phi} \ \mathrm{d} \phi\ . $$
The difference is that in one case $2 r R \cos \phi$ is added and in the other substacted.
Can you tell me where the difference comes from?
The difference comes whether you start with B for external closing side of triangle or B for internal closing side. But it doesn't matter when taking the average.
In one case you are measuring your d's from A to B, and from B to A in the other, for same sense of angle rotation $\phi$.
Since all distances are positive it does not matter in grouping or summing i.e., whether you are considering $d's$ from maximum $R+r$ to minimum $R-r$ or from minimum $R-r$ to maximum $R+r.$ The evaluated definite integral has the same value.