How to calculate this integral $\int_{0}^{2\pi}\sqrt{1+\pi^2-2\pi\cos t}dt$ Calculate integral
$$\int_{0}^{2\pi}\sqrt{1+\pi^2-2\pi\cos t}\, dt$$
 A: $$ I = \int_{-\pi}^{+\pi}\sqrt{\pi-e^{i\theta}}\sqrt{\pi-e^{-i\theta}}\,d\theta $$
is a complete elliptic integral of the second kind. By expanding $\sqrt{\pi-z}$ as a Taylor series and exploting $\int_{-\pi}^{\pi}e^{ki\theta}\,d\theta = 2\pi \delta(k)$ we have that $I$ can be represented by the following fast-converging series:
$$ I = 2\pi^2\sum_{n\geq 0}\binom{\frac{1}{2}}{n}^2\frac{1}{\pi^{2n}}=\color{red}{2\pi^2\sum_{n\geq 0}\binom{2n}{n}^2\frac{1}{(2n-1)^2(16\pi^2)^n}}. $$
In a similar way, by setting $\kappa=\frac{2\pi}{1+\pi^2}$ and computing $\int_{-\pi}^{\pi}\cos^{2n}(\theta)\,d\theta$, we get the equivalent representation:
$$ I = \color{red}{2\pi\sqrt{\pi^2+1}\sum_{n\geq 0}\binom{4n}{n,n,2n}\frac{\kappa^{2n}}{(1-4n)64^n}}.$$
A: $\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

Thanks to the $\texttt{@tired}$ suggestion in an above comment:

\begin{align}
&\color{#f00}{\int_{0}^{2\pi}\root{1 + \pi^{2} - 2\pi\cos\pars{t}}\,\,\dd t}
\,\,\,\stackrel{t\ \mapsto\ t + \pi}{=}\,\,\,
\int_{-\pi}^{\pi}\root{1 + \pi^{2} + 2\pi\cos\pars{t}}\,\,\dd t
\\[5mm] = &\
2\int_{0}^{\pi}\root{1 + \pi^{2} + 2\pi\cos\pars{t}}\,\,\dd t\qquad
\pars{~\mbox{because the integrand is an}\ even\ function~}
\\[5mm] = &\
2\int_{0}^{\pi}
\root{1 + \pi^{2} + 2\pi\bracks{1 - 2\sin^{2}\pars{t \over 2}}}\,\,\dd t =
2\int_{0}^{\pi}
\root{\pars{1 + \pi}^{2} - 4\pi\sin^{2}\pars{t \over 2}}\,\,\dd t
\\[5mm] \stackrel{t/2\ \mapsto\ t}{=}\,\,\,&\
4\pars{1 + \pi}\int_{0}^{\pi/2}
\root{1 -\bracks{2\root{\pi} \over \pi + 1}^{2}\sin^{2}\pars{t}}\,\,\dd t =
\color{#f00}{4\pars{1 + \pi}\,\mrm{E}\pars{2\root{\pi} \over \pi + 1}}
\end{align}

$\ds{E}$ is a Complete Elliptic Integral of the Second Kind.

