Consider the function f(x) = |x|
$ - π \leq x < π $
Compute its Fourier series.
$ a_{0} = \frac{1}{π} \int_{-π}^{π}|x| dx = \frac{2}{π} \int_{0}^{π} x dx $
I get the answer to be pi,
I am having trouble working out an
$ a_{n} = \frac{2}{π} \int_{0}^{π} x \cos \left(nx\right) dx $
doing integration by parts I get
$ \frac{x\sin \left(nx\right)}{n} + \frac{\cos \left(nx\right)}{n^{2} }$
Is this so far correct ?