# Expanding Fourier Series of $f(x)=\pi-x$ where $0<x<\pi$ (even and odd)

6,905

$a_0=\frac{4}{T}\int_{0}^\frac{T}{2}f(x)=\frac{4}{2\pi}\int_{0}^\pi \pi-x=\pi x-\frac{x^2}{2}|_0^\pi=\pi$

$$a_n=\frac{4}{T}\int_{0}^\frac{T}{2}f(x)\cos\frac{2\pi nt}{T} =\frac{4}{2\pi}\int_{0}^\pi (\pi-x)\cos nx=\frac{2}{\pi}(\frac{\pi}{n}\sin nt-\frac{x}{n}\sin nt+\frac{1}{n^2}\cos nt)|_0^\pi=\frac{2}{n^2\pi}((-1)^n-1)$$ so $a_n=\dfrac{-4}{\pi n^2}$ for even $n$ and $0$ for odd $n$.

for $\sin$

$$b_n=\frac{4}{T}\int_{0}^\frac{T}{2}f(x)\sin\frac{2\pi nt}{T} =\frac{2}{n}$$

Share:
6,905
Author by

I'm the student of BSc. on Tabriz technical collage on "Computer technology engineering". Mainly our mathematical courses are about "Engineering mathematics" (Fourier series , Integration's , so on ) and "Discrete Mathematics" (indirect proof,inference ,so on)

Updated on October 22, 2020

Please help me solve this Fourier series and correct my solution if it is wrong. it's a non-periodic function which we need to write its Fourier series (even and odd) :

$f(x)=\pi - x$ ; $0<x<\pi$

I have reached cosine extension(even) as follows:

$\phi(x)= \begin{cases} \text{$\pi-x$;$0<x<\pi$},\\ \text{$x-\pi$;$-\pi<x<0$} \end{cases}$

My result was $a_{0}=\pi$ and

$a_{n}= \begin{cases} \text{$\dfrac{-4}{\pi n^2}$; if$n$is even}\\\text{0 ; if$n$is odd} \end{cases}$

and I have found follows for sinus extension(odd) :

$\phi(x)= \begin{cases} \text{$\pi-x$where :$0<x<\pi$},\\ \text{$-\pi-x$where :$-\pi<x<0$} \end{cases}$

$a_{0}=0$ and $b_{n}=\dfrac{-2}{n}$ .

Are you intending to create a discontinuity at $x=0$? I wonder if you've misunderstood the original problem.
yes we didn't assume $x$ in all examples of classroom.
Your first and second $\phi(x)$ are completely different functions with different fourier expansions. Perhaps you meant $\phi(x)=-x$ for the part between $-\pi$ and 0?
The given equation is not a periodic function so we need to assume that it is but with a little differences which $a_{n}=0$ on $sin$ and $b_{n}=0$ on $cos$.
Do you intend to have an even or odd extension, with period $2\pi$?
of course I mean $cos$ for even and $sin$ for odd