I need to evaluate $$ \int_0^{2\pi} \! d\theta \, \log\left(\sqrt{r^2 + s^2 -2rs\cos(\theta)} \right) $$ i.e. the log of the length of the third side of a triangle ($r$ and $s$ being the lengths of the first two sides), integrated over angle.
This is a bit reminiscent of some kind of elliptic integral, but I've never seen one with a log as its argument (I don't know much about elliptic integrals though).
Mathematica gives me the answer $$ -\pi \log\left(\frac{2}{r^2 + s^2 + |r^2 - s^2|}\right) $$ with conditions $r\neq0$ or $s\neq0$.
I would like to to find this analytically if I can for a number of reasons, e.g.
- Mathematica weirdly doesn't give me this answer 100% of the time,
- if I ask for the indefinite integral I get a massive expression in the complex numbers (which I've asked about over on Mathematica stack exchange: https://mathematica.stackexchange.com/questions/270314/integrate-ignoring-assumptions) so I want to understand how it reduces to such a simple expression,
- I next need to integrate this against some functions of $r$ and $s$, so the more insight into the $\theta$ integral I have the better.
I'm not sure where to start tackling this analytically though. Can anyone point me in the right direction?