I am trying to approximate the line $y=1$ by fourier series. I can see a lot of examples where we define the domain for $x$.
However, Is it possible to define the series everywhere?
For example if $f(x)=1$ on $(0,5)$.
I can find the sine series $f(x)=\sum c_n \sin \frac{n\pi x}{5}$, where
$$c_n=2/5\int_0^5 \sin \frac{n\pi x}{5} dx$$
Similarly I can use cosine to find: $f(x)=c_0+\sum c_n \cos \frac{n\pi x}{5}$, where
$$c_0=1/5\int_0^5 dx$$ and $$c_n=2/5 \int_0^5 \cos \frac{n\pi x}{5} dx$$
Is the above correct? That is I can use both, the sine or cosine on the $(0,5)$ interval.
However, if I extend the interval to $(-\infty, \infty) $ , since $f(x)=1$ is an even function, I will only get cosine terms.
Can somebody show me how to write the $f(x)=1$ for all $x$ in fourier series?