We will start by computing the Fourier sine series. The Fourier sine series of is given by
where
for
Here, we have and . So

Integrate by parts using


we get that
![{\displaystyle {\begin{aligned}b_{n}&=2[{\frac {-x}{n\pi }}\cos(n\pi x)|_{0}^{1}+{\frac {1}{n\pi }}\int _{0}^{1}\cos(n\pi x)\;dx]\\&=2[{\color {blue}{\frac {-x}{n\pi }}\cos(n\pi x)|_{0}^{1}}+{\color {Brown}({\frac {1}{n\pi }})^{2}\sin(n\pi x)|_{0}^{1}}]\\&=2[{\color {blue}{\frac {-1}{n\pi }}\cos(n\pi )+0}+{\color {Brown}({\frac {1}{n\pi }})^{2}\sin(n\pi )-({\frac {1}{n\pi }})^{2}\sin(0)}].\end{aligned}}}](https://wiki.ubc.ca/api/rest_v1/media/math/render/svg/a9ae0fe8ba9c51179a1d24b6b65351fd1b175b8a)
Since and , we get that

for
Therefore, the Fourier sine series of is

Next, we will find the Fourier cosine series. The Fourier cosine series of is given by

where
for
With and ,

When we have that =1 and so we have two distinct cases for evaluating the integral; when and when . For the case where , integrate by parts using


we get that
Since , we get that
![{\displaystyle a_{n}=2[({\frac {1}{n\pi }})^{2}\underbrace {\cos(n\pi )} _{=(-1)^{n}}-({\frac {1}{n\pi }})^{2}\underbrace {\cos(0)} _{=1}]=2({\frac {1}{n\pi }})^{2}[(-1)^{n}-1]\;\;}](https://wiki.ubc.ca/api/rest_v1/media/math/render/svg/36c02c9c903aa3add9af62cbdbd8e066e9bb2f98)
for
Now for the case where , we get

Therefore, the Fourier cosine series of is
![{\displaystyle Cf(x)={\frac {a_{0}}{2}}+\sum _{n=1}^{\infty }a_{n}\cos(n\pi x)={\frac {1}{2}}+\sum _{n=1}^{\infty }2({\frac {1}{n\pi }})^{2}[(-1)^{n}-1]\cos(n\pi x).}](https://wiki.ubc.ca/api/rest_v1/media/math/render/svg/48c7db69965ab23bbe46c097d94d6b4b2a578b68)
|