I don't know if I'm doing something wrong in this exercise.
$f(t)=\pi-t$, if $0<t<\pi$
$f(t)=0$, if $\pi<t<2\pi$
I have to find the Fourier Series of $f(t)$
I define the Fourier Series like this:
T: period
$$f(t)=\frac{a_0}{2}+\sum_{n=1}^{\infty}[a_n.\cos{\frac{2\pi nt}{T}}+b_n.\sin{\frac{2\pi nt}{T}}]$$
where ($\alpha$ is a real number)
$$a_0=\frac{2}{T}.\int_{\alpha}^{\alpha+T}f(t)dt$$
$$a_n=\frac{2}{T}.\int_{\alpha}^{\alpha+T}f(t).\cos{\frac{2\pi nt}{T}}dt$$
$$b_n=\frac{2}{T}.\int_{\alpha}^{\alpha+T}f(t).\sin{\frac{2\pi nt}{T}}dt$$
Here's the problem: I think that $T=4\pi$, because I extend the function $f(t)$ from $-2\pi$ to $2\pi$, so I have this:
$$a_0=\frac{1}{2\pi}.\int_{-2\pi}^{2\pi}f(t)dt=\frac{1}{\pi}.\int_{0}^{2\pi}f(t)dt$$
$$a_n=\frac{1}{2\pi}.\int_{-2\pi}^{2\pi}f(t).\cos{\frac{nt}{2}}dt=\frac{1}{\pi}.\int_{0}^{2\pi}f(t).\cos{\frac{nt}{2}}dt$$
$$b_n=\frac{1}{2\pi}.\int_{-2\pi}^{2\pi}f(t).\sin{\frac{nt}{2}}dt=\frac{1}{\pi}.\int_{0}^{2\pi}f(t).\sin{\frac{nt}{2}}dt$$
But other people took $T=2\pi$ and they have:
$$a_0=\frac{2}{2\pi}.\int_{0}^{2\pi}f(t)dt=\frac{1}{\pi}.\int_{0}^{2\pi}f(t)dt$$
$$a_n=\frac{2}{2\pi}.\int_{0}^{2\pi}f(t).\cos{nt} dt=\frac{1}{\pi}.\int_{0}^{2\pi}f(t).\cos{nt} \mathrm{d}t$$
$$a_n=\frac{2}{2\pi}.\int_{0}^{2\pi}f(t).\sin{nt} dt=\frac{1}{\pi}.\int_{0}^{2\pi}f(t).\sin{nt} \mathrm{d}t$$
Look that he took the integral between 0 and $2\pi$ and I took it from $-2\pi$ to $2\pi$
Did I do something wrong? Why this he took the period from 0 to $2\pi$? $f(t)$ is not a periodic function?
Thanks!
It does not matter whether we choose to extend $f$ so that the period is $2 \pi$ or $4 \pi$. Your problem is a simplification you made when determining the coefficients.
$$a_n = \frac{2}{4 \pi} \int_{-2 \pi}^{2\pi} f(t) \cos{\frac{n t}{2}} \ dt \neq \frac{1}{\pi} \int_{0}^{2\pi} f(t) \cos{\frac{n t}{2}} \ dt,$$ because when you extend your function $f(t)$ to the interval $[-2 \pi, 2 \pi]$ it is NOT an even function. So, you must compute the integral over the whole interval and not make this incorrect simplification.
What you will find is that when $n$ is odd, you will get $a_n = b_n = 0$ and that when $n$ is even you will get the same answer as you would get by thinking of the function as only having a period of $2 \pi$