How to integrate log of squared Fourier series?

92 Views Asked by At

Suppose I have the square of a saw-tooth Fourier series . . . something like

$$\left(\sin(x) + \frac{\sin(2x)}{2} +\frac {\sin(3x)}{3}\right)^2$$

Is there a way to integrate the natural log of this function? I.e.,

$$\ln\left[\left(\sin(x) + \frac{\sin(2x)}{2} +\frac {\sin(3x)}{3}\right)^2\right]$$ over some interval (say, $0$ to $2\pi$)?

If the antiderivative of this is too gnarly (Mathematica spits out a pretty large antiderivative), is there a way to approximate this?

1

There are 1 best solutions below

8
On

Define

$$f(\theta):=\ln\left[\left(\sin(\theta)+\frac{\sin(2\theta)}2+\frac{\sin(3\theta)}3\right)^2\right]$$

$$I:=\int_0^{2\pi}f(\theta)~\mathrm d\theta$$

Unfortunately, $f(\theta)$ diverges at $\{0,\pi,2\pi\}$, but this can easily be fixed by subtracting $\ln[\sin^2(\theta)]$ from the integrand:

$$I=-4\pi\ln(2)+\int_0^{2\pi}g(\theta)~\mathrm d\theta$$

Where

$$g(\theta)=2\ln\left(\frac43+\cos(\theta)+\frac23\cos(2\theta)\right)$$

defines an analytic periodic function. Integrals of these kinds are fairly easy to approximate, as

$$\int_0^{2\pi}g(\theta)~\mathrm d\theta\approx S(n)=\frac{2\pi}n\sum_{k=1}^ng(2\pi k/n)$$

Where the error is given by the Euler-Maclaurin formula. The first few values for $n$ are given by

n      S(n)
1      13.805569180893
2       6.902784590446
3      -1.205039847179
4       0.903779885384
5       1.674257949611
6       1.095888349637
7       1.091214979992
8       1.221964856078
9       1.183137563897
10      1.163988136630
20      1.176893287973
30      1.176909709314
40      1.176909737014
50      1.176909737066
60      1.176909737067
70      1.176909737067
80      1.176909737067
90      1.176909737067
100     1.176909737067

And thus,

$$\begin{align}I&\dot=-4\pi\ln(2)+1.176909737067\\&\dot=-7.53343462414\end{align}$$