The problem is very similar to that of [1] How to compute the integral of trigonometic function with multiple angle
Hence we don't repeat what we have discussed there but both answers should be read as complementary.
Let us focus here on the question of convergence of the integral.
The integrand is
g2[m_, x_] := Cos[(4 m + 2) x] Cos[(4 m + 1) x]*1/Cos[x];
The interesting values of x
are those at which the Cos[x]
becomes zero, i.e. at x = -π/2
and x = + π/2
.
A series expansion about these points gives
Normal[Series[g2[m, x], {x, π/2, 0}]]
(* Out[184]= -Cos[2 m π]^2 - 4 m Cos[2 m π]^2 - (
Cos[2 m π] Sin[2 m π])/(-(π/2) + x) + 2 Sin[2 m π]^2 +
4 m Sin[2 m π]^2 *)
For better visibility in LaTeX:
$$-\frac{\sin (2 \pi m) \cos (2 \pi m)}{x-\frac{\pi }{2}}+4 m \sin ^2(2 \pi m)+2 \sin ^2(2 \pi m)-4 m \cos ^2(2 \pi m)-\cos ^2(2 \pi m)$$
and
Normal[Series[g2[m, x], {x, -π/2, 0}]]
(* Out[185]= -Cos[2 m π]^2 - 4 m Cos[2 m π]^2 + (
Cos[2 m π] Sin[2 m π])/(π/2 + x) + 2 Sin[2 m π]^2 +
4 m Sin[2 m π]^2 *)
LaTeX:
$$\frac{\sin (2 \pi m) \cos (2 \pi m)}{x+\frac{\pi }{2}}+4 m \sin ^2(2 \pi m)+2 \sin ^2(2 \pi m)-4 m \cos ^2(2 \pi m)-\cos ^2(2 \pi m)$$
These expressions remain finite if the numerator
num2 = Cos[2 m π] Sin[2 m π];
of the pole is zero.
This means
Simplify[num2]
(* Out[187]= 1/2 Sin[4 m π] *)
Reduce[% == 0, m] /. C[1] -> n
(* Out[188]= n ∈ Integers && (m == n/2 || m == (π + 2 n π)/(4 π)) *)
Which means that m
must be of the form m = n/4
with n
integer.
The integral of the OP is
f2[m_] := Integrate[g2[m, x], {x, -π, π}]
The first few values are
Table[{m/4, f2[m/4]}, {m, -5, 5}]
(* Out[195]= {{-(5/4), 0}, {-1, 2 π}, {-(3/4), 0}, {-(1/2), 2 π}, {-(1/4),
2 π}, {0, 0}, {1/4, 2 π}, {1/2, 0}, {3/4, 2 π}, {1, 0}, {5/4,
2 π}} *)
For values of m
which are not integer multiples of 1/4 the integral is divergent.
For the OP [1] the convergence condition is m = n/2
, n
integer.
Assumptions
/Assuming
posts that have come up in past, nd also with theAssumptions->Element[something,Integers]
posts. But I see now that this also involves a singularity that the assumptions will not appropriately handle, so there are subtleties. And of course a memory exception is not an anticipated outcome here. (I have not seen that result yet, because my evaluation has been running for minutes with no outcome yet). $\endgroup$ – Daniel Lichtblau Sep 26 '16 at 22:04