If a function is extended to make it periodic then must the integration limits also be extended?

1.1k Views Asked by At

The following extract is taken from "Riley, Hobson and Bence - Mathematical methods for physics and engineering", Section 12.5 - "Non-periodic functions", page 422 and 423:

Find the Fourier series of $f(x)=x^2\,$ for $\,\,0\lt x \le 2$


We must first make the function periodic. We do this by extending the range of interest to $−2 \lt x \le 2$ in such a way that $f(x)=f(-x)$ and then letting $f(x+4k) = f(x)$, where $k$ is any integer. This is shown in figure 12.5.

Graph of f(x) with extended range

Now we have an even function of period 4. The Fourier series will faithfully represent $f(x)$ in the range, $−2 \lt x \le 2$, although not outside it. Firstly we note that since we have made the specified function even in $x$ by extending the range, all the coefficients $b_n$ will be zero.

Where $$b_n=\frac{2}{L}\int_{x_0}^{x_0+L}f(x)\sin\left(\frac{2\pi nx}{L}\right)dx\tag{12.5}$$ similarly $$a_n=\frac{2}{L}\int_{x_0}^{x_0+L}f(x)\cos\left(\frac{2\pi nx}{L}\right)dx\tag{12.6}$$ where $x_0$ is arbitrary but is often taken as $0$ or $-\frac{L}{2}$ and $L$ is the period of $f(x)$.

Now we apply $(12.5)$ and $(12.6)$ with $L = 4$ to determine the remaining coefficients: $$a_n=\frac{2}{4}\int_{-2}^{2}x^2\cos\left(\frac{2\pi nx}{4}\right)dx=\frac{4}{4}\int_{0}^{2}x^2\cos\left(\frac{\pi nx}{2}\right)dx$$

The textbook then goes on the evaluate the Fourier series for $x^2$ on $]0,2]$ (which I won't go through here as that is not what this question is about).


The following related question I asked on "Chegg Study" website is here:

Show that the Fourier series of $f(x)=\cos\left(\frac{x}{2}\right)$ for $-\pi\lt x \lt \pi$ is given by $$f(x)=\frac{2}{\pi}+\frac{4}{\pi}\sum_{n=1}^{\infty}\frac{(-1)^{n+1}\cos(nx)}{4n^2 - 1}$$


So my attempt at the finding the Fourier series for $\cos\left(\frac{x}{2}\right)$ on the interval $-\pi \lt x \lt \pi$ is by using the same method for the previous case $f(x) = x^2$ above.

Since $\cos\left(\frac{x}{2}\right)$ is not periodic on $-\pi \lt x \lt \pi$,$\,$ I will extend the interval to $-2\pi \lt x \lt 2\pi$

A plot of the extended function is shown below:

cos(x/2)]

Then by $(12.6)$, $$\begin{align}a_n &=\frac{2}{L}\int_{x_0}^{x_0+L}f(x)\cos\left(\frac{2\pi nx}{L}\right)dx \\&=\frac{2}{4\pi}\int_{-2\pi}^{2\pi}\cos\left(\frac{x}{2}\right)\cos\left(\frac{2\pi nx}{4\pi}\right)dx\\&=\frac{1}{2\pi}\int_{-2\pi}^{2\pi}\cos\left(\frac{x}{2}\right)\cos\left(\frac{nx}{2}\right)dx\\&=0\end{align}$$

and this has been verified here by Wolfram Alpha.

But according to this answer given by "Chegg Study" website which gives the correct answer but the author does not extend the range of integration or change the argument of the cosine. So basically the author does not make the function periodic. Now it was my understanding that the Dirichlet conditions for convergence demand that a function must be periodic. Are the Dirichlet conditions wrong then?


Finally, my question is; why did the limits of integration need to be changed in the first example I gave, $f(x)=x^2$, but not for the second example of $f(x)=\cos\left(\frac{x}{2}\right)$?

I have researched this topic extensively in order to find an answer, here is a short extract from "Mathematical Methods in the Physical Sciences", third edition by Mary L. Boas, Section 8, page 360,
Other Intervals, Boas

The method used in the $x^2$ and $\cos(x/2)$ case was general and did not specify any restrictions on the function being extended.

So, put in another way, is there some kind of rule that says extending a trigonometric function to a full period is always forbidden since integrating over the period will be zero?