# Thread: Fourier series of a function

1. ## Fourier series of a function

The exercise states "Let $f(x)$ be a periodic function with period $2 \pi$ defined in the interval $[- \pi , \pi]$ by $f(x)=1$ if $0 \leq x \leq \pi$ and $f(x)=0$ if $-\pi \leq x <0$.
Calculate the Fourier coefficients of f and obtain its Fourier series and analyze the convergence of the series.
My attempt: First of all I think they made an error and meant to say the interval $[- \pi , \pi)$. Otherwise it's not making sense to me.

Ok so I read the definition of the nth coefficient of the Fourier series in my class notes and I read $\hat f(n)= \frac{1}{2 \pi} \int _{- \pi}^{\pi} f(\theta ) e^{-in\theta } d\theta$.
So I calculated $\hat f(0)$ to be worth $\frac{1}{2}$.
For all $n$ even and $n \neq 0$, I found out that $\hat f(n)=0$. While for all $n$ uneven, I found out that $\hat f(n)=-\frac{1}{\pi n}$.
Since the Fourier series is defined as $\sum _{- \infty}^{\infty} \hat f(n) e^{in\theta}$, I reach that the Fourier series is worth $\frac{1}{2}+ \sum _{n=-\infty}^{\infty} \frac{- \cos (n \theta)+ i \sin (n \theta)}{n \pi}$ where $n=2k+1$ with $k \in \mathbb{Z}$, $n\neq 0$.
To check out the convergence of the series, I guess I should split the series in 2, starting from $-\infty$ to $0$ and from $0$ to $+\infty$, and then apply the quotient test?
Is what I've done right? I'm not confident but can't find any error.

Edit: I forgot to multiply by "i" for the series of the uneven terms I think. I don't think the result change that much, except with an "i" factor.