I found the coefficients of the Fourier series. The partial sum of the Fourier series is defined on the interval $[0,2\pi]$ by
$$S_N(x) = \frac{a_0}{2} + \sum_{n=1}^{N}[ a_n \cos(nx) + b_n \sin(nx)],$$
where
$$a_0 =\frac{1}{\pi} \int_{0}^{2\pi} f(x)\, dx, $$ $$a_n = \frac{1}{\pi} \int_{0}^{2\pi} f(x) \cos(nx)\, dx,$$ $$b_n =\frac{1}{\pi} \int_{0}^{2\pi} f(x) \sin(nx)\, dx.$$
Is there any way to put all the coefficients in the partial sum and to derive the function? I struggled after I put everything in one equation to see if it can be simplified more.
Your help is greatly appreciated!