Thursday, July 21, 2022

A simple calculus question

Consider the problem of finding an antiderivative of $$ \int \frac{1}{a + b \cos x} \, \mathrm{d}x, $$ where $|b| \lt a$. It is often done by adopting the Weierstrass substitution $t = \tan(x/2)$. The upshot of this substitution is \begin{align*} \int \frac{1}{a + b \cos x} \, \mathrm{d}x &= \int \frac{1}{a + b\left(\frac{1-t^2}{1+t^2}\right)} \, \frac{2\,\mathrm{d}t}{1+t^2} \\ &= \int \frac{2}{(a+b) + (a-b)t^2} \, \mathrm{d}t \\ &= \frac{2}{\sqrt{a^2-b^2}} \arctan\left(\sqrt{\frac{a-b}{a+b}} \tan \frac{x}{2} \right) + \mathsf{C}. \tag{1} \end{align*} However, there is one caveat in this result. Suppose we want to compute the definite integral $$ \int_{0}^{2\pi} \frac{1}{a + b \cos x} \, \mathrm{d}x. $$ Can we utilize the antiderivative $\text{(1)}$ to find its value? Well, this is not possible, at least directly. This is because the substitution $t = \tan(x/2)$ is discontinuous at every point of the form $$ x = (2k+1)\pi, \qquad k \in \mathbb{Z}. $$ Consequently, the formula $\text{(1)}$ also suffers from discontinuity at those points. The usual trick to avoid this difficulty is to choose another $2\pi$-interval on which $\tan(x/2)$ is continuous. One such choice is the open interval $(-\pi, \pi)$. So, \begin{align*} \int_{0}^{2\pi} \frac{1}{a + b \cos x} \, \mathrm{d}x &= \int_{-\pi}^{\pi} \frac{1}{a + b \cos x} \, \mathrm{d}x \\ &= \lim_{\varepsilon \to 0^+} \int_{-\pi+\varepsilon}^{\pi-\varepsilon} \frac{1}{a + b \cos x} \, \mathrm{d}x \\ &= \lim_{\varepsilon \to 0^+} \left[ \frac{2}{\sqrt{a^2-b^2}} \arctan\left(\sqrt{\frac{a-b}{a+b}} \tan \frac{x}{2} \right) \right]_{-\pi+\varepsilon}^{\pi-\varepsilon} \\ &= \frac{2\pi}{\sqrt{a^2-b^2}}. \end{align*}

So, is this the end of the story? In fact, it turns out that we can find an antiderivative that is vaild on all of $\mathbb{R}$:

Theorem. Let $a, b \in \mathbb{R}$ satisfy $|b| \lt a$. Then \begin{align*} & \int \frac{1}{a + b\cos x} \, \mathrm{d}x \\ &= \frac{1}{\sqrt{a^2 - b^2}} \biggl[ x - 2 \arctan \biggl( \frac{b \sin x}{a + \sqrt{a^2-b^2} + b \cos x} \biggr) \biggr] + \mathsf{C}. \end{align*} This formula is valid on $\mathbb{R}$.

Proof. The Fourier series of the integrand is $$ \frac{1}{a + b\cos x} = \frac{1}{\sqrt{a^2 - b^2}} \left( 1 + 2 \sum_{n=1}^{\infty} r^n \cos(nx) \right), $$ where $r$ is given by $$ r = -\frac{b}{a + \sqrt{a^2 - b^2}} \in (-1, 1). $$ Integrating both sides, we conclude \begin{align*} & \int \frac{1}{a + b\cos x} \, \mathrm{d}x \\ &= \frac{1}{\sqrt{a^2 - b^2}} \left( x + 2 \sum_{n=1}^{\infty} \frac{r^n}{n} \sin(nx) \right) + \mathsf{C} \\ &= \frac{1}{\sqrt{a^2 - b^2}} \left[ x - 2 \operatorname{Im}\left( \log(1 - re^{ix}) \right) \right] + \mathsf{C} \\ &= \frac{1}{\sqrt{a^2 - b^2}} \left[ x + 2 \arctan \left( \frac{r \sin x}{1 - r \cos x} \right) \right] + \mathsf{C}. \end{align*} Plugging the value of $r$ into this, we are done.

No comments:

Post a Comment