4

In this answer to How is the average distance between 2 objects orbiting around a third object calculated? I had to integrate

$$\int_0^{2 \pi}\sqrt{(a-\cos \theta)^2 + \sin^2 \theta} \ d\theta.$$

I tried to find the integral analytically with Wolfram Alpha but it returned an error message:

Standard computation time exceeded...

which surprised me; I'd figured that this was known and easily looked-up by the site.

Does this mean that there is no known analytical form for this definite integral? Or for some reason is it particularly challenging?

Wolfram Alpha chokes on a simple definite integral

Blue
  • 75,673
uhoh
  • 1,864
  • 1
    The result is nasty! Assuming $a$ is real, we have $$\fbox{$2 \left(\sqrt{(a-1)^2} E\left(-\frac{4 a}{(a-1)^2}\right)+\sqrt{(a+1)^2} E\left(\frac{4 a}{(a+1)^2}\right)\right)\text{ if }\Re((a-2) a)>-1\land \Re(a (a+2))>-1$}$$ – Moo Jul 18 '20 at 13:57
  • 1
    If you need approximation formulae, let me know. – Claude Leibovici Jul 18 '20 at 13:58
  • @Moo "The result is nasty" is essentially the answer, thanks! ;-) – uhoh Jul 18 '20 at 14:12
  • 1
    @uhoh. The result is not nasty at all. – Claude Leibovici Jul 18 '20 at 14:34
  • @ClaudeLeibovici Yes of course. I am sure the result is actually quite beautiful. I think the better way to put it is that "It is a quite long calculation" and I'm looking for that being posted as the answer. – uhoh Jul 18 '20 at 15:15
  • 1
    https://www.wolframalpha.com/input/?i=integral+sqrt%28%28a-cos%28x%29%29%5E2+%2B+sin%28x%29%5E2%29+ gives the result immediately for the antiderivative. – Claude Leibovici Jul 18 '20 at 15:24
  • @ClaudeLeibovici nice! Perhaps this case was borderline and asking for the definite integral just pushed it over the edge. Next time this happens to me (if it ever does) I'll try that, thanks! – uhoh Jul 18 '20 at 15:34

1 Answers1

5

It is not an error message but just "Standard computation time exceeded".

What you should have obtained is $$I=\int_0^{2 \pi}\sqrt{(a-\cos (\theta))^2 + \sin^2 (\theta)} \ d\theta=$$ $$I=2 \left(\sqrt{(a-1)^2} E\left(-\frac{4 a}{(a-1)^2}\right)+\sqrt{(a+1)^2} E\left(\frac{4 a}{(a+1)^2}\right)\right)$$ provided, if $a$ is a real, that $$\Re(a (a+2))>-1\land \Re((a-2) a)>-1$$ where appear ellptic integrals of the second kind. In fact, this reduces to $$I=4(a+1)E\left(\frac{4 a}{(a+1)^2}\right)$$