I have a large function $F(\theta,\alpha_1,\alpha_2,...)$ which involves only trigonometric polynomial of these angles. I want to calculate $\frac{1}{2\pi}\int_0^{2\pi} Fd\theta$, but the function is too large so it takes a long time. But if I use TrigReduce on $F$, it is obvious that the terms independent of $\theta$ (in the result of TrigReduce) are exactlly the results I desire since the integration of other terms naturally vanish. How can I sort out these terms directly from the result to avoid the integration that takes a long time?

  • $\begingroup$ Welcome to the Mathematica Stack Exchange. Please include a sample expression so that respondents can work with it. Thanks. $\endgroup$
    – Syed
    Commented Mar 14, 2022 at 9:49
  • $\begingroup$ Did you try a MemberQ function? $\endgroup$ Commented Mar 14, 2022 at 12:20
  • $\begingroup$ Collect also might work, depending on the details of the expression.. $\endgroup$
    – bbgodfrey
    Commented Mar 14, 2022 at 13:46


Browse other questions tagged or ask your own question.