0
$\begingroup$

I wanted to verify the integral $\int\limits_0^{2\pi}\frac{d\phi}{(a^2+b^2)+(a^2-b^2)\cos(n\phi)}=\frac{\pi}{ab}$ (where $b>a>0$ and $n$ is a positive integer).

Individual values of $n$ work:

$Assumptions = {b > a > 0};

Integrate[1/((a^2 + b^2) + (a^2 - b^2) Cos[x]), {x, 0, 2Pi}]
*** Pi/(ab) *** 

Integrate[1/((a^2 + b^2) + (a^2 - b^2) Cos[2 x]), {x, 0, 2Pi}]
*** Pi/(ab) *** 

Integrate[1/((a^2 + b^2) + (a^2 - b^2) Cos[3 x]), {x, 0, 2Pi}]
*** Pi/(ab) ***

and so on.

But then, when I want to solve it for general $n$, I get:

$Assumptions = {b > a > 0, n \[Element] Integers, n >= 1};

Integrate[1/((a^2 + b^2) + (a^2 - b^2) Cos[n x]), {x, 0, 2 Pi}]]
*** Pi/(abn) ***

What is going on? (I'm using 11.0.1.0 on OSX.)

$\endgroup$
8
  • 1
    $\begingroup$ Please don't use the bugs tag when asking new questions (see tag description). $\endgroup$
    – Szabolcs
    Commented Aug 2, 2017 at 18:25
  • 3
    $\begingroup$ When I did Block[{$Assumptions = {b > a > 0, n \[Element] Integers, n >= 1}} , Integrate[1/((a^2 + b^2) + (a^2 - b^2) Cos[n x]), {x, 0, 2 Pi}]], I got 0. (v10.0 on Mac OSX). $\endgroup$
    – march
    Commented Aug 2, 2017 at 18:41
  • 3
    $\begingroup$ Even without Block I get zero for v 11.1.1 on Windows 10. $\endgroup$
    – bbgodfrey
    Commented Aug 2, 2017 at 18:48
  • 2
    $\begingroup$ Furthermore, Integrate[1/((a^2 + b^2) + (a^2 - b^2) Cos[n x]), {x, 0, 2 Pi}, Assumptions -> {a ∈ Reals, b ∈ Reals, n ∈ Integers, n >= 1}], followed by FullSimplify[%, {b > a > 0, n ∈ Integers, n >= 1}]` gives π/(a b n), not 0. Also, GenerateConditions -> True doesn't. Looks like a bug to me. $\endgroup$
    – bbgodfrey
    Commented Aug 2, 2017 at 19:04
  • 1
    $\begingroup$ Bug still present in MMA 11.2.0 $\endgroup$
    – user58955
    Commented Sep 19, 2017 at 14:56

1 Answer 1

5
$\begingroup$

There are similar integrals with bugs, some of which have been fixed, such as Suspected bug in Integrate.

It seems that the branch cuts in the antiderivative are ignored, the antiderivative containing an ArcTan:

Integrate[1/((a^2 + b^2) + (a^2 - b^2) Cos[n x]), x]
(*  ArcTan[(b Tan[(n x)/2])/a]/(a b n)  *)

One way to get the desired result is to integrate over just one period and multiply:

n*Integrate[1/((a^2 + b^2) + (a^2 - b^2) Cos[n x]), {x, 0, 2 Pi/n}, 
  Assumptions -> {b > a > 0, n ∈ Integers, n >= 1}]
(*  π/(a b)  *)

It should be reported to WRI, so that they might try to fix it.

$\endgroup$
1
  • 2
    $\begingroup$ It's quite difficult to figure out or in other ways work with parametrized branch cuts. I would be surprised if this can be improved any time soon. $\endgroup$ Commented Aug 2, 2017 at 22:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.