$T=2$ $$f(x) = \begin{cases} 1, & \text{$-\frac12\le x \le\frac12$} \\[2ex] |2x|, & \text{$\frac12 < x \le1\frac12$} \\ \end{cases}$$
The image:

I found that $a_0=\frac12$. Since function is even, $b_n=0$.
However, I struggle one $a_n$. Here's how I try to find it:
$$a_n=\frac1l\int_{-l}^lf(x)cos(n\pi x)dx=\int_\frac{-1}2^\frac12|2x|cos(n\pi x)dx + \int_0^1cos(n\pi x)dx$$.
But in the end, I get ssomething like $sin(\frac{n\pi}2)$ which is indeterminate as $n$ varies.
Could you please help me? Is there a mistake somewhere or am I trying to solve this in a incorrect way?
And also there's another task. Write partial sum of members of Fourier series, whose coefficients' absolute value is more than $0,15$. How do I proceed here?
Hint 1: You only need to solve the indefinite integral $$\int x\cos(ax)$$ where $a$ is a constant.
You can solve this integral using integration by parts.
Hint 2: For your integral remember to divide the integral to two integrals (where the sign of $x$ is known)