Fourierseries where $a_{0}$ isn't what is is supposed to be

36 Views Asked by At

So we're given the function:

$$ f(x) = \begin{cases} 0, & \mbox{if } -\pi < x < 0 \\ 1, & \mbox{if } 0 \le x \le \pi \end{cases} $$

Of this function, we must determine the Fourier series. Since in the course, a Fourier series is defined as $ \frac{a_0}{2} + \sum_{n=1}^{\infty} (a_n\cos{nx} + b_n\sin{nx})$ where $ a_n = \frac{1}{\pi}\int{f(x)\cos{nx}} dx$ and $ b_n = \frac{1}{\pi}\int{f(x)\sin{nx}} dx$. I thus started calculating $a_n$ by splitting the integral in two intervals from $]-\pi, 0[$ and from $[0, \pi]$:

$$ a_n = \begin{cases} \frac{1}{\pi}\int_{-\pi}^{0}dx & \mbox{if } -\pi < x < 0\\ \frac{1}{\pi}\int_{0}^{\pi}\sin{nx}dx & \mbox{if } 0 \le x \le \pi\end{cases}$$

I thus become as a result:

$$ a_n = \begin{cases} 0 & \mbox{if } -\pi < x < 0 \\ \frac{1}{\pi}\left[\frac{1}{n} - \frac{\cos{n\pi}}{n}\right] & \mbox{if } 0 \le x \le \pi\end{cases}$$

and for $b_n$ I get the integrals:

$$ b_n = \begin{cases} \frac{1}{\pi}\int_{-\pi}^{0}dx & \mbox{if } -\pi < x < 0\\ \frac{1}{\pi}\int_{0}^{\pi}\cos{nx}dx & \mbox{if } 0 \le x \le \pi\end{cases}$$ which all result to be

$$ b_n = \begin{cases} 0 & \mbox{if } -\pi < x < 0 \\ 0 & \mbox{if } 0 \le x \le \pi\end{cases}$$

But now I'm completly stuck and I have no idea how to continue. According to the course, the solution should be:

$$ \frac{1}{2} + \frac{2}{\pi}\sum_{n=0}^{\infty}\frac{1}{2n + 1}\sin({2n + 1})x$$

1

There are 1 best solutions below

4
On

Hint: Your error is an assumption that $a_n, b_n$ somehow depend on $x$. In fact it is not the case and $$ a_0=\frac1\pi\int_0^\pi dx=\frac1\pi\left[x\right]_0^\pi=1\\ a_n=\frac1\pi\int_0^\pi\cos nx dx=\frac1\pi\left[\frac{\sin nx}n\right]_0^\pi=0\\ b_n=\frac1\pi\int_0^\pi\sin nx dx=\frac1\pi\left[-\frac{\cos nx}n\right]_0^\pi= \frac{1-(-1)^n}{\pi n}. $$