Estimate how many terms of this Fourier series are needed to approximate the given function with an accuracy of $0.01 = 10^{-2}$. $$f\left(x\right) = \left\{
     \begin{array}{lr}
       |x|, &  x \in [-2,2]\\
       f(x+4k), & \text{otherwise}
     \end{array}
   \right.\\$$
where in the second case $k \in \mathbb{Z}$ is chosen so that $x+4k \in [-2,2]$.
Now I've already sketched this function and found its Fourier series as per parts (a) and (b) of the question. However, part (c) has me completely stumped. It asks:
Estimate how many terms of this Fourier series are needed to approximate the given function with an accuracy of $0.01 = 10^{-2}$. Assume that you can measure the error of an approximation by the maximal absolute value of the first discarded term in the series.
I don't really understand what the question means by this. Also I've found the Fourier series of the function to be:
$$1 - 8\sum_{n=1}^{\infty} \frac{1}{(2n+1)^2\pi^2}\cos\left(\frac{(2n+1)\pi x}{2}\right)$$
Assuming this is correct, how can go about finding the error?
Thank you for taking the time.
 A: I don't want to hijack your question but I'm guessing your deadline is also coming up Monday so I'll be quick. I think ''maximal'' has got to be a misspelling, right? Anyways, we got slightly different formulas for f(x). For $a_n = \frac{8}{n^2\pi^2}[n\pi sin (n\pi) + cos (n\pi) -1]$ we have $a_n$=0 for even n and $a_n=\frac{-16}{n^2\pi^2}=-(\frac{4}{n\pi})^2$ for odd n so when I expanded my series I had only coefficients of the form (-) $[\frac{4}{(2n+1)\pi^2}]^2$ and the cos $n\pi x/L$ == cos $(2n+1)\pi x /2$. Sorry for the bad layout I have only just lurked on this website before. 
A: After you Corrected your Fourier series as Claudia Molina hinted at in her answer/comment, ($n$ vs. $(2n+1)$ in the cosine argument), the partial sums give indeed the correct approximations

and the errors over a period look like this

Stopping the series at index $n$, the next term has a coefficient and thus maximal value of $-\dfrac8{(\pi(2n+3))^2}$. To get that below the given error level needs $2n+3\ge\frac{20\sqrt2}{\pi}=9.00316316..$, thus $n>3$. With $n=4$ being the first line in the previous graph, one can see that the error is above the given error level around the kinks of the function. This error bound works best at points where the series is mostly alternating, here best around $x=\pm 1$
A more strict estimate of the error also covers the point where the cosine terms have all the same sign, that is around $x=0,\pm2,\pm4,...$, would use that
$$
\sum_{k>n}\frac1{(2k+1)^2}\le \sum_{k>n}\frac1{4k(k+1)}=\frac1{4(n+1)}
$$
so that the error of the partial sum of the Fourier series is bounded by $\dfrac2{\pi^2(n+1)}$ so $n+1\ge\frac{200}{\pi^2}=20.2642$, $n\ge 20$. The error graph for the partial sums around this index confirm this error bound.

