Use symmetry and odd/even function considerations to find the Fourier series of $f(x)=\cos\left(\frac{x}{2}\right)$ on $[-\pi,\pi]$

115 Views Asked by At

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}$$

Where the trigonometric Fourier series is given by

$$f(x)=\frac{a_0}{2}+\sum\limits_{n=1}^{\infty}\left[a_n\cos(nx)+b_n\sin(nx)\right]$$

Using $$a_0 = \frac{1}{\pi}\int_{-\pi}^{\pi}\cos(x/2)dx \\ a_n = \frac{1}{\pi}\int_{-\pi}^{\pi}\cos(x/2)\cos(n x)dx,\;\; n \ge 1 \\ b_n = \frac{1}{\pi}\int_{-\pi}^{\pi}\cos(x/2)\sin(n x)dx=0,\;\; n \ge 1.$$

$b_n=0\,\forall \,n$ and $a_n$ is found via the trigonometic identity $$\cos(x/2)\cos(n x)=\frac{1}{2}\{\cos(x/2+n x)+\cos(x/2-n x)\} \\ $$


Using the fact that $\int_{-\pi}^{\pi}e(x)dx=2\int_{0}^{\pi}e(x)$ for an even function $e(x)$ about a symmetric interval over the origin.

$$a_0=\frac{1}{\pi}\int_{-\pi}^{\pi}\cos(x/2)dx=\frac{2}{\pi}\int_{0}^{\pi}\cos(x/2)dx=\frac{4}{\pi}\sin\left(\frac{x}{2}\right)\bigg\lvert_0^\pi=\frac{4}{\pi}$$

So $\dfrac{a_0}{2}$ is indeed $\dfrac{2}{\pi}$ as required.

Applying similar logic to get the $a_n$

$$\begin{align}a_n &=\frac{1}{2\pi}\int_{-\pi}^{\pi}\{\cos(x/2+n x)+\cos(x/2-n x)\}dx\\&=\frac{2}{2\pi}\int_0^{\pi}\cos(x/2+n x)dx+\frac{2}{2\pi}\int_0^{\pi}\cos(x/2-n x)dx\tag{1}\\&=\frac{1}{\pi}\left.\left\{\frac{\sin(x/2+nx)}{1/2+n}+\frac{\sin(x/2-nx)}{1/2-n}\right\}\right|_{x=0}^{\pi}\\&=\frac{1}{\pi}\left.\left\{\frac{\sin(\pi/2+n \pi )}{1/2+n}+\frac{\sin(\pi/2-n \pi)}{1/2-n}\right\}\right.\\&=\frac{2}{\pi}\left.\left\{\frac{\sin(\pi/2+n \pi )}{2n+1}+\frac{\sin(n \pi-\pi/2)}{2n-1}\right\}\right.\tag{2}\end{align}$$

In the last line I used the fact that $\sin(n \pi-\pi/2)=-\sin(\pi/2-n \pi)$

I'm struggling at this point to continue the calculation but thinking about the sine graph I note that $\sin(\pi/2+n \pi )=(-1)^{n+1}$ and that $\sin(n \pi-\pi/2 )=(-1)^{n+2}$ for integer $n\ge 1$.

Substituting these into $(2)$

$$\begin{align}\frac{2}{\pi}\left.\left\{\frac{(-1)^{n+1}}{2n+1}+\frac{(-1)^{n+2}}{2n-1}\right\}\right.&=\frac{2}{\pi}\left.\left\{\frac{(-1)^{n+1}}{2n+1}-\frac{(-1)^{n+1}}{2n-1}\right\}\right.\\&=\frac{4}{\pi}(-1)^{n+1}\frac{1}{4n^2-1}\end{align}$$

This will lead to the correct answer but I don't want to achieve the right answer by accident so I am posting it here to verify.


So my questions about this proof are:

In $(1)$ I made use of $\int_{-\pi}^{\pi}e(x)dx=2\int_{0}^{\pi}e(x)$ and I assumed that the integrand is even for all $n$. Is this assumption correct?

From that same equation in $(1)$, I could have written $\frac{2}{2\pi}\int_0^{\pi}\cos(nx-x/2)dx$ instead of $\frac{2}{2\pi}\int_0^{\pi}\cos(x/2-n x)dx$ since cosine is an even function. But it is not even on the interval for which I am integrating over, $[0,\pi]$. So is it still correct to assume $\cos(x)=\cos(-x)$ even if the function is not even over that interval?

Lastly, is there anything else wrong with this proof?

Many thanks.

2

There are 2 best solutions below

3
On BEST ANSWER

I would assume "$\int_{-\pi}^{\pi}e(x)dx=\int_{0}^{\pi}e(x)$" is a typo. The correct expression is $$ \int_{-\pi}^{\pi}e(x)dx=\color{red}2\int_{0}^{\pi}e(x)dx, $$ which was also obviously used in calculations. Everything else was ok. It concerns also your questions: yes, it is correct to use function properties (such as $f(-x)=f(x)$) independent of the integration interval.

0
On

We may actually generalize this result.

Theorem: For some real $\alpha\not\in \Bbb Z$, we define $$f(x)=\cos\alpha x$$ Then for $|x|<\pi$: $$f(x)=\frac{\sin\pi\alpha}{\pi\alpha}\left[1+2\alpha^2\sum_{n\geq1}\frac{(-1)^n}{\alpha^2-n^2}\cos nx\right]$$

Proof:

We recall that for $|x|<\pi$ $$f(x)=\frac{a_0}2+\sum_{n\geq1}a_n\cos nx+b_n\sin nx$$ Where $$a_n=\frac1\pi\int_{-\pi}^\pi f(x)\cos nx\,dx\\ b_n=\frac1\pi\int_{-\pi}^\pi f(x)\sin nx\,dx\\ a_0:=\frac1\pi\int_{-\pi}^{\pi} f(x)dx$$ So we start off with $$a_0=\frac1\pi\int_{-\pi}^\pi \cos(\alpha x)dx=\frac2\pi\int_0^\pi\cos(\alpha x)dx=\frac2{\pi \alpha}\sin\pi\alpha$$ So $$f(x)=\frac{\sin\pi\alpha}{\pi \alpha}+\sum_{n\geq1}a_n\cos nx+b_n\sin nx$$ We then Start computing $$b_n=\frac1\pi\int_{-\pi}^\pi\cos(\alpha x)\sin(nx)dx$$ Setting $x=-u$ we have that $$b_n=\frac1\pi\int_{\pi}^{-\pi}\cos(\alpha u)\sin(nu)du=-b_n$$ Hence $$b_n=0$$ Which gives $$f(x)=\frac{\sin\pi\alpha}{\pi \alpha}+\sum_{n\geq1}a_n\cos nx$$ Then we compute $$a_n=\frac1\pi\int_{-\pi}^\pi\cos(\alpha x)\cos(nx)dx$$ by using the symmetry of $\cos$ about $x=0$, giving $$a_n=\frac2\pi\int_0^\pi \cos(\alpha x)\cos(nx)dx$$ then using $2\cos(a)\cos(b)=\cos(a+b)+\cos(a-b)$ we get $$a_n=\frac1\pi\int_0^\pi\cos[(\alpha+n)x]dx+\frac1\pi\int_0^\pi\cos[(\alpha-n)x]dx$$ $$\pi a_n=\frac{\sin[(\alpha+n)\pi]}{\alpha+n}+\frac{\sin[(\alpha-n)\pi]}{\alpha-n}$$ Then denoting $$s_1=\sin\pi\alpha\\ c_1=\cos\pi\alpha\\ s_2=\sin\pi n=0 \\c_2=\cos\pi n=(-1)^n$$ We have (from the $\sin$ angle addition and subtraction formulae) $$\sin[(\alpha+n)\pi]=\sin[(\alpha-n)\pi]=s_1c_2=(-1)^n\sin\pi\alpha$$ So indeed we have that $$\pi a_n=(-1)^n\frac{2\alpha\sin\pi\alpha}{\alpha^2-n^2}$$ And after a small bit of algebra, our desired result: $$f(x)=\frac{\sin\pi\alpha}{\pi\alpha}\left[1+2\alpha^2\sum_{n\geq1}\frac{(-1)^n}{\alpha^2-n^2}\cos nx\right]$$