Problem calcualting Fourier coeff. of tent function. Consider the tent-function on $[-\pi,\pi]$ depending on some $\delta$. I.e
$(1-\frac{\mid x \mid}{\delta})$, $x$ is zero when larger then $\delta$
When I compute $\int_{-\delta}^{\delta}(1-\frac{x}{\delta})e^{-inx}dx$ then I dont get the proper cancelations, but if I consider the evenness of the tent function and compute $\int_{-\pi}^{\pi}(1-\frac{x}{\pi})cos({nx})dx$ I get the proper result. Am I doing something wrong when computing the integrals or is there somthing else making the cancelation not happening in the first integral?
I get ; $\int_{-\delta}^{\delta}(1-\frac{x}{\delta})e^{-inx}dx$ $=\frac{e^{in\delta}}{-in}- \frac{e^{-in\delta}}{-in}$ $-\frac{e^{in\delta}}{-\delta in}\delta -\frac{e^{-in}}{-\delta in }\delta  +\frac{e^{in\delta}}{\delta n^2} - \frac{e^{in\delta}}{\delta n^2}$

You simply forgot the modulus, when performing the calculation, since on $[-\delta,0]$ we have that $1-\frac{|x|}{\delta}=1+\frac{x}{\delta}$
Notice that whenever we have a continuous and even function $f$, then computing the Fourier series you will always end up with Cosinus series, since the odd waves will be cancelled out.
This can be proved by splitting up the integral an doing the change of variable $x\mapsto -x$ in the following way $$a_{n}=\frac{1}{2\pi}\int_{-\pi}^{0}f(x)\,e^{-inx} \, dx+\frac{1}{2\pi}\int_{0}^{\pi}f(x)\,e^{-inx} \, dx=$$ $$ \frac{1}{2\pi}\int_{0}^{\pi}f(-x)\,e^{inx} \, dx + \frac{1}{2\pi}\int_{0}^{\pi}f(x)\,e^{-inx} \, dx = $$ $$\frac{1}{2\pi}\int_{0}^{\pi}f(x)\, \left(e^{inx}+e^{-inx}\right) \, dx = \frac{1}{\pi}\int_{0}^{\pi}f(x)\,\cos(nx) \, dx $$
