I'm working on a course problem,
Calculate the Fourier series of the periodic function $f(t)$ with fundamental period $T=4$ defined on $[-2,2)$ by $$f(t)= \begin{cases}1-|t|&-1\leq t\leq1 \\0&\text{otherwise.}\end{cases}$$
I get $$\text{even function}\implies\text{cosine series}\implies f(t)=\frac{1}{4}+\sum_{n=1}^\infty\frac{1-\cos(n)}{n^2}f(t)\cos(t).$$ (Integration working omitted.) Does that count as calculating the Fourier series, or do I need to do anything more?
Update: Second attempt.
$$f(t)=\frac{1}{2}+\frac{8}{\pi^2}\sum_{p=1}^\infty\frac{1}{(2p-1)^2}\cos\left((2p-1)\frac{2\pi}{4}t\right)+\frac{2}{(4p-2)^2}\cos\left((4p-2)\frac{2\pi}{4}t\right).$$
Assuming I have no made any mistakes, there are a few errors in your formula.
I would be more explicit about the steps involved as it makes it easier to see where mistakes are made later.
The first term should be the average, which you can see graphically to be ${1 \over 4}$.
The remaining terms are given by $A_n = {2 \over T} \int_0^T f(t) \cos ( n {2 \pi \over T}) dt$ where $f$ is $T$ periodic.
$A_n = {1 \over 2} \int_{-1}^1 (1-|t|) \cos ( n { \pi \over 2} t) dt = \int_0^1(1-t) \cos ( n { \pi \over 2} t) dt = {1 - \cos (n {\pi \over 2}) \over n ({ \pi \over 2})^2 } = {4 \over \pi^2}{1 - \cos (n {\pi \over 2}) \over n }$.
Note that for $n=1,2,3,4,...$ we have $1 - \cos (n {\pi \over 2}) = 1,2,1,0,...$, and so
\begin{eqnarray} f(t) &=& {1 \over 4} + {4 \over \pi^2}(\sum_{p=1}^\infty (\text{terms with }n=2p-1) + \\ &\ \ \ \ \ & 2\sum_{p=1}^\infty (\text{terms with }n=4p-2) ), \end{eqnarray}
which gives
$f(t) = {1 \over 4} + {4 \over \pi^2}\sum_{p=1}^\infty ( {1 \over 2p-1}\cos ((2p-1) {\pi \over 2}t)+ {2 \over 4p-2}\cos ((4p-2) {\pi \over 2}t)$.