Trigonometric Integrals

Work in progress. This note is still being written and incomplete.

Real integrals of the form

∫02πF(cos⁡θ,sin⁡θ) dθ\int_0^{2\pi} F(\cos\theta, \sin\theta)\,\text{d}\theta

can be evaluated using residues. Here FF is a rational function of cos⁡θ\cos\theta and sin⁡θ\sin\theta with no poles on the unit circle after the substitution below.

Substitution

Let

z=eiθ=cos⁡θ+isin⁡θ,0≤θ≤2πz = e^{i\theta} = \cos\theta + i\sin\theta, \quad 0 \le \theta \le 2\pi

Then zz moves once counterclockwise around the unit circle ∣z∣=1|z| = 1, and

cos⁡θ=12(z+1z),sin⁡θ=12i(z−1z),dθ=dziz\cos\theta = \frac{1}{2}\left(z + \frac{1}{z}\right), \quad \sin\theta = \frac{1}{2i}\left(z - \frac{1}{z}\right), \quad \text{d}\theta = \frac{\text{d}z}{iz}

Thus

∫02πF(cos⁡θ,sin⁡θ) dθ=∮∣z∣=1F(12(z+1z),12i(z−1z))dziz\int_0^{2\pi} F(\cos\theta, \sin\theta)\,\text{d}\theta = \oint_{|z|=1} F\left(\frac{1}{2}\left(z + \frac{1}{z}\right), \frac{1}{2i}\left(z - \frac{1}{z}\right)\right) \frac{\text{d}z}{iz}

The right side equals 2πi2\pi i times the sum of the residues of the integrand at its poles inside the unit circle.

Examples:

  • ∫02πdθ1+3cos⁡2θ=π\int_0^{2\pi} \frac{\text{d}\theta}{1 + 3\cos^2\theta} = \pi
  • ∫02πcos⁡2θ5−4cos⁡θ dθ=π6\int_0^{2\pi} \frac{\cos 2\theta}{5 - 4\cos\theta}\,\text{d}\theta = \frac{\pi}{6}

Worked Examples

Even Integrand

Show that ∫02πdθ1+3cos⁡2θ=π\int_0^{2\pi} \frac{\text{d}\theta}{1 + 3\cos^2\theta} = \pi.

Substitute cos⁡2θ=14(z+1z)2=z4+2z2+14z2\cos^2\theta = \frac{1}{4}\left(z + \frac{1}{z}\right)^2 = \frac{z^4 + 2z^2 + 1}{4z^2}.

1+3cos⁡2θ=3z4+10z2+34z2=(3z2+1)(z2+3)4z21 + 3\cos^2\theta = \frac{3z^4 + 10z^2 + 3}{4z^2} = \frac{(3z^2+1)(z^2+3)}{4z^2} ∫02πdθ1+3cos⁡2θ=∮∣z∣=14z2(3z2+1)(z2+3)⋅dziz=∮∣z∣=14zi(3z2+1)(z2+3) dz\int_0^{2\pi} \frac{\text{d}\theta}{1 + 3\cos^2\theta} = \oint_{|z|=1} \frac{4z^2}{(3z^2+1)(z^2+3)} \cdot \frac{\text{d}z}{iz} = \oint_{|z|=1} \frac{4z}{i(3z^2+1)(z^2+3)}\,\text{d}z

The poles are z=±i3z = \pm \frac{i}{\sqrt{3}} and z=±i3z = \pm i\sqrt{3}. Only ±i3\pm \frac{i}{\sqrt{3}} lie inside the unit circle.

For z0=±i3z_0 = \pm \frac{i}{\sqrt{3}}, the factor 3z2+13z^2 + 1 has derivative 6z6z, so

Res=4z0i⋅6z0⋅(z02+3)=46i⋅83=14i\text{Res} = \frac{4z_0}{i \cdot 6z_0 \cdot (z_0^2 + 3)} = \frac{4}{6i \cdot \frac{8}{3}} = \frac{1}{4i} ∫02πdθ1+3cos⁡2θ=2πi(14i+14i)=π\int_0^{2\pi} \frac{\text{d}\theta}{1 + 3\cos^2\theta} = 2\pi i \left(\frac{1}{4i} + \frac{1}{4i}\right) = \pi

Higher Harmonic

Show that ∫02πcos⁡2θ5−4cos⁡θ dθ=π6\int_0^{2\pi} \frac{\cos 2\theta}{5 - 4\cos\theta}\,\text{d}\theta = \frac{\pi}{6}.

Use cos⁡2θ=Re(e2iθ)=12(z2+z−2)=z4+12z2\cos 2\theta = \text{Re}(e^{2i\theta}) = \frac{1}{2}\left(z^2 + z^{-2}\right) = \frac{z^4 + 1}{2z^2}.

5−4cos⁡θ=5−2(z+1z)=−(2z−1)(z−2)z5 - 4\cos\theta = 5 - 2\left(z + \frac{1}{z}\right) = -\frac{(2z-1)(z-2)}{z} ∫02πcos⁡2θ5−4cos⁡θ dθ=∮∣z∣=1g(z) dz,g(z)=−z4+12i z2(2z−1)(z−2)\int_0^{2\pi} \frac{\cos 2\theta}{5 - 4\cos\theta}\,\text{d}\theta = \oint_{|z|=1} g(z)\,\text{d}z, \quad g(z) = -\frac{z^4 + 1}{2i\, z^2 (2z-1)(z-2)}

The poles inside the unit circle are z=0z = 0 (order 2) and z=12z = \frac{1}{2} (order 1). The pole z=2z = 2 lies outside.

Res(g,12)=−116+12i⋅14⋅2⋅(−32)=1724i\text{Res}\left(g, \tfrac{1}{2}\right) = -\frac{\frac{1}{16} + 1}{2i \cdot \frac{1}{4} \cdot 2 \cdot \left(-\frac{3}{2}\right)} = \frac{17}{24i}

For z=0z = 0, differentiate −z4+12i(2z2−5z+2)-\frac{z^4 + 1}{2i(2z^2 - 5z + 2)} at 00.

Res(g,0)=−12i⋅0⋅2−1⋅(−5)22=−58i\text{Res}(g, 0) = -\frac{1}{2i} \cdot \frac{0 \cdot 2 - 1 \cdot (-5)}{2^2} = -\frac{5}{8i} ∫02πcos⁡2θ5−4cos⁡θ dθ=2πi(1724i−1524i)=π6\int_0^{2\pi} \frac{\cos 2\theta}{5 - 4\cos\theta}\,\text{d}\theta = 2\pi i \left(\frac{17}{24i} - \frac{15}{24i}\right) = \frac{\pi}{6}

Linear Denominator

Evaluate ∫02πdθ2+cos⁡θ\int_0^{2\pi} \frac{\text{d}\theta}{2 + \cos\theta}.

2+cos⁡θ=z2+4z+12z2 + \cos\theta = \frac{z^2 + 4z + 1}{2z} ∫02πdθ2+cos⁡θ=∮∣z∣=12i(z2+4z+1) dz\int_0^{2\pi} \frac{\text{d}\theta}{2 + \cos\theta} = \oint_{|z|=1} \frac{2}{i(z^2 + 4z + 1)}\,\text{d}z

The roots of z2+4z+1z^2 + 4z + 1 are z1,2=−2±3z_{1,2} = -2 \pm \sqrt{3}. Only z1=−2+3≈−0.27z_1 = -2 + \sqrt{3} \approx -0.27 lies inside the unit circle.

Res=2i(z1−z2)=223 i=13 i\text{Res} = \frac{2}{i(z_1 - z_2)} = \frac{2}{2\sqrt{3}\, i} = \frac{1}{\sqrt{3}\, i} ∫02πdθ2+cos⁡θ=2πi⋅13 i=2π3\int_0^{2\pi} \frac{\text{d}\theta}{2 + \cos\theta} = 2\pi i \cdot \frac{1}{\sqrt{3}\, i} = \frac{2\pi}{\sqrt{3}}
Written by October 6, 2026 1 min read
Was this helpful?