Fourier Series for $f(x)=x^4$ when $x \in (-\pi, \pi)$

9.7k Views Asked by At

How can we find the Fourier Series for the function $f(x)=x^4$ when $x \in (-\pi, \pi)$?

Could someone give me a hint on how to start this question? I'm a bit stuck; it's a while since I've learned about Fourier series.

3

There are 3 best solutions below

0
On BEST ANSWER

We may start with the Fourier sine series of a sawtooth wave: $$ \forall x\in(-\pi,\pi),\qquad x=\sum_{n\geq 1}\frac{2(-1)^{n+1}\sin(nx)}{n}\tag{1} $$ and apply three times termwise integration. At the first step we get: $$ \frac{x^2}{2}=\sum_{n\geq 1}\frac{2(-1)^{n+1}(1-\cos(nx))}{n^2}\tag{2.1} $$ from which: $$ \forall x\in(-\pi,\pi),\qquad x^2 = \frac{\pi^2}{3}-\sum_{n\geq 1}\frac{4(-1)^{n+1}\cos(nx)}{n^2}\tag{2.2} $$ where the $\frac{\pi^2}{3}$ term comes from $\frac{1}{2\pi}\int_{-\pi}^{\pi} x^2 dx$ and: $$ \forall x\in(-\pi,\pi),\qquad x^3= 2\pi^2\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}\sin(nx)-12\sum_{n\geq 1}\frac{(-1)^{n+1}}{n^3}\sin(nx)\tag{3.2} $$ Integrating again, we get: $$ \forall x\in(-\pi,\pi),\qquad x^4 = C-8\pi^2\sum_{n\geq 1}\frac{(-1)^{n+1}}{n^2}\cos(nx)+48\sum_{n\geq 1}\frac{(-1)^{n+1}}{n^4}\cos(nx)\tag{4.1} $$ where the constant $C$ has to be the mean value of the function $f(x)=x^4$ over the interval $(-\pi,\pi)$, hence: $$\boxed{\, \forall x\in(-\pi,\pi),\qquad x^4 = \frac{\pi^4}{5}+\sum_{n\geq 1}\left(\frac{48}{n^4}-\frac{8\pi^2}{n^2}\right)(-1)^{n+1}\cos(nx)\,}\tag{4.2} $$ We may get just the same by computing $$ c_n = \frac{1}{\pi}\int_{-\pi}^{\pi}x^4\cos(nx)\,dx $$ through integration by parts, but I think the above method, even if a bit longer, has many interesting by-products; for instance, can you see what happens when we consider the limit as $x\to\pi^-$ of both sides of $(2.2)$ or $(4.2)$? It happens that we find $\zeta(2)=\frac{\pi^2}{6}$ and $\zeta(4)=\frac{\pi^4}{90}$.

0
On

@Jack already provides a very good detailed way to calculate it. There is also a very useful rule for differentiation for the Fourier Transform which can be interpreted as multiplication by $x$ in the other domain (from Wolfram's Mathworld):

$$\frac{d}{dk}\mathcal{F}_x[f(x)](k) = \int_{-\infty}^\infty (-2\pi ix)f(x)e^{-2\pi ik x}dx$$

We then divide both sides $-2\pi i$, set $f(x) = x$ and iterate a few times, baking in a new $x$ into $f$ each time. (The $k$s here would roughly speaking be the $n$s in Jack's expression).

1
On

With a bit of extra work, we can formulate a way to calculate the Fourier series for $x^k$, where $k$ is an arbitrary positive integer.

It's easier to work with the exponential form of the Fourier series (it can always be converted to sines and cosines when needed). In this notation, the Fourier series of $f$ on the interval $(-\pi, \pi)$ is $$f(x)\sim\sum_{n=-\infty}^{\infty}\hat{f}(n) e^{inx}$$ where $(\hat{f}(n))$ are the Fourier coefficients: $$\hat{f}(n) = \frac{1}{2\pi}\int_{-\pi}^{\pi}f(x) e^{-inx} dx$$

We will use the following handy lemma, which can be proved using integration by parts (see, e.g. Theorem 1.6 in Katznelson, An Introduction to Harmonic Analysis).

Lemma: If $f$ is integrable on $(-\pi, \pi)$ and has zero mean, then the Fourier coefficients of $F(x) = \int_0^x f(t) dt$ satisfy $\hat{F}(n) = \frac{1}{in}\hat{f}(n)$ for $n \neq 0$.

Let $f_k(x) = x^k$. We will compute the Fourier coefficients for the "base case" $f_1(x) = x$ from scratch, since $f_1$ is not the integral of a zero-mean function. Since the mean of $f_1$ is zero, its $n=0$ coefficient is zero. For $n \neq 0$, we can integrate by parts to obtain $$\begin{aligned} 2\pi \hat{f_1}(n) &= \int_{-\pi}^{\pi}xe^{-inx} dx \\ &= \left. \frac{1}{-in}x e^{-inx}\right|_{x=-\pi}^{\pi} + \int_{-\pi}^{\pi}e^{-inx}dx \\ &= \frac{1}{-in}(\pi e^{-in\pi} + \pi e^{in\pi}) + 0 \\ &= \frac{2\pi(-1)^n}{-in} \\ &= \frac{2\pi (-1)^{n+1}}{in} \\ \end{aligned}$$ so $$\hat{f_1}(n) = \frac{(-1)^{n+1}}{in}, \qquad n \neq 0$$

Now for $k > 1$, we can use the lemma to compute $\hat{f_k}(n)$ in terms of $\hat{f_{k-1}}(n)$ and $\hat{f_1}(n)$ as follows. Let $m_k$ denote the mean of $f_k$, namely $$m_k = \frac{1}{2\pi}\int_{\pi}^{\pi}f_k(x) dx$$ Then $g_k = f_k - m_k$ has zero mean, so the lemma tells us that for $n \neq 0$, the Fourier coefficients of $G_k(x) = \int_0^x g_k(t) dt$ are $$\hat{G_k}(n) = \frac{1}{in}\hat{g_k}(n) = \frac{1}{in}\hat{f_k}(n), \qquad n \neq 0$$ where the last equality holds because the $n\neq 0$ Fourier coefficients of $f_k$ and $g_k$ are the same, since these functions differ only by the constant $m_k$. Now, note that $$\begin{aligned} G_k(x) &= \int_0^x g_k(t) dt \\ &= \int_0^x (f_k(t) - m_k) dt \\ &= \int_0^x f_k(t)dt - m_k x \\ &= \int_0^x t^k dt - m_k x \\ &= \frac{1}{k+1}x^{k+1} - m_k x \\ &= \frac{1}{k+1}f_{k+1}(x) - m_k f_1(x) \\ \end{aligned}$$ so for $n \neq 0$ we must have $$\frac{1}{in}\hat{f_k}(n) = \hat{G_k}(n) = \frac{1}{k+1}\hat{f_{k+1}}(n) - m_k \hat{f_1}(n)$$ which we can rearrange to obtain $$\hat{f_{k+1}}(n) = (k+1)\left(\frac{1}{in}\hat{f_k}(n) + m_k\hat{f_1}(n)\right), \qquad n \neq 0$$


Let us apply the above to compute the Fourier series for $f_4(x) = x^4$. For $n \neq 0$ we have $$\hat{f_2}(n) = 2\left(\frac{1}{in}\hat{f_1}(n) + m_1\hat{f_1}(n)\right) = 2\left(\frac{1}{in} + m_1\right)\hat{f_1}(n)$$ $$\hat{f_3}(n) = 3\left(\frac{1}{in}\hat{f_2}(n) + m_2\hat{f_1}(n)\right) = 3\left(\frac{1}{in}2\left(\frac{1}{in} + m_1\right) + m_2\right)\hat{f_1}(n)$$ and finally $$\begin{aligned} \hat{f_4}(n) &= 4\left(\frac{1}{in}\hat{f_3}(n) + m_3\hat{f_1}(n)\right) \\ & = 4\left(\frac{1}{in}3\left(\frac{1}{in}2\left(\frac{1}{in} + m_1\right) + m_2\right) + m_3\right)\hat{f_1}(n) \\ &= 4\left(\frac{1}{in}3\left(\frac{1}{in}2\left(\frac{1}{in} + m_1\right) + m_2\right) + m_3\right)\frac{(-1)^{n+1}}{in} \\ \end{aligned}$$ from which the general pattern is clear. This formula can be simplified by observing that for odd $k$, we have $m_k = 0$, since $x^k$ is an odd function. This gives us $$\begin{aligned} \hat{f_4}(n) &= 4\left(\frac{1}{in}3\left(\frac{1}{in}2\left(\frac{1}{in}\right) + m_2\right)\right)\frac{(-1)^{n+1}}{in} \\ &= 4\left(\frac{1}{in}3\left(-\frac{2}{n^2} + m_2\right)\right)\frac{(-1)^{n+1}}{in}\\ &= 4\left(-\frac{6}{in^3} + \frac{3}{in}m_2 \right)\frac{(-1)^{n+1}}{in}\\ &= \left(\frac{24}{n^4} - \frac{12}{n^2}m_2\right)(-1)^{n+1}\\ \end{aligned}$$ Finally, $$m_2 = \frac{1}{2\pi}\int_{-\pi}^{\pi}x^2 dx = \frac{1}{\pi}\int_0^{\pi}x^2 dx = \frac{\pi^2}{3}$$ which gives us $$\hat{f_4}(n) = \left(\frac{24}{n^4} - \frac{4\pi^2}{n^2}\right)(-1)^{n+1}, \qquad n \neq 0$$ and $$\hat{f_4}(0) = \frac{1}{2\pi}\int_{-\pi}^{\pi}x^4 dx = \frac{1}{\pi}\int_0^{\pi}x^4 dx = \frac{\pi^4}{5}$$ Thus, the Fourier series for $x^4$ in exponential form is $$f_4(x) \sim \frac{\pi^4}{5} + \sum_{n \neq 0}\left(\frac{24}{n^4} - \frac{4\pi^2}{n^2}\right)(-1)^{n+1} e^{inx}$$ As $2\cos(nx) = e^{inx} + e^{-inx}$, we may group the $n$ and $-n$ terms to obtain the equivalent cosine series $$f_4(x) \sim \frac{\pi^4}{5} + \sum_{n > 0}\left(\frac{48}{n^4} - \frac{8\pi^2}{n^2}\right)(-1)^{n+1}\cos(nx)$$ which agrees with the more pithy answer given by Jack D'Aurizio.

In principle, this procedure can be continued to obtain the coefficients for any $f_k(x) = x^k$.