Integration – Solving Integral in 1/(a-b cos x) Format

complex-analysisintegration

Looking at solving:

$$\int_{0}^{2\pi}\frac{1}{\sqrt{2}-\cos x}\,dx \\$$

According to integral tables (such as this one) the solution is:

$$\frac{2}{\sqrt{a^2 – b^2}}\arctan\frac{\sqrt{a^2 – b^2}\tan(x/2) }{a+b}$$

$$a=\sqrt{2}, b=-1$$

$$\left.2\arctan\frac{2\tan(x/2) }{\sqrt{2}-1}\right\rvert_0^{2\pi}$$

Solving this equation for $x={2\pi}$ results in zero, and for $x=0$ results in zero, so the result is zero. Except I'm missing something here because the original function to be integrated is never less than zero, it oscillates between 0.414 and 2.414, so there must be net positive area under that curve.

Another way to solve this integral is to transform it to a complex line integral, using residues and getting a result of ${2\pi}$

$$\int_{0}^{2\pi}\frac{1}{\sqrt{2}-\cos x}\,dx = {2\pi}\\$$

Why doesn't the table of integrals get the same result?

Best Answer

The tangent function is not defined for all real inputs, it has poles at arguments in the set $\pi/2+\pi\mathbb{Z}$. For this reason, the solution written down is only an antiderivative for your integrand on the interval it is defined. The largest such interval containing $0$ for which the given antiderivative is well-defined is $(-\pi,\pi)$. So, you cannot apply the fundamental theorem of calculus to this integrand for the interval $[0,2\pi]$.