1

Consider a function such as

$sin^3 (x) cosx$

How would one find the Fourier series of this?

I have read of Fourier trick from a physics book "electricity and magnetism by Griffith" where he goes over solving laplace equation using a Fourier trick. And there it seems that the principle works due to ideas related to solutions of differential equations. However how would one apply this to some periodic function?

I have seen the formula of Fourier series,however I can not understand the idea behind each term. IF someone cone could provide a simple intuitive explanation of it, it would be awesome

  • Well, this is an odd function and thus its Fourier series will only contain sines...so it's easier. And you must define on what interval and under what conditions (I'm assuming a usual, standard interval such as $;[-\pi,\pi];$ , say. – DonAntonio May 24 '20 at 11:06
  • How do we choose an interval? I'm new to this

    I know that two functions are orthogonal if their product integral over interval is 0 and hence -pi to pi is chosen. However what interval would you recommend? is there better intervals?

    – tryst with freedom May 24 '20 at 11:11
  • Well, if you say you know that then that's the interval. The interval is usually given, unless you're an applied physicist measuring stuff and deducing your own parameters. But there are many other intervals, that could be only positive/negative intervals. Sometimes one needs to extend a function's definition in order to make it periodic...The first outset of a problem could be: let $;f;$ be a periodic function over an interval of the form $;[-L,L];$, such that it is Riemann integrable over it, then we can define...and etc. – DonAntonio May 24 '20 at 11:34
  • And, of course, there are the powerful complex Fourier series and the real ones...but at the beginning it is usually first taught the real ones. – DonAntonio May 24 '20 at 11:36
  • So, would this fourier representation of functions only hold for the interval we the integrate over? – tryst with freedom May 24 '20 at 11:40
  • 1
    Exactly...and that's enough, and many times pretty nice, in most cases. For example, for $;x^2\in[-\pi,\pi];$ we have $$x^2=\frac{\pi^2}3+4\sum_{n=1}^\infty (-1)^n\frac{\cos nx}{n^2}$$ Since $;x^2;$ made periodic over the above interval is continuous, you can now substitute $;x=\pi;$ in the above and get a very nice and famous infinite sum... – DonAntonio May 24 '20 at 11:57
  • That is some nice intuition ty – tryst with freedom May 24 '20 at 12:49
  • @DDD4C4U I am not exactly sure what is your question but I provided an answer. Let me know if that is what you meant. – lcv May 25 '20 at 01:44

2 Answers2

2

As Don Antonio as spoken about, Fourier series exist for periodic functions. However, if you are only trying to represent a function $f$ on a finite interval $[a,b]$, you can just pretend that $f$ is periodic and $[a,b]$ is contained in one period.

For simplicity, assume that $f$ has period $2\pi$, and you want to represent it on $[-\pi, \pi]$. If $f$ is representable as a Fourier series, then $$f(\theta) = \sum_{n=0}^\infty A_n\cos n\theta + \sum_{n=1}^\infty B_n\sin n\theta$$

Now there are some useful trigonometric integral formulas for integer $m,n$: $$\int_{-\pi}^\pi\cos n\theta\,d\theta = \begin{cases}0& n \ne 0\\2\pi & n = 0\end{cases}$$ $$\int_{-\pi}^\pi\sin n\theta\,d\theta = 0$$ $$\int_{-\pi}^\pi\cos n\theta\cos m\theta\,d\theta =\int_{-\pi}^\pi\sin n\theta\sin m\theta\,d\theta = \begin{cases}0& n\ne m\\\pi & n = m\ne 0\end{cases}$$ $$\int_{-\pi}^\pi\cos n\theta\sin m\theta\,d\theta = 0$$ (Because sine and cosine are periodic, these actually hold for any interval of integration of width $2\pi$.) This happens because other than the exceptional cases, the integrands are all sinusoidal with $y=0$ as the midline, and symmetry matches the area below the midline to the area above, so it all cancels out.

So if we integrate $$\begin{align}\int_{-\pi}^\pi f(\theta)\,d\theta &= \sum_{n=0}^\infty A_n\int_{-\pi}^\pi\cos n\theta\,d\theta + \sum_{n=1}^\infty B_n\int_{-\pi}^\pi\sin n\theta\,d\theta \\&= 2\pi A_0 + 0\end{align}$$ and for $m > 0$, $$\begin{align}\int_{-\pi}^\pi f(\theta)\cos m\theta\,d\theta &= \sum_{n=0}^\infty A_n\int_{-\pi}^\pi\cos n\theta\cos m\theta\,d\theta + \sum_{n=1}^\infty B_n\int_{-\pi}^\pi\sin n\theta\cos m\theta\,d\theta\\&=A_m\pi + 0\end{align}$$ $$\begin{align}\int_{-\pi}^\pi f(\theta)\sin m\theta\,d\theta &= \sum_{n=0}^\infty A_n\int_{-\pi}^\pi\cos n\theta\sin m\theta\,d\theta + \sum_{n=1}^\infty B_n\int_{-\pi}^\pi\sin n\theta\sin m\theta\,d\theta\\&=0 + B_m\pi\end{align}$$

So you can find the coefficients by $$A_0 = \frac 1{2\pi} \int_{-\pi}^\pi f(\theta)\,d\theta\\ A_m = \frac 1\pi \int_{-\pi}^\pi f(\theta)\cos m\theta\,d\theta, \quad m > 0$$ and $$B_m = \frac 1\pi \int_{-\pi}^\pi f(\theta)\sin m\theta\,d\theta, \quad m > 0$$

For functions with different periods, you just have to introduce a scaling factor.

Paul Sinclair
  • 43,643
  • beautiful answer.

    I think for clarity sake it would have been a constant term on right side when you integrate f($\theta$) from $-\pi$ to $\pi$

    Can you elaborate on scaling factor thing?

    Also when does a Fourier series hold for all 'x' belong to R

    – tryst with freedom May 25 '20 at 08:28
  • A Fourier series holds on all $\Bbb R$ for periodic functions. If your function on $\Bbb R$ is not periodic, then you cannot represent it by a Fourier series. However, the concept generalizes to Fourier transforms, which can include non-periodic functions. – Paul Sinclair May 25 '20 at 12:43
  • As for the scaling factor: If $f(x)$ is function of period $P$, then $g(x) = f\left(\dfrac P{2\pi}x\right)$ is a function of period $2\pi$. It satisfies the description in my post. Once you have the Fourier series for $g$, the reverse transformation $f(x) = g\left(\dfrac {2\pi}P x\right)$ gives you the Fourier series for $f$. Doing this for the $A_m, B_m$ formulas I gave provides the more general formulas you see in the various sources. – Paul Sinclair May 25 '20 at 12:50
  • One other comment: You can exploit the relationship $e^{i\theta} = \cos \theta + i\sin\theta$ to express the Fourier series as $$\sum_{n=-\infty}^\infty C_ne^{in\theta} = \sum_{n=-\infty}^\infty C_nz^n$$ where $z = e^{i\theta}$. So Fourier series are just complex power series evaluated on the unit circle. – Paul Sinclair May 25 '20 at 12:55
  • can you elaborate, on the "complex power series on unit circle" part.. but again amazing answer – tryst with freedom May 26 '20 at 06:24
  • what does it mean to find power series on the unit circle – tryst with freedom May 26 '20 at 06:24
  • Actually I mispoke a bit. A series of the form "$\sum_{n=-\infty}^\infty C_nz^n$" is called a "Laurent series". If it were the sum from $n = 0$ (or some positive start) to $\infty$, then it would be a "power series". It is complex because $z$ can be a complex number, as can the coefficients $C_n$. To be a Fourier series, we are restricting $z = e^{i\theta}$ for real values $\theta$. Such $z$ all lie on the unit circle about the origin: $|z| = 1$. And every $z$ on the unit circle can be expressed in this way. So a Fourier series is a Laurent series evaluated on the unit circle. – Paul Sinclair May 26 '20 at 23:59
  • what would it mean to have a complex angle – tryst with freedom May 27 '20 at 07:45
  • $z$ is complex, not $\theta$. – Paul Sinclair May 27 '20 at 10:38
0

Computing a Fourier series is about expanding a function into linear combination of exponentials (or sines and cosines) with frequencies which are multiple of a dominant one.

But your function is already in this form, just a little in disguise perhaps:

\begin{align} \sin(x)^3 \cos(x) &= \left ( \frac{e^{ix} - e^{-ix}}{2i} \right)^3 \left ( \frac{e^{ix} + e^{-ix}}{2}\right) \\ &= \frac{1}{8} i e^{-2 i x}-\frac{1}{8} i e^{2 i x}-\frac{1}{16} i e^{-4 i x}+\frac{1}{16} i e^{4 i x} \\ &= \frac{1}{4} \sin (2 x)-\frac{1}{8} \sin (4 x) \end{align}

Added

I see that this was not exactly what you were asking, which is a bit vague. You mention a trick used to solve differential equations with Fourier methods.

One trick that is commonly used in this context is the following, perhaps better explained with Fourier integral transform. It boils down to the following fact. Given

$$ \mathcal{F}(f)(k) = \int_{-\infty}^\infty dx \frac{e^{-ikx}}{\sqrt{2\pi}} f(x) $$

Then for sufficiently nice $f$ (i.e. $f\in\mathscr{S}$)

\begin{align} \left (i \frac{d}{dk} \right )^n \mathcal{F}(f) &= \mathcal{F}( x^n f(x)) \\ \mathcal{F} \left ( \left ( -i \frac{d}{dx} \right )^n f \right)(k) &= k^n \mathcal{F}(f)(k) \end{align}

With these formulae one can transform a (partial) differential equation to an algebraic equation. This is how Fourier solved the heat equation.

lcv
  • 2,506
  • The first method I liked but I am trying to generalize that. I am not trying to answer form any arbitrary function just trying to compute the series of a periodic function in terms of sines and cosines – tryst with freedom May 25 '20 at 08:19