Find $a_n =1/\pi\int_{-\pi}^{\pi}\cos(x)\cos(nx)dx$

718 Views Asked by At

I am trying to compute Fourier coefficients for the function $f(x) = \cos x$. I have managed to solve that the coefficients "$c$" and "$b$" for the function are $0$. However, I am struggling to solve the following integral (in order to compute coefficient "a")

$$a_n =\frac{1}{π}\int_{-\pi}^{\pi}\cos(x)\cos(nx)dx$$

where n is a positive integer.

I have tried to solve the problem by using integration by parts but this gets me going around in circles. I have also tried to solve the integral using the cosine product-to-sum formula.

For context, I am facing this problem in a calculus textbook, not in the context of Fourier analysis . The purpose of the exercise is solely to practice integration techniques (I am not yet familiar with Fourier series or analysis).

Edit: here is what I get when using the product-to-sum formula: $$\frac{1}{2π}\frac{2\sin(\pi+\pi n)}{(1+n)}+\frac{1}{2π}\frac{2\sin(\pi-\pi n)}{(1-n)}$$

3

There are 3 best solutions below

2
On BEST ANSWER

Recall that $$\cos(\theta+\varphi)=\cos\theta\cos\varphi-\sin\theta\sin\varphi$$ Therefore, we can show that $$\cos\theta\cos\varphi=\frac 12\bigr(\cos(\theta+\varphi)+\cos(\theta-\varphi)\bigr)$$ Setting $\theta=x$ and $\varphi=nx$ gives $$\int\limits_{-\pi}^{\pi}\mathrm dx\,\cos x\cos nx=\frac 12\int\limits_{-\pi}^{\pi}\mathrm dx\,\cos x(1+n)+\frac 12\int\limits_{-\pi}^{\pi}\mathrm dx\,\cos x(1-n)$$ Can you finish the rest?

0
On

Let $I_n = \pi a_n$, just for convenience. For $n = \pm1$, you can use the closed-form of the anti-derivative, which is $\frac{x}{2}+\frac{\sin(2x)}{4}$ to get $I_1=\pi$. For other $n$, integrate by parts to get $$I_n = -\frac{2}{n}\sin(n\pi)+\frac{1}{n}\int_{-\pi}^{\pi}\sin(x)\sin(nx)dx$$

Integrate by parts again to get $$I_n = -\frac{2}{n}\sin(n\pi) + \frac{1}{n^2}\underbrace{\int_{-\pi}^{\pi}\cos(x)\cos(nx)dx}_{I_n}$$

Which means that $$I_n = -\frac{\frac{2}{n}\sin(n\pi)}{1-\frac{1}{n^2}}=-\frac{2\sin(n\pi)}{n-\frac{1}{n}}$$

For integer $n$ greater than $1$, this is simply $0$.

0
On

I would go straightforward here: For $n=1$ $$a_1=\frac{1}{\pi}\int_{-\pi}^{\pi}\cos(x)\cos(x)dx=\frac{1}{\pi}\int_{-\pi}^{\pi}\sin(x)\sin(x)dx=\frac{1}{\pi}\int_{-\pi}^{\pi}[1-\cos(x)^2]dx=2-a_1$$ which results in $a_1=1$. For $n>1$ $$a_n=\frac{1}{\pi}\int_{-\pi}^{\pi}\cos(x)\cos(nx)dx=\frac{n}{\pi}\int_{-\pi}^{\pi}\sin(x)\sin(nx)dx=\frac{n^2}{\pi}\int_{-\pi}^{\pi}\cos(x)\cos(nx)dx=n^2a_n$$ Since $n^2-1>0$, the equation $(n^2-1)a_n=0$ is only satisfied when $a_n=0$. Thus $$a_n=\begin{cases} 1, & n=1\\ 0, & n>1 \end{cases}$$