## Integral of polynomial times rational function of trig function over multiple periods

Problem: Compute

$$\int_0^{12\pi} dx \frac{x}{6+\cos 8x}$$

It looks like the OP is trying to compute the antiderivative and use the fundamental theorem of calculus. With multiple periods, that approach is paved with all sorts of difficulty that is really an artifice related to the functional form of the antiderivative. In truth, there should be no such difficulty. A better approach involves the residue theorem, which I will outline below. Note that the presence of the linear term in the numerator provides a slight complication, but one that has been treated before in this site several times.

$$\int_{0}^{12 \pi} dx \frac{x}{6+\cos{8 x}} = \frac1{64} \int_0^{96 \pi} du \frac{u}{6+\cos{u}}$$

$$\int_{n 2 \pi}^{(n+1) 2 \pi} du \frac{u}{6+\cos{u}} = \int_0^{2 \pi} dv \frac{v+2 \pi n}{6+\cos{v}} = \int_0^{2 \pi} dv \frac{v}{6+\cos{v}} + 2 \pi n \int_0^{2 \pi} \frac{dv}{6+\cos{v}}$$

Thus, summing over $n$:

$$\int_{0}^{12 \pi} dx \frac{x}{6+\cos{8 x}} = \frac{48}{64} \int_0^{2 \pi} dv \frac{v}{6+\cos{v}} + \frac{48 (47) \pi}{64} \int_0^{2 \pi} \frac{dv}{6+\cos{v}}$$

We may now compute each of these integrals. The second integral is straightforward by the residue theorem, i.e., let $z=e^{i v}$, then

$$\int_0^{2 \pi} \frac{dv}{6+\cos{v}} = -i 2 \oint_{|z|=1} \frac{dz}{z^2+12 z+1}$$

The only pole of the integrand inside the unit circle is at $z=-6+\sqrt{35}$. The integral is then $i 2 \pi$ times the residue of the integrand at this pole, or $2 \pi/\sqrt{35}$.

To compute the first integral, we consider the complex integral

$$\oint_C dz \frac{\log{z}}{z^2+12 z+1}$$

where $C$ is the unit circle with a detour up and back about the positive real axis. (A circular piece about the origin vanishes.) This integral is equal to

$$-\frac12 \int_0^{2 \pi} dv \frac{v}{6+\cos{v}} + \int_1^0 dx \frac{\log{x}+i 2 \pi}{x^2+12 x+1} + \int_0^1 dx \frac{\log{x}}{x^2+12 x+1}$$

or, simplifying,

$$-\frac12 \int_0^{2 \pi} dv \frac{v}{6+\cos{v}} – i 2 \pi \int_0^1 \frac{dx}{x^2+12 x+1}$$

The contour integral is also equal to $i 2 \pi$ times the residue at the pole $z=-6+\sqrt{35}$. Note that the negative sign is taken to be $e^{i \pi}$. Thus we have

$$-\frac12 \int_0^{2 \pi} dv \frac{v}{6+\cos{v}} = i 2 \pi \int_0^1 \frac{dx}{x^2+12 x+1} + i 2 \pi \frac{-\log{\left ( 6+\sqrt{35} \right )}+i \pi}{2 \sqrt{35}}$$

Now,

$$\frac1{x^2+12 x+1} = \frac1{2 \sqrt{35}} \left (\frac1{x+6-\sqrt{35}} – \frac1{x+6+\sqrt{35}} \right )$$

so that

$$\int_0^1 \frac{dx}{x^2+12 x+1} = \frac1{2 \sqrt{35}} \log{\left (\frac{7+\sqrt{35}}{7-\sqrt{35}} \right )} = \frac1{2 \sqrt{35}} \log{\left (6+\sqrt{35}\right )}$$

Note the cancellation with the real part of the residue. Thus,

$$\int_0^{2 \pi} dv \frac{v}{6+\cos{v}} = \frac{2 \pi^2}{\sqrt{35}}$$

Putting these results altogether, we have

>$$\int_0^{12 \pi} dx \frac{x}{6+\cos{8 x}} = \frac{72 \pi^2}{\sqrt{35}}$$

### A method of evaluating a double integral that nobody taught you in school

Many times we are given integrals to evaluate. The standard way to evaluate is to find a series of transformations that will render the integral into something we know how to evaluate and then proceed. Examples of such transformations are substitutions, parts, replacement of an integrand with another integral, reversing order of integration, and so […]

### Deceptively easy product

The problem is to evaluate $$\prod_{n=2}^{\infty} \left (1+\frac{(-1)^{n-1}}{a_n} \right )$$ where $$a_n = n! \sum_{k=1}^{n-1} \frac{(-1)^{k-1}}{k!}$$ This is one of those cases where trying out a bunch of numbers really isn’t going to help all that much. The $a_n$ look kind of like $n!$, except off by some. Even so, I can find […]

### A sum I can only imagine being evaluated using the residue theorem

The challenge this time is to evaluate the following sum: $$\sum_{n=1}^{\infty} \frac{1}{n^3\sin{\left (\sqrt{2} \, n\pi \right)}}$$ It should be clear that the sum converges…right? No? Then how do we show this? Numerical experiments are more or less helpful, but as one might expect, there is a bit of jumping around about some value. So, even […]

### A little perspective on reaching 100K Rep on Math.SE

I stumbled onto math.stackexchange.com) on December 16, 2012. Before that, I was occasionally on the prowl for Putnam exam prep questions, various university math contests, and stuff like the IBM monthly puzzle.  At this point 1132 days later, I forget what I was looking for in the first place – likely a new problem to […]

### Systematic treatment of a deceptively messy Cauchy principal value integral

The problem here is to evaluate the following: $$PV \int_0^{\infty} dx \frac{\log^2{x}}{(x-1)^2(x-4) \sqrt{x}}$$ This can be done using complex analysis, but it is a pretty involved affair, deceptively so. After struggling with the problem of how to present the solution, I am going to lay out a systematic approach that ignores the motivation behind […]

### Cauchy principal value of a convolution

The problem here is to compute the following convolution-type integral: $$\int_{-1}^1 dx \frac{\sqrt{1-x^2}}{\lambda-x}$$ When $-1 \lt \lambda \lt 1$, this integral is infinite, but its Cauchy principal value may be defined. This integral is interesting because of the branch points. And so, away we go… Consider the following contour integral: $$\oint_C dz \frac{\sqrt{z^2-1}}{\lambda-z}$$ where […]

### Cauchy Principal Value

On Math.SE, we frequently get integrals that simply do not exist in the usual sense because the integration path intersects a pole of the integrand. Occasionally, we come across such integrals in the course of evaluating integrals of functions with removable singularities using complex methods. However, sometimes such integrals are interesting in their own right. […]

### Inverse Laplace Transforms and Delta Functions

Problem: find the inverse Laplace transform of $$F(s) = \frac{s}{s-1}$$ Solution: Well, this one should be easy and one wonders why we are even bothering.  Just split $F$ up as follows: $$F(s) = \frac1{s-1} + 1$$ The ILT of $1/(s-1)$ is simply $e^t$, and the ILT of $1$ is $\delta(t)$.  Done. Or are we?  Why […]

### Adventures in integration, University Edition

I got a request from an old friend whom I didn’t even know existed. He is the son of my grand-advisor, if that makes any sense. He teaches, among others, a course in Real Analysis at a university in Australia. I know I must like this guy because he says stuff like this: Currently, within the School […]

### Inverse Laplace Transform with a coinciding pole and branch point

Recently, the following Laplace transform was asked to be inverted: $$F(s) = s^{-a-1} e^{-s^a}$$ where $a \in (0,1)$. This is a tough problem for two reasons. One is that there is very little chance of there being an analytical result for arbitrary values of $a$. The other, however, is more subtle: there is a […]

### The art of using the Residue Theorem in evaluating definite integrals

As many of you know, using the Residue Theorem to evaluate a definite integral involves not only choosing a contour over which to integrate a function, but also choosing a function as the integrand. Many times, this is an easy task when integrating, say, rational functions over the real line. Sometimes there are less trivial […]