Evaluate and explain $\int_{0}^{\frac{\pi}{2}}\arccos\left(\frac{\cos x}{\left(1+2\cos x\right)}\right)dx$ $$\int_{0}^{\frac{\pi}{2}}\arccos\left(\frac{\cos x}{1+2\cos x}\right)dx$$
I found this integral on a math discord server. I was unable to apply any standard integration technique to solve it (I am just an advanced high school student so my experience is limited). What methods can I apply to solve such an integral?
The expression does not seem to have an analytical solution.
graph of the function
 A: As @K.defaoite notes, this is Coxeter's integral, equal to $5\pi^2/24$. The usual way (see Inside Interesting Integrals Secs. 6.2 and 6.3, where this takes Nahin just over 11 pages) to evaluate it (whose details I've half-provided as they're worth working through to appreciate how hard this is!) is to prove it's four times Ahmed's integral $A(1)$ where $A(u):=\int_0^1\tfrac{\arctan\left(u\sqrt{2+x^2}\right)}{(1+x^2)\sqrt{2+x^2}}dx$, so$$A(\infty)=\left[\tfrac{\pi}{2}\arctan\tfrac{x}{\sqrt{2+x^2}}\right]_0^1=\tfrac{\pi^2}{12}$$and$$A^\prime=\tfrac{1}{1+u^2}\left[\arctan x-\tfrac{u}{\sqrt{1+2u^2}}\arctan\tfrac{xu}{\sqrt{1+2u^2}}\right]_0^1$$so$$A(\infty)-A(1)=\tfrac{\pi^2}{16}-\int_1^\infty\tfrac{u}{(1+u^2)\sqrt{1+2u^2}}\arctan\tfrac{u}{\sqrt{1+2u^2}}du.$$With $u\mapsto1/u$, this simplifies to$$A(\infty)-A(1)=\tfrac{\pi^2}{16}-A(\infty)+A(1)\implies A(1)=\tfrac{5\pi^2}{96}.$$Now call your integral $C$ so, with some trigonometric identities,$$C=\int_0^{\pi/2}2\arctan\sqrt{\tfrac{1+\cos x}{1+3\cos x}}dx\stackrel{y=\tfrac{x}{2}}{=}4\int_0^{\pi/4}\arctan\tfrac{\cos y}{\sqrt{2-3\sin^2y}}dy.$$Since $\arctan b=\int_0^1\tfrac{bdt}{1+b^2t^2}$,$$C=\int_0^{\pi/4}\int_0^1\tfrac{4\cos y\sqrt{2-3\sin^2y}}{t^2+2-(t^2+3)\sin^2y}dtdy.$$With $\sin y=\sqrt{\tfrac23}\sin w$ followed by $s=\tan w$ (who'd guess that?),$$C=\int_0^{\sqrt{3}}\int_0^1\tfrac{8\sqrt{3}dtds}{(1+s^2)(t^2s^2+3t^2+6)},$$which simplifies by partial fractions to$$C=\tfrac{2\pi^2}{9}-4\int_0^1\tfrac{t\arctan\tfrac{t}{\sqrt{t^2+2}}}{(t^2+3)\sqrt{t^2+2}}dt.$$With $u=\arctan\tfrac{t}{\sqrt{t^2+2}}$, this becomes $C=4A(1)$, as desired.
A: Just a welcoming gift to you and a New Year present.
As you wrote, I do not think that an antiderivative exists. So, you are left with numerical integration or approximations.
The plot of the integrand is quite nice (looking more or less like a parabola). So, why not compose Taylor series and integrate termwise ?
Composing
$$\cos(x)=1-\frac{x^2}{2}+\frac{x^4}{24}-\frac{x^6}{720}+O\left(x^{8}\right)$$
$$\frac{\cos (x)}{2 \cos (x)+1}=\frac{1}{3}-\frac{x^2}{18}-\frac{x^4}{72}-\frac{7 x^6}{2160}+O\left(x^{8}\right)$$
$$\cos ^{-1}\left(\frac{\cos (x)}{2 \cos (x)+1}\right)=\cos ^{-1}\left(\frac{1}{3}\right)+\frac{x^2}{12 \sqrt{2}}+\frac{23
   x^4}{1152 \sqrt{2}}+\frac{3727 x^6}{829440 \sqrt{2}}+O\left(x^{8}\right)$$
If you integrate termwise the above truncated series, you will get something $\sim 2.047$ while numerical integration would give $2.056$. Add as many terms as you can to improve accuracy.
Edit
What is amazing is that, using this $1,400$ years old approximation
$$\cos(x) \simeq\frac{\pi ^2-4x^2}{\pi ^2+x^2}\qquad \text{for} \qquad -\frac \pi 2 \leq x\leq\frac \pi 2$$ there is an antiderivative for
$$\int \cos ^{-1}\left(\frac{\pi ^2-4 x^2}{3 \pi ^2-7 x^2}\right)\,dx$$ The result is given in terms of an elliptic integral  of the first kind and a complete elliptic integral of the third kind.
For the integral, the result is
$$\frac{\pi}{84}   \left(21 \pi +20 \sqrt{3} \left(F\left(\csc
   ^{-1}\left( \sqrt{\frac{8}{3}}\right)|\frac{11}{6}\right)+\Pi
   \left(\frac{14}{9};-\csc ^{-1}\left(
   \sqrt{\frac{8}{3}}\right)|\frac{11}{6}\right)\right)\right)$$ which, numerically is $2.056016$ while numerical integration gives                 $2.056168$
