# Find the Fourier series of $f(x) = \cos \left(\frac{x}{3}\right)$ on $-\pi \leq x \leq \pi$

Find the Fourier series of

$$f(x) = \cos \left(\frac{x}{3}\right)$$

on the interval $$- \pi \leq x \leq \pi$$. I am not quite sure if my workings are correct.

Here is my attempt at this solution:

$$f(x) = \frac{A_0}{2} + \sum_{n=1}^{\infty} \left(A_n\cos(nx) + B_n\sin (nx)\right).$$

Calculating $$A_0$$: \begin{align} A_0 &= \frac{1}{\pi} \int^{\pi}_{-\pi} f(x) dx \\ &= \frac{1}{\pi} \int ^{\pi}_{-\pi} \cos\left(\frac{x}{3}\right) dx \\ &= \left. 3\sin \left(\frac{x}{3}\right) \right|^{\pi}_{-\pi} \\ &= 3\sqrt3. \end{align}

Calculating $$A_n$$: \begin{align} A_n &= \frac{1}{\pi} \int^{\pi}_{-\pi} f(x) \cos(nx) dx \\ &= \frac{1}{\pi} \int^{\pi}_{-\pi} \cos\left(\frac{x}{3}\right) \cos(nx) dx \\ &= \left. \frac{9n \cos(\frac{x}{3}) \sin(nx) -3 \sin(\frac{x}{3}) \cos(nx)}{9n^2-1} \right|^{\pi}_{-\pi}. \end{align}

Calculating $$B_n$$: \begin{align} B_n &= \frac{1}{\pi} \int^{\pi}_{-\pi} f(x) \sin(nx) dx \\ &= \frac{1}{\pi} \int^{\pi}_{-\pi} \cos\left(\frac{x}{3}\right) \sin(nx) dx \\ &= \left. \frac{3\left(\sin(\frac{\pi}{3}) \sin(nx) +3n\cos(\frac{x}{3}) \cos(nx)\right)}{9n^2-1} \right|^{\pi}_{-\pi} = 0. \end{align}

So how would I calculate $$A_n$$? I think I have done $$A_0$$ and $$B_n$$ correctly, but I am looking for some help. Thanks!

• @Jack thanks for your edit, would you be able to help me with my problem – fr14 Oct 27 '17 at 0:12
• What is the difficulty in going on with your calculation of $A_n$? Note that $\sin(n\pi)=0$ for any integer $n$. – Jack Oct 27 '17 at 0:23
• @Jack I am not sure if I am calculating $A_n$ correctly – fr14 Oct 27 '17 at 1:09
• @Jack wouldn't $A_n$ all cancel to $0$ then? – fr14 Oct 27 '17 at 1:10
• No: $\cos(n\pi)=(-1)^n$ and $\sin(-\pi/3)=-\sin(\pi/3)=-\sqrt{3}/2$. – Jack Oct 27 '17 at 1:12