0

So I solved this assignment and got the same answer as the person in this thread. The answer is correct and I also verified it by plotting with software. The answers are

$$f(x)=\frac{\pi^2}{3}+4\sum_{n\in\mathbb{N}}\frac{(-1)^n}{n^2}\cos(nx),$$

where $a_0=2\pi^2/3$ and

$$a_n=\frac{4(-1)^n}{n^2}.$$

However, If I want $a_0$ fron $a_n$, by calculating $a_n$ for $n=0$ I get a division by zero. I found that this only works sometimes and not always. Why is this and when does it work and not work?

Also, If the assignment asks me to "compute the Fourier series of..." How do I know wheather I should go the complex Fourier series or real?

Bernard
  • 175,478
Parseval
  • 6,413

1 Answers1

2

You said yourself that the formula for $a_n$ does not apply for $n=0$. It is fairly common for the value for $a_0$ not to fit the pattern of higher coefficients. The factor $n^2$ in the denominator comes from integrating $x^2\cos(nx)$ over the interval, but when you compute $a_0$ there is no cosine factor.

Ross Millikan
  • 374,822