# Finding Fourier series with function not centered at the origin

I am trying to find both Fourier cosine and sine series which represent the function F(t) in the interval $(0, \pi)$

where $F(t)=\begin{cases} \frac{\pi}{2} & \ \ 0<t< \frac{\pi}{2}\\ 0 & \ \frac{\pi}{2}<t< \pi\end{cases}$

I suspect I am suppose to use the following equation to work out the Fourier Series: $\\$

However, to work out $a_0$, $A_N$ and $B_N$, I need to know if this is an even or odd function first. But there are no information regarding what the function is like when $t<0$. So I don't know what to do.

(maybe I should put this as a separate question?) Also, what is the difference between and Fourier cosine series and a Fourier sine series?

EDIT: I have worked out half of this question, for assuming that the equation is EVEN. But what should I do with assuming the function to be Odd?

Anyway, here's what I did for when it's EVEN, please have a look and let me know if I'm doing it right.

I think I got the answer now. Do correct me if I have a mistake anywhere though.

So as suggested by Raymond Manzoni, we can suppose the function is even to produce a Fourier Cosine Series and suppose the function is odd to produce a Fourier Sine Series.

Case 1: EVEN

$F(t)=\begin{cases} 0 & \ -\pi<t< \frac{-\pi}{2} \\ \frac{\pi}{2} & \ \frac{-\pi}{2}<t< \frac{\pi}{2}\\ 0 & \ \frac{\pi}{2}<t< \pi\end{cases}$

$A_N \ = \frac{2}{T}\int_\frac{-T}{2}^\frac{T}{2} \ f(t)cos(\frac{2 \pi nt}{T})dt \\ \ \ \ \ \ \ = \frac{2}{2\pi}\int_{-\pi}^\pi \ f(t)cos(\frac{2 \pi nt}{2\pi})dt \\ \ \ \ \ \ \ = \frac{1}{\pi}(\int_{-\pi}^\frac{-\pi}{2} \ 0.cos(nt)dt + \int_\frac{-\pi}{2}^\frac{\pi}{2} \ \pi.cos(nt)dt + \int_\frac{\pi}{2}^{\pi}\ \ 0.cos(nt)dt) \\ \ \ \ \ \ \ = \frac{2}{\pi}(\int_0^\frac{\pi}{2} \ \pi.\cos(nt)dt) \\ \ \ \ \ \ \ = 2\int_0^\frac{\pi}{2} \cos(nt)dt \\ \ \ \ \ \ \ = 2[\frac{sin(nt)}{n}]_0^\frac{\pi}{2} \\ \ \ \ \ \ \ = 2\frac{sin(n\frac{\pi}{2})}{n}$

$B_N = 0$ Since EVEN

$a_o$ does not = 0 since there is DC shift of $\pi$/4.

$a_0 = \frac{2}{T}\int_\frac{-T}{2}^\frac{T}{2} \ f(t)dt\ \\ \ \ \ \ = \pi$ • if we suppose that the period of $f$ is $2\pi$ and since the function is not given in $(-\pi,0)$ we may perhaps suppose 1) that the function is even and produces a Fourier Cosine Series and 2) that the function is odd producing a Fourier Sine Series (that is two distincts problems!). – Raymond Manzoni Jun 19 '12 at 22:44
• @Raymond Manzoni Thanks, I'll give it a go now – Synia Jun 19 '12 at 23:17
• I am glad it helped! – Raymond Manzoni Jun 19 '12 at 23:27
• @RaymondManzoni Thanks for your help, I have now worked out half the question for when it's Even, but what would f(x) be like when it is Odd? – Synia Jun 19 '12 at 23:54
• In the odd case you'll have $f(t)=-\pi/2$ when $-\pi/2<t<0$, and $f(t)=0$ when $-\pi<t<-\pi/2$. When integrating, use the fact that $\int_{-\pi}^\pi f(t)\sin nt\,dt=2\int_{0}^{\pi/2} f(t)\sin nt\,dt$ because the product of two odd functions is even. – user31373 Jun 20 '12 at 0:17

As discussed in comments: there are two natural extensions of a function on $(0,\pi)$ to the larger interval $(-\pi,\pi)$.
In both cases the coefficients can be computed by integration over $(0,\pi)$, as stated on the pages linked above.