I need integral result for following integral: $$\int_{0}^{2\pi}\frac{d \theta }{\sqrt{1-k^{2}\cos( \theta )}}$$
It will be useful in an electromagnetic simulator. It is obtained as the medium 1/distance from one ring to a point that is separated to the axis. Actually due the objects where split in a 3-d mesh of 24k pieces so to solve the problem its takes 3 hours due inverse of 24k x 24k arrays (that reach the 16GB limit of RAM).
I have look for at definite integral tables but was not found It would help an APPROXIMATE solution that reduces the 3-D problem to 2D. It is said it is a first kind elliptic integral, but I do not know how to place in an elliptic expression and what lib can be used with C++. Boost is included in actual C++11 but I do not know if the elliptic integral lib is included in it
The response is: $$\displaystyle\int_{0}^{2\pi}\frac{d \theta }{\sqrt{1-k^{2}\cos( \theta )}}=2\displaystyle\int_{0}^{\pi}\frac{d \theta }{\sqrt{1-k^{2}\cos( \theta )}}$$
$$\displaystyle\int_{0}^{\pi/2}\frac{dt }{\sqrt{1-k^{2}\cos(2t)}}=4\displaystyle\int_{0}^{\pi/2}\frac{dt }{\sqrt{1-k^{2}(1-2sin^2(t))}}=4\displaystyle\int_{0}^{\pi/2}\frac{dt }{\sqrt{(1-k^{2})+2k^2sin^2(t)}}$$ That is an elliptic integral of the first order.
Result can be found here: Forum math
Where $$\theta=2t$$
I used boost and worked. Elliptic integrals are included in in C++17, so it is not needed install boost: