# Find the Fourier Coefficients

Gold Member
Homework Statement:
Find the Fourier Coefficient
Relevant Equations:
##f:[0,1]\rightarrow \mathbb{R}## given by
$$f(x)=x^2$$
Consider the function ##f:[0,1]\rightarrow \mathbb{R}## given by
$$f(x)=x^2$$

(1) The Fourier coefficients of ##f## are given by
$$\hat{f}(0)=\int^1_0x^2dx=\Big[\frac{x^3}{3}\Big]^1_0=\frac{1}{3}$$
$$\hat{f}(k)=\int^1_0x^2e^{-2\pi i k x}dx$$

Can this second integral be evaluated?

vela
Staff Emeritus
Homework Helper
Why couldn't it be? I don't see what potential problem you're thinking of.

docnet
pasmith
Homework Helper
Integrate by parts twice.

Delta2 and docnet
Gold Member
@vela @pasmith thank you. Using integration by parts makes perfect sense for the integral.

I am confused about something else.

so... I know how to find the Fourier series of ##f(x)=x^2## over ##[-\pi,\pi]##, and I want to change the domain to ##[0,1]##. Is it okay to do a change of variables using ##x=\pi(2y-1)## and compute the Fourier series in ##y## space?

Not having studied the Fourier series in detail, I am asking silly questions. Could one say that ##[0,1] \subset [-\pi,\pi]## so the series over ##[-\pi,\pi]## contains the Fourier series for the other?

edit: the change of variables using ##x=\pi(2y-1)## scales the domain.

Last edited:
Gold Member
Solution attempt:

Determining the fourier series of a function ##f(x):[0,1]\rightarrow \mathbb{R}##

(1) Theorem: For an even function ##f(x)## over the symmetric range ##[-\pi,\pi]##, the fourier series is given by
$$f(x)\sim \frac{a_0}{2}+\sum_{n=1}^\infty a_k cos(kx)$$ where $$a_k=\frac{2}{\pi}\int^\pi_0f(x)cos(kx)dx$$
For ##f(x)=x^2## we compute the Fourier coefficients $$\int^\pi_0x^2dx=\Big[\frac{x^3}{3}\Big]^\pi_0=\boxed{a_0=\frac{\pi^2}{3}}$$
$$a_k=\int^\pi_0x^2cos(kx)dx=\frac{2}{\pi}\Big[\frac{2xcos(kx)}{k^2}+\Big(\frac{x^2}{k}-\frac{2}{k^3}\Big)sin(kx)\Big]^\pi_0$$
$$=\frac{2}{\pi}\Big[\frac{2xcos(kx)}{k^2}\Big]_0^\pi=\frac{4cos(kx)}{k^2}\Rightarrow \boxed{a_k=(-1)^k\frac{4}{k^2}}$$
(2) The Fourier series of ##x^2## is
$$\boxed{x^2\sim \frac{\pi^2}{3}+\sum^\infty_{n=1}(-1)^k\frac{4}{k^2}cos(kx)}$$

Delta2
vela
Staff Emeritus
Homework Helper
You found the series for ##f: [-\pi, \pi] \to \mathbb{R}##.

Did the original problem ask you to find the Fourier cosine series, in which case you would extend ##f## so you have an even function, or the Fourier series?

docnet
Gold Member
You found the series for ##f: [-\pi, \pi] \to \mathbb{R}##.

Did the original problem ask you to find the Fourier cosine series, in which case you would extend ##f## so you have an even function, or the Fourier series?
Hi vela,

I'm sorry but you should to explain like I'm 5 years old what the difference is?

Thanks - newb

vela
Staff Emeritus
Homework Helper
Which of the following are you being asked to find the Fourier series of? If the question asks for the Fourier series of the function you provided in the original post, I'd interpret that as the first one. If, however, you're asked to find the Fourier cosine series, then it's understood that you extend the function so that it's an even function and find the Fourier series of that.

or