# Analytic result for the given integral

I want to calculate analytically this integral

$$\int_{0}^{\pi} (F-G) \,dy ,$$

where the functions $$F$$ and $$G$$ are given in the code below. The parameter $$c$$ is a constant which varies from $$-1$$ to $$1$$.

F := ArcSec[2/Sqrt[ 2 +c-c Cos[y] -2Sqrt[2] Sqrt[Cos[y/2]^6 (2-c^2+c^2  Cos[y])]/(1+Cos[y])]] ;
G := ArcSec[2/Sqrt[ 2 +c+c Cos[y] +Sqrt[2] Csc[y/2]^2  Sqrt[Sin[y/2]^6 (2-c^2-c^2  Cos[y])]]] ;

Integrate[  F-G  ,    {y, 0, Pi}  ]


Using  NIntegrate, I see that the result is the same for all values of $$-1.

I used Mathematica online version to check this, but it has a time limit, so, I cannot check if there is an analytical result for this integral. May someone please check this for me?

In general, how can I prove that this integral is independent of $$c$$?

• What are the F and G come from? Maybe the original problem can be sove directly. Commented Aug 16, 2021 at 15:02

The solution is Pi^2/4 for all c.

F = ArcSec[2/Sqrt[2 + c - c Cos[y] -
2 Sqrt[2] Sqrt[Cos[y/2]^6 (2 - c^2 + c^2 Cos[y])]/(1 + Cos[y])]];

G = ArcSec[2/Sqrt[2 + c + c Cos[y] +
Sqrt[2] Csc[y/2]^2 Sqrt[Sin[y/2]^6 (2 - c^2 - c^2 Cos[y])]]];

FmG[y_, c_] = F - G // ExpandAll // Together //
FullSimplify[#, {0 < y < Pi, -1 < c < 1}] &;


Now do series expansion around c==0 and show all higher terms are zero. I use NSeries since it is faster. May be you can try an exact anlytical proof.

(serco = Table[{j,
SeriesCoefficient[F - G, {c, 0, j}] //
Simplify[#, 0 < y < Pi] &}, {j, 0, 3}])

(*   {{0, ArcCos[Sin[y/4]] - ArcCos[Sqrt[1 + Sin[y/2]]/Sqrt[2]]}, {1,
1/2 (Cos[y/2] - Sin[y/2])}, {2, 0}, {3,
1/12 (Cos[y/2]^3 - Sin[y/2]^3)}}   *)

Integrate[#, {y, 0, Pi}] & /@ serco

(*   {{0, \[Pi]^2/4}, {\[Pi], 0}, {2 \[Pi], 0}, {3 \[Pi], 0}}   *)

Needs["NumericalCalculus"]
nint[c_?NumericQ] := NIntegrate[FmG[y, c], {y, 0, Pi}]

{Pi^2/4 // N,
NSeries[nint[c], {c, 0, 20}] // Normal // Chop[#, 10^-9] &}

(*   {2.4674, 2.4674}   *)
`