0

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?

GRS
  • 2,495
  • The arguments of the sine and cosine functions are missing a factor of 2. Then all $c_n$ vanish except for $c_0$. – iolo Apr 03 '16 at 21:22
  • @iolo could you please expand on this? – GRS Apr 03 '16 at 21:25
  • The formulae are wrong without the additional factor of 2. With it, the integrals are over full periods of oscillation and hence zero. – iolo Apr 03 '16 at 21:31
  • Do you mean the 2 from $2/L$ factor? For my case $L=5$, hence I have $2/5$, isn't that the factor of $2$? Or should I remove it? I'm a bit consufed – GRS Apr 03 '16 at 21:36
  • No that one is correct. But it should be $sin ; 2 \pi n x / L$ and the same for cos. – iolo Apr 03 '16 at 21:38

1 Answers1

2

The Fourier series is just $f(x) = 1$. Recall, the Fourier series on $[-L, L]$ is given by $$f(x) = a_0 + \sum_{n} a_n \cos\left(\tfrac{n\pi x}{L} \right) + b_n\sin\left(\tfrac{n\pi x}{L} \right).$$ If you compute the coefficients using the integral fomulas, you'll find $a_0 = 1$, $a_n = b_n = 0$ for $n \ge 1$.

The whole idea of a Fourier series is to take a locally defined function and extend it periodically so that it is defined everywhere. It doesn't really make sense to take the Fourier series on $(-\infty, \infty)$. I think you may want to look into the Fourier transform. The Fourier transform can be is the analog to the Fourier series for a function defined on all of $(-\infty, \infty)$. But you're right, you need to think about the integrals converging. Indeed, for a function $f$, we define the Fourier transform of $f$ (sometimes denoted $\hat f$) by $$\hat f(\xi) = \int_{\mathbb R} e^{-2\pi i x \xi} f(x) dx.$$ Sometimes the definition is slightly different; for example, the $2\pi$ may not show up in the exponential and a constant may appear out front of the integral. Here, the integral will only exist if $$\int_{\mathbb R} \lvert f(x) \rvert dx < \infty.$$ Thus, for example, $f(x) = 1$ and $f(x) = x$ do not have Fourier transforms. But functions like $f(x) = e^{-\lvert x \rvert}$ and $f(x) = \frac{\sin^2(x)}{x^2}$ do have Fourier transforms. I'm sure if you google it, you can find many great resources to learn about this topic and its connection to Fourier series.

User8128
  • 15,485
  • 1
  • 18
  • 31
  • I see, what if I wanted to find $f(x)=x$, would it be possible to do it? will I need to take $\lim L \rightarrow \infty$, in which case, I won't be able to integrate to find the coefficients – GRS Apr 03 '16 at 21:24
  • Fourier series only make sense for periodic functions. – iolo Apr 03 '16 at 21:35
  • I added some info in my answer above. Let me know if you have any more specific questions and I can try to help. – User8128 Apr 03 '16 at 21:36
  • @User8128 thanks a lot, so does fourier series take a local function $f(x)$ on $(0,5)$, and extend it to $(-\infty, \infty)$? That would mean that after I find the $f(x)=c_0+\sum c_n \cos {n \pi x/5}$, it is also valid for $x$ outside $(0,5)$?. I am going to read up about fourier transforms before I can ask more questions :) – GRS Apr 03 '16 at 21:41
  • Note that there is a notion of Fourier transform for non-integrable functions, but it requires distribution theory to formulate it. – Ian Apr 03 '16 at 21:44
  • 1
    Sure, if you take the function $f(x)=x$ on $(0,5)$ and write out the cosine series, it will look like an even extension of $f$ to the whole line. If you wrote out the sine series, it would look like an odd extension of $f$ To the whole line. – User8128 Apr 03 '16 at 21:49
  • 1
    @Ian yes, good note! I thought it best to give the simplest existence criterion (i.e., integrability). Of course more generally, $f \in L^p( \mathbb R)$ will also work and we'll still have a true Fourier transform, or as you've pointed out, we can treat this all in the distributional sense. – User8128 Apr 03 '16 at 21:52