I am having trouble calculating the $a_n$ coefficient for when $n=1$ for the following function. The function $f(x)$ is periodic with period 2 pi, and is defined on the interval $-\pi<x<\pi$ by $\cos(x)$Heaviside$(\pi^2 - 4x^2)$
I am calculating an answer of 1, whereas the answer I am provided with is 1/2. My Method is as follows: Using $a_n = 2/2\pi$ integral of $(1+\cos2x) dx$ between the limits $-\pi/2$ and $\pi/2$. Therefore as the function is even, I have doubled the constant outside the integral and halved the limit, therefore meaning my final integral is
$2/\pi$ integral of $(1+\cos(2x)) dx$ from $0$ to $\pi/2$ producing an answer of $1$. Am I correct with my approach and if not why? Sorry about the poor formating.
$$\int^R_{-R} Even(x)dx\neq2\int^{\frac R2}_{-\frac {R}{2}} Even(x)dx$$
$$\int^R_{-R} Even(x)d=2\int^R_0 Even(x)dx$$
If I understood it correctly