# integral $C(a,b)=\int_0^{2\pi}\frac{xdx}{a+b\cos^2 x}$

I am looking for other methods to find the general integral $$C(a,b)=\int_0^{2\pi}\frac{xdx}{a+b\cos^2x}$$ To do so, I first preformed $$u=x-\pi$$: $$C(a,b)=\int_{-\pi}^{\pi}\frac{xdx}{a+b\cos^2x}+\pi\int_{-\pi}^{\pi}\frac{dx}{a+b\cos^2x}$$ The sub $$x\mapsto -x$$ provides $$\int_{-\pi}^\pi \frac{xdx}{a+b\cos^2x}=0$$ and with symmetry, $$C(a,b)=2\pi\int_0^\pi \frac{dx}{a+b\cos^2x}$$ Then we use $$t=\tan(x/2)$$: $$C(a,b)=4\pi\int_0^\infty \frac1{a+b\left[\frac{t^2-1}{t^2+1}\right]^2}\frac{dt}{t^2+1}$$ $$C(a,b)=\frac{4\pi}{a+b}\int_0^\infty \frac{x^2+1}{x^4+2\frac{a-b}{a+b}x^2+1}dx$$ Then we consider $$N_s(k)=\int_0^\infty\frac{x^{2s}}{x^4+2kx^2+1}dx$$ Then $$x\mapsto 1/x$$ gives $$N_s(k)=N_{1-s}(k)$$ and with $$s=0$$: $$C(a,b)=\frac{8\pi}{a+b}\int_0^\infty \frac{dx}{x^4+2kx^2+1}\qquad k=\frac{a-b}{a+b}$$ Then with $$x^4+(2-c^2)x^2+1=(x^2+cx+1)(x^2-cx+1)$$ we have that \begin{align} u(c)=N_0\left(\frac{2-c^2}2\right)=&\frac1{4c}\int_0^\infty\frac{2x+c}{x^2+cx+1}dx-\frac1{4c}\int_0^\infty\frac{2x-c}{x^2-cx+1}dx\\ &+\frac14\int_0^\infty\frac{dx}{x^2+cx+1}+\frac14\int_0^\infty\frac{dx}{x^2-cx+1} \end{align} The first two integrals vanish and we have $$u(c)=\frac14I(1,c,1)+\frac14I(1,-c,1)$$ where $$I(a,b,c)=\int_0^\infty\frac{dx}{ax^2+bx+c}=\frac2{\sqrt{4ac-b^2}}\left[\frac\pi2-\arctan\frac{b}{\sqrt{4ac-b^2}}\right]$$ So $$4u(c)=\frac2{\sqrt{4-c^2}}\left[\frac\pi2-\arctan\frac{c}{\sqrt{4-c^2}}+\frac\pi2-\arctan\frac{-c}{\sqrt{4-c^2}}\right]$$ $$u(c)=\frac{\pi}{2\sqrt{4-c^2}}$$ $$N_0(a)=\frac\pi{2\sqrt{2+2a}}$$ And then $$C(a,b)=\frac{8\pi}{a+b}N_0\left(\frac{a-b}{a+b}\right)$$ $$C(a,b)=\frac{4\pi^2}{\sqrt{a^2+ab}}$$ How else can you prove this? Have fun ;)

As it turns out, we may be missing a factor of $$1/2$$, so we may actually have $$C(a,b)=\frac{2\pi^2}{\sqrt{a^2+ab}}$$ an issue discussed in the comment section of @Song's answer.

Note that $$\cos^2(x)=\frac{1+\cos(2x)}{2}$$. Therefore,

\begin{align} C(a,b)&=2\pi\int_0^\pi \frac1{a+b\cos^2(x)}\,dx\\\\ &=2\pi \int_0^\pi \frac{2}{2a+b+b\cos(2x)}\,dx\\\\ &=2\pi \int_0^{2\pi}\frac{1}{2a+b+b\cos(x)}\,dx\tag1\\\\ &=4\pi \int_0^\pi \frac{1}{2a+b+b\cos(x)}\,dx\tag2 \end{align}

We can proceed by either (i) letting $$z=e^{ix}$$ in $$(1)$$ and using contour integration or (ii) letting $$t=\tan(x/2)$$ in $$(2)$$.

METHODOLOGY $$1$$: CONTOUR INTEGRATION

Letting $$z=e^{ix}$$ in $$(1)$$ reveals

\begin{align} C(a,b)&=2\pi \oint_{|z|=1} \frac{1}{2a+b +b\left(\frac{z+z^{-1}}{2}\right)}\,\frac1{iz}\,dz\\\\ &=\frac{4\pi}{ib}\oint_{|z|=1}\frac{1}{z^2+2(1+2a/b)z+1}\,dz\\\\ &=2\pi i \left(\frac{4\pi}{ib}\right)\text{Res}\left(\frac{1}{z^2+2(1+2a/b)z+1}, z=-(1+2a/b)+\frac2b\,\sqrt{a(a+b)}\right) \\\\ &=\frac{8\pi^2}{b}\left(\frac{1}{4\frac{\sqrt{a(a+b)}}{b}}\right)\\\\ &=\frac{2\pi^2}{\sqrt{a(a+b)}} \end{align}

METHODOLOGY $$2$$: Tangent Half-Angle Substitution

Letting $$t=\tan(x/2)$$ in $$(2)$$, we obtain

\begin{align} C(a,b)&=4\pi \int_0^\pi \frac{1}{2a+b+b\cos(x)}\,dx\\\\ &=4\pi \int_0^\infty \frac{1}{2a+b+b\frac{1-t^2}{1+t^2}}\,\frac{2}{1+t^2}\,dt\\\\ &=\frac{4\pi}{ a}\int_0^\infty \frac{1}{t^2+(1+b/a)}\,dt\\\\ &=\frac{4\pi}{a}\frac{\pi/2}{\sqrt{1+b/a}}\\\\ &=\frac{2\pi^2}{\sqrt{a(a+b)}} \end{align}

• Nice! I am really looking forward to learning complex analysis... – clathratus Mar 20 at 3:23
• Thank you! I've added a second methodology that uses the tangent half-angle substitution. – Mark Viola Mar 20 at 3:45
• I love your answer. The tangent-half angle bit was very easy to follow. I do appreciate the complex analysis because it gives me something I look forward to learning. You've given me two really nice methods: thank you. – clathratus Mar 20 at 19:40
• Pleased to hear. – Mark Viola Mar 20 at 20:04
• I have already upvoted your answer. I am going to wait for more answers to accumulate before I accept any. – clathratus Mar 20 at 20:06

By making change of variable $$u=2\pi -x$$, we have \begin{align*} C(a,b)&=\int_0^{2\pi}\frac{2\pi -u}{a+b\cos^2 u}du=\int_0^{2\pi}\frac{2\pi}{a+b\cos^2 u}du-C(a,b), \end{align*} hence $$\displaystyle C(a,b)=\pi\int_0^{2\pi}\frac{1}{a+b\cos^2 u}du$$. On the other hand, we find that \begin{align*} \int_0^{2\pi}\frac{1}{a+b\cos^2 u}du&=4\int_0^{\frac\pi 2}\frac{1}{a\sin^2 u+(b+1)\cos^2 u}du \\&=4\int_0^{\frac\pi 2}\frac{1}{a\tan^2 u+b+1}\sec^2 u\ du \\&=4\int_0^\infty \frac{dv}{av^2+(b+1)}\tag{v=\tan u} \\&=\frac{4}{\sqrt{a^2+ab}}\left[\arctan\left(\frac{\sqrt{a}v}{\sqrt{b+1}}\right)\right]^\infty_0\\&=\frac{2\pi}{\sqrt{a^2+ab}}. \end{align*} This gives $$C(a,b)=\frac{2\pi^2}{\sqrt{a^2+ab}}.$$ (I guess $$2\pi^2$$ is the right constant since this gives the right result $$2\pi^2$$ when $$a=1,b=0$$.)

• Woah! Quick and easy! +1 – clathratus Mar 20 at 2:57
• Thank you :) Sorry that I couldn't read your solution thoroughly since I have to work on other things... – Song Mar 20 at 2:59
• Hmm... According to this, neither of us are right... – clathratus Mar 20 at 3:01
• @clathratus Ah, I find it. There was a typo in the third formula of this. – Song Mar 20 at 3:10
• So $$C(a,b)=\frac{2\pi^2}{\sqrt{a^2+ab}}$$ – clathratus Mar 20 at 3:15

Putting $$t = 2\pi - x$$ we get $$C(a, b) = \int_{0}^{2\pi}\frac{2\pi - t}{a+b\cos^2t}\,dt= 2\pi\int_{0}^{2\pi}\frac{dt}{a + b\cos^2t} - C(a, b)$$ so that $$C(a, b) = \pi\int_{0}^{2\pi}\frac{dx}{a+b\cos^2x}$$ Since the integrand satisfies equation $$f(2\pi - x) = f(x)$$ it follows that $$C(a, b)=2\pi\int_{0}^{\pi}\frac{dx}{a+b\cos^2x}$$ and using the same argument again we get $$C(a,b)=4\pi\int_{0}^{\pi/2}\frac{dx}{a+b\cos^2x}=8\pi\int_{0}^{\pi/2}\frac{dx}{2a+b+b\cos 2x}$$ Putting $$2x=t$$ we get $$C(a, b) = 4\pi\int_{0}^{\pi}\frac{dt}{2a+b + b\cos t}=\frac{4\pi^2}{\sqrt{(2a+b)^2-b^2}}=\frac{2\pi^2}{\sqrt{a^2+ab}}$$ where we have used the standard integral formula $$\int_{0}^{\pi}\frac{dx}{A+B\cos x}=\frac{\pi}{\sqrt{A^2-B^2}}, A>|B|$$ which can be proved using the substitution $$(A + B\cos x)(A - B\cos t) = A^2-B^2$$