I have been given this to solved:
$$f(x) = \begin{cases}x & \text{if }0<x<\pi/2, \\ \pi-x & \text{if }\pi/2<x<\pi. \end{cases}$$
My attempt:
2l=$\pi$ so l=$\pi$/2
$$a_n=\frac{4}{\pi}\int_0^{\pi}f(x)\cos(2 n x)dx=\frac{4}{\pi}\int_0^{\pi/2}x\cos(2 n x)dx$$
The first integral gives me: $$\frac{-1}{n^2 \pi}{((-1)^n-1)}.$$
Also I get $a_0$ = ${\pi^2}/8$.Are these correct
Also the function is discontinious and I know only to solve for continious function..Pls help