Calculus I
Michaelmas Term
In our study of Taylor series and Taylor polynomials we have seen how to write and approximate functions in terms of polynomials. If the function we are interested in is periodic, then it is more appropriate to use trigonometric functions rather than polynomials. This is the topic of Fourier series, which are important in a wide range of areas and applications. In particular, they play a vital role in the solution of certain partial differential equations.
Consider a function \(f(x)\) of period \(2L\) which is given on the interval \((-L,L).\) The functions \(\cos \frac{n\pi x}{L}\) and \(\sin \frac{n\pi x}{L},\) with \(n\) any positive integer, are also periodic with period \(2L.\) It therefore seems reasonable to try and write \(f(x)\) in terms of these trigonometric functions. Note that a constant is trivially a periodic function (for any period) so we can also include a constant term. We therefore aim to write \[f(x)=\frac{a_0}{2}+\sum_{n=1}^\infty \bigg(
a_n \cos \frac{n\pi x}{L}
+b_n \sin \frac{n\pi x}{L}\bigg)
\hskip 3cm (FS)\] where \(a_0,a_n,b_n\) are constants labelled by the positive integer \(n,\) and are called the Fourier coefficients of \(f(x).\) (It is just a convenient notation to call the constant term \(a_0/2.\)). If these Fourier coefficients are such that this series converges then it is called the Fourier series of \(f(x).\)
Eg. The function \(f(x)=2\cos^2\frac{\pi x}{L}+3\sin\frac{\pi x}{L}\) has period \(2L.\)
Its Fourier series contains only a finite number of terms as
\(2\cos^2\frac{\pi x}{L}+3\sin\frac{\pi x}{L} =1+\cos\frac{2\pi x}{L}+3\sin\frac{\pi x}{L}.\)
Therefore \(a_0=2,\ a_2=1,\ b_1=3,\) and all the other Fourier coefficients are zero.
In general an infinite number of Fourier coefficients may be non-zero and we need a method to determine these from the given function \(f(x).\)
In order to derive formulae for the Fourier coefficients we first need to prove some identities for integrals of trigonometric functions.
In the following let \(m\) and \(n\) be positive integers.
\[\begin{aligned}
&(i)\quad\quad& \int _{-L}^{L} \cos \frac{n\pi x}{L}\,dx =0.\\
&(ii)\quad\quad& \int _{-L}^{L} \sin \frac{n\pi x}{L}\,dx =0.\\
&(iii)\quad\quad& \int _{-L}^{L} \sin \frac{m\pi x}{L}\,\cos \frac{n\pi x}{L}\,dx =0.\\
&(iv)\quad\quad& \frac{1}{L}\int _{-L}^{L} \cos \frac{m\pi x}{L}\,\cos \frac{n\pi x}{L}\,dx =\begin{cases}
0& \text{if \ $m\ne n$}\\
1& \text{if \ $m=n.$}\\
\end{cases}\\
&(v)\quad\quad& \frac{1}{L}\int _{-L}^{L} \sin \frac{m\pi x}{L}\,\sin \frac{n\pi x}{L}\,dx =\begin{cases}
0& \text{if \ $m\ne n$}\\
1& \text{if \ $m=n.$}\\
\end{cases}\end{aligned}\] The expression that occurs on the right hand side of the last two formulae arises so often that it is useful to introduce a shorthand notation for this. The Kronecker delta \(\delta_{mn}\) is defined to be \[\delta_{mn}=\begin{cases}
0& \text{if \ $m\ne n$}\\
1& \text{if \ $m=n.$}\\
\end{cases}\] So, for example, we may write \(\frac{1}{L}\int _{-L}^{L} \sin \frac{m\pi x}{L}\,\sin \frac{n\pi x}{L}\,dx =
\delta_{mn}.\)
It is trivial to prove \((i):\) \(\int _{-L}^{L} \cos \frac{n\pi x}{L}\,dx=
\bigg[\frac{L}{n\pi}\sin \frac{n\pi x}{L}\bigg]^L_{-L}=
\frac{2L}{n\pi}\sin(n\pi)=0.\)
\((ii)\) and \((iii)\) are true by inspection, as they are both integrals of odd functions over a symmetric interval.
We can prove \((iv)\) and \((v)\) by using \(\cos(x\pm y)=\cos x \cos y\mp \sin x \sin y.\)
First assume \(m\ne n\) then \[\frac{1}{L}\int _{-L}^{L} \cos \frac{m\pi x}{L}\,\cos \frac{n\pi x}{L}\,dx
%$\cos \frac{m\pi x}{L}\,\cos \frac{n\pi x}{L}
=\frac{1}{2L}\int _{-L}^{L} \bigg(\cos \frac{(m-n)\pi x}{L}+\cos \frac{(m+n)\pi x}{L}\bigg)\,dx\] \[=
\frac{1}{2\pi}\bigg[\frac{1}{m-n}\sin\frac{(m-n)\pi x}{L}
+\frac{1}{m+n}\sin\frac{(m+n)\pi x}{L}\bigg]^L_{-L}
=0.\] Now if \(m=n\) \[\frac{1}{L}\int _{-L}^{L} \cos \frac{m\pi x}{L}\,\cos \frac{n\pi x}{L}\,dx
=\frac{1}{2L}\int _{-L}^{L}\bigg(1+\cos \frac{2n\pi x}{L}\bigg)\,dx
%$$ $$
=\frac{1}{2L}\bigg[x+\frac{L}{2n\pi}\sin \frac{2n\pi x}{L}\bigg]^L_{-L}
=1.\] This proves \((iv)\) and a similar calculation (exercise) proves \((v).\)
We say that the set of functions \(\{1,\cos \frac{n\pi x}{L},
\sin \frac{n\pi x}{L}\}\) form an orthogonal set on \([-L,L]\) because if \(\phi,\psi\) are any two different functions from this set then \(\frac{1}{L}\int _{-L}^{L} \phi\psi\,dx=0.\)
We now use the identities \((i),..,(v)\) to derive expressions for the Fourier coefficients in \((FS).\)
First of all, by integrating \((FS)\) we have \[\frac{1}{L}\int _{-L}^{L} f(x)\,dx
=\frac{1}{L}\int _{-L}^{L} \bigg\{
\frac{a_0}{2}+\sum_{n=1}^\infty \bigg(
a_n \cos \frac{n\pi x}{L}
+b_n \sin \frac{n\pi x}{L}\bigg)
\bigg\}\,dx=a_0\] using \((i)\) and \((ii).\) Thus we have derived an expression for \(a_0\) \[a_0=\frac{1}{L}\int _{-L}^{L} f(x)\,dx.\] Let \(m\) be a positive integer and multiply \((FS)\) by \(\cos\frac{m\pi x}{L}\) and integrate to give \[\frac{1}{L}\int _{-L}^{L} \cos\frac{m\pi x}{L}f(x)\,dx
=\frac{1}{L}\int _{-L}^{L} \bigg\{
\frac{a_0}{2}+\sum_{n=1}^\infty \bigg(
a_n \cos \frac{n\pi x}{L}
+b_n \sin \frac{n\pi x}{L}\bigg)
\bigg\}\cos\frac{m\pi x}{L}
\,dx\] \[=\sum_{n=1}^\infty a_n\delta_{mn}=a_m,
\quad\quad\quad \mbox{where we have used the identities\ } (i),(iii),(iv).\] Thus we have derived an expression for \(a_n\) \[a_n=\frac{1}{L}\int _{-L}^{L} \cos\frac{n\pi x}{L}f(x)\,dx.\] Note that if we extend this relation to \(n=0\) then it reproduces the correct expression given above for \(a_0.\)
Similarly, multiply \((FS)\) by \(\sin\frac{m\pi x}{L}\) and integrate to give \[\frac{1}{L}\int _{-L}^{L} \sin\frac{m\pi x}{L}f(x)\,dx
=\frac{1}{L}\int _{-L}^{L} \bigg\{
\frac{a_0}{2}+\sum_{n=1}^\infty \bigg(
a_n \cos \frac{n\pi x}{L}
+b_n \sin \frac{n\pi x}{L}\bigg)
\bigg\}\sin\frac{m\pi x}{L}
\,dx\] \[=\sum_{n=1}^\infty b_n\delta_{mn}=b_m,
\quad\quad\quad \mbox{where we have used the identities\ } (ii),(iii),(v).\] Thus we have derived an expression for \(b_n\) \[b_n=\frac{1}{L}\int _{-L}^{L} \sin\frac{n\pi x}{L}f(x)\,dx.\]
Eg. The function \(f(x)\) has period 2, that is \(f(x+2)=f(x),\) and is given by \(f(x)=|x|\) for \(-1<x<1.\) The graph of this function is shown in Figure 1.
[fig-fouriermodx]
To calculate the Fourier series of this function we apply the earlier formulae with \(L=1.\)
\(a_0=\int_{-1}^1 |x|\,dx=2\int_0^1 x\,dx=\bigg[x^2\bigg]^1_0=1.\)
For \(n>0\) \[a_n=\int_{-1}^1 |x|\cos(n\pi x)\,dx=2\int_0^1 x\cos(n\pi x)\,dx\] \[=2\bigg\{
\bigg[\frac{x}{n\pi}\sin(n\pi x)\bigg]_0^1-\int_0^1\frac{1}{n\pi}\sin(n\pi x)\,dx\bigg\}
=\frac{2}{n^2\pi^2}\bigg[\cos(n\pi x)\bigg]_0^1\] \[=\frac{2}{n^2\pi^2}(\cos(n\pi)-1)
=\frac{2}{n^2\pi^2}((-1)^n-1).\] Furthermore, for \(n>0\) \[b_n=\int_{-1}^1 |x|\sin(n\pi x)\,dx=0\] because this is the integral of an odd function over a symmetric interval.
This demonstrates a general point that if \(f(x)\) is an even function on the interval \((-L,L)\) then all \(b_n=0\) and the Fourier series contains only cosine terms (plus a constant term). This is called a cosine series.
Putting all this together we have the Fourier (cosine) series \[f(x)=\frac{1}{2}+\sum_{n=1}^\infty \frac{2}{n^2\pi^2}((-1)^{n}-1)\cos(n\pi x)\] \[=\frac{1}{2}-\frac{4}{\pi^2}\bigg(
\cos(\pi x)+\frac{1}{9}\cos(3\pi x)+\frac{1}{25}\cos(5\pi x)
+\cdots
\bigg)\] Note that in this example \(a_{2n}=0\) and \(a_{2n-1}=-\frac{4}{\pi^2(2n-1)^2},\) so this Fourier (cosine) series could also be written as \[f(x)=\frac{1}{2}-\frac{4}{\pi^2}\sum_{n=1}^\infty
\frac{\cos((2n-1)\pi x)}{(2n-1)^2}.\]
To see how the Fourier series approaches the function \(f(x)\) define the partial sum \[S_m(x)=\frac{a_0}{2}+\sum_{n=1}^m \bigg( a_n \cos \frac{n\pi x}{L} +b_n \sin \frac{n\pi x}{L}\bigg).\] In this example, \(S_1(x)=\frac{1}{2}-\frac{4}{\pi^2}\cos(\pi x), \quad S_3(x)=\frac{1}{2}-\frac{4}{\pi^2}(\cos(\pi x)+\frac{1}{9}\cos(3\pi x)),\)
\(S_5(x)=\frac{1}{2}-\frac{4}{\pi^2}(\cos(\pi x)+\frac{1}{9}\cos(3\pi x)+\frac{1}{25}\cos(5\pi x)),\) etc.
In Figure 4 we plot the graph of \(f(x)\) together with the partial sums \(S_1(x),S_5(x),S_{11}(x).\)
This helps to demonstrate that, in this case, \(\lim_{m\rightarrow\infty}S_m(x)=f(x).\)

Eg. The function \(f(x)\) has period \(2\pi\) and is given by \(f(x)=x\) for \(-\pi<x<\pi.\)
Calculate the Fourier series of \(f(x).\)
The graph of this function is shown in Figure 5. Note that the function is not continuous at the points \(x=(2p+1)\pi,
\ \ p\in\mathbb{Z},\) where there are jump discontinuities.

We apply the earlier formulae with \(L=\pi.\) For \(n\ge 0\) \[a_n=\frac{1}{\pi}\int _{-\pi}^{\pi} x\cos(n x)\,dx=0\] because this is the integral of an odd function over a symmetric interval.
This demonstrates a general point that if \(f(x)\) is an odd function on the interval \((-L,L)\) then all \(a_n=0\) and the Fourier series contains only sine functions. This is called a sine series.
For \(n>0\) \[b_n=\frac{1}{\pi}\int _{-\pi}^{\pi} x\sin(n x)\,dx
=\frac{1}{\pi}\bigg\{\bigg[-\frac{x}{n}\cos(nx)\bigg]^\pi_{-\pi}
+\int _{-\pi}^{\pi}\frac{1}{n}\cos(nx)\,dx
\bigg\}\] \[=\frac{1}{\pi}\bigg\{-\frac{2\pi}{n}\cos(n\pi)
+\bigg[\frac{1}{n^2}\sin(nx)\bigg]^\pi_{-\pi}
\bigg\}
=-\frac{2}{n}\cos(n\pi)=-\frac{2}{n}(-1)^n=\frac{2}{n}(-1)^{n+1}.\] Putting all this together we have the Fourier (sine) series \[f(x)=\sum_{n=1}^\infty \frac{2}{n}(-1)^{n+1}\sin(nx)
=2\bigg(
\sin x-\frac{1}{2}\sin(2x)+\frac{1}{3}\sin(3x)-\frac{1}{4}\sin(4x)+\cdots
\bigg)\]

In Figure 8 we plot the graph of \(f(x)=x\) for \(-\pi<x<\pi,\) together with the graphs of the partial sums \(S_1(x),S_6(x),S_{50}(x).\)
These graphs demonstrate that as more terms of the Fourier series are included it becomes an increasingly accurate approximation to \(f(x)\) inside the interval \(x\in(-\pi,\pi).\) However, notice what happens at the points \(x=\pm \pi,\) where \(f(x)\) is not continuous. At these points the Fourier series converges to 0, which is the midpoint of the jump. Note the oscillations around the point of discontinuity, where the Fourier series under/overshoots. This is called the Gibbs phenomenon and the amount of under/overshoot tends to a constant (in fact about \(9\%\)) rather than dying away as more terms are included, but the under/overshoot region becomes more localized. In the limit of an infinite number of terms the undershoot and overshoot occur at exactly the same point and cancel each other out.
In general, we would like to know what happens to the partial sum \[S_m(x)=\frac{a_0}{2}+\sum_{n=1}^m \bigg(
a_n \cos \frac{n\pi x}{L}
+b_n \sin \frac{n\pi x}{L}\bigg)\] for all values of \(x\) in the limit as \(m\rightarrow\infty,\) and how this is related to \(f(x).\) The following theorem provides an answer.
Dirichlet’s theorem
Let \(f(x)\) be a periodic function, with period \(2L,\) such that on the interval \((-L,L)\) it has a finite number of extreme values, a finite number of jump discontinuities and \(|f(x)|\) is integrable on \((-L,L).\) Then its Fourier series converges for all values of \(x.\) Furthermore, it converges to \(f(x)\) at all points where \(f(x)\) is continuous and if \(x=a\) is a jump discontinuity then it converges to \(\frac{1}{2}\lim_{x\rightarrow a^-}f(x)+\frac{1}{2}\lim_{x\rightarrow a^+}f(x).\)
We shall now derive a relation between the average of the square of a function and its Fourier coefficients.
Parseval’s theorem
If \(f(x)\) is a function of period \(2L\) with Fourier coefficients \(a_n,b_n\) then \[\frac{1}{2L}\int_{-L}^L(f(x))^2\,dx=\frac{1}{4}a_0^2+ \frac{1}{2}\sum_{n=1}^\infty (a_n^2+b_n^2).\]
Proof: \[\frac{1}{L}\int_{-L}^L(f(x))^2\,dx=\] \[\frac{1}{L}\int_{-L}^L\bigg\{\bigg[
\frac{a_0}{2}+\sum_{n=1}^\infty \bigg(
a_n \cos \frac{n\pi x}{L}
+b_n \sin \frac{n\pi x}{L}\bigg)\bigg]
\bigg[
\frac{a_0}{2}+\sum_{m=1}^\infty \bigg(
a_m \cos \frac{m\pi x}{L}
+b_m \sin \frac{m\pi x}{L}\bigg)\bigg]\bigg\}\,dx\] \[=\frac{a_0^2}{2}+\sum_{n=1}^\infty\sum_{m=1}^\infty(a_na_m\delta_{mn}+b_nb_m\delta_{mn})
=\frac{a_0^2}{2}+\sum_{n=1}^\infty(a_n^2+b_n^2).\]
Parseval’s theorem is useful in several contexts. One application is in finding the sum of certain infinite series.
Eg. Calculate \(\sum_{n=1}^\infty \frac{1}{n^2}\) by applying Parseval’s theorem to the Fourier series of \(f(x)=x\) for \(-\pi<x<\pi.\)
From earlier we calculated that the Fourier coefficients are given by \(a_n=0\) and \(b_n=\frac{2}{n}(-1)^{n+1}.\) Hence by Parseval’s theorem \[\frac{1}{2\pi}\int_{-\pi}^\pi x^2\,dx =\frac{1}{2\pi}\bigg[\frac{x^3}{3}\bigg]^\pi_{-\pi} =\frac{\pi^2}{3} =\frac{1}{2}\sum_{n=1}^\infty \frac{4}{n^2}. \quad\mbox{Thus}\quad \sum_{n=1}^\infty \frac{1}{n^2}=\frac{\pi^2}{6}.\]
Certain infinite sums can also be obtained by evaluating a Fourier series at a particular value of \(x.\)
Eg. Calculate \(\sum_{n=1}^\infty \frac{1}{(2n-1)^2}\) by evaluating the Fourier series of \(f(x)=|x|\) for \(-1<x<1,\) at the value \(x=0.\)
From earlier we calculated the Fourier (cosine) series to be \[f(x)=\frac{1}{2}-\frac{4}{\pi^2}\sum_{n=1}^\infty \frac{\cos((2n-1)\pi x)}{(2n-1)^2}.\] As \(f(x)=|x|\) satisfies the conditions of Dirichlet’s theorem and is continuous at \(x=0\) then, by Dirichlet’s theorem, evaluating the Fourier series at \(x=0\) gives \(f(0)=0.\) Hence \[0=\frac{1}{2}-\frac{4}{\pi^2}\sum_{n=1}^\infty \frac{1}{(2n-1)^2}. \quad\quad\mbox{Thus \ } \sum_{n=1}^\infty \frac{1}{(2n-1)^2}=\frac{\pi^2}{8}.\]
A half range Fourier series is a Fourier series defined on an interval \((0,L)\) rather than the interval \((-L,L).\)
Given a function \(f(x),\) defined on the interval \((0,L),\) we obtain its half range sine series by calculating the Fourier sine series of its odd extension \[f_o(x)=\begin{cases}
f(x) & \text{if \ } 0<x<L\\
-f(-x) & \text{if \ } -L<x<0\\
\end{cases}\] The Fourier coefficients of \(f_o(x)\) are \(a_n=0\) and \[b_n=\frac{1}{L}\int_{-L}^L f_o(x)\sin\frac{n\pi x}{L}\,dx
=\frac{2}{L}\int_{0}^L f(x)\sin\frac{n\pi x}{L}\,dx.\] This gives the half range sine series for \(f(x)\) on \((0,L)\) as \(f(x)=\sum_{n=1}^\infty b_n \sin \frac{n\pi x}{L}.\)
Given a function \(f(x),\) defined on the interval \((0,L),\) we obtain its half range cosine series by calculating the Fourier cosine series of its even extension \[f_e(x)=\begin{cases}
f(x) & \text{if \ } 0<x<L\\
f(-x) & \text{if \ } -L<x<0\\
\end{cases}\] The Fourier coefficients of \(f_e(x)\) are \(b_n=0\) and \[a_n=\frac{1}{L}\int_{-L}^L f_e(x)\cos\frac{n\pi x}{L}\,dx
=\frac{2}{L}\int_{0}^L f(x)\cos\frac{n\pi x}{L}\,dx.\] This gives the half range cosine series for \(f(x)\) on \((0,L)\) as \(f(x)=\frac{a_0}{2}+\sum_{n=1}^\infty a_n \cos \frac{n\pi x}{L}.\)
For a given (physical) problem on an interval \((0,L)\) it is usually the boundary conditions that determine whether an odd extension and a half sine Fourier series or an even extension and a half cosine Fourier series is more appropriate.
Fourier series take a simpler form if written in terms of complex variables. Starting with the Fourier series \[f(x)=\frac{a_0}{2}+\sum_{n=1}^\infty \bigg( a_n \cos \frac{n\pi x}{L} +b_n \sin \frac{n\pi x}{L}\bigg)\] we use the relations \(\cos \frac{n\pi x}{L}=\frac{1}{2}(e^\frac{in\pi x}{L}+e^{-\frac{in\pi x}{L}})\) and \(\sin \frac{n\pi x}{L}=-\frac{i}{2}(e^\frac{in\pi x}{L}-e^{-\frac{in\pi x}{L}})\) to rewrite this as \[f(x)=\frac{a_0}{2}+\frac{1}{2}\sum_{n=1}^\infty \bigg( (a_n-ib_n)e^\frac{in\pi x}{L}+(a_n+ib_n)e^{-\frac{in\pi x}{L}}\bigg) =\sum_{n=-\infty}^\infty c_ne^\frac{in\pi x}{L}\] where we have defined \[c_0=\frac{a_0}{2}=\frac{1}{2L}\int_{-L}^L f(x)\,dx\] for \(n>0\) \[c_n=\frac{1}{2}(a_n-ib_n)=\frac{1}{2L}\int_{-L}^L f(x) (\cos \frac{n\pi x}{L}-i\sin \frac{n\pi x}{L})\,dx =\frac{1}{2L}\int_{-L}^L f(x)e^{-\frac{in\pi x}{L}}\,dx\] and for \(n<0\) \[c_n=\frac{1}{2}(a_{-n}+ib_{-n})=\frac{1}{2L}\int_{-L}^L f(x) (\cos \frac{-n\pi x}{L}+i\sin \frac{-n\pi x}{L})\,dx =\frac{1}{2L}\int_{-L}^L f(x)e^{-\frac{in\pi x}{L}}\,dx.\] Note that \(c_{-n}=\overline{c_n}.\)
All 3 cases (\(n=0,n>0,n<0\)) can be written as a single compact formula \[c_n=\frac{1}{2L}\int_{-L}^L f(x)e^{-\frac{in\pi x}{L}}\,dx, \quad\quad\mbox{with the Fourier series \ } f(x)=\sum_{n=-\infty}^\infty c_ne^\frac{in\pi x}{L}\]
Eg. The function \(f(x)\) has period \(2\pi\) and is given by \[f(x)=\begin{cases}
-1 & \mbox{ if }\ -\pi<x<0 \\
\ \ 1 & \mbox{ if }\ \quad 0\le x<\pi\end{cases}\] Obtain the complex form of the Fourier series for \(f(x).\)
\[c_n=\frac{1}{2\pi}\int_{-\pi}^\pi f(x)e^{-inx}\,dx
=\frac{1}{2\pi}\int_{-\pi}^0 -e^{-inx}\,dx+\frac{1}{2\pi}\int_{0}^\pi e^{-inx}\,dx\] For \(n=0\) \[c_0=-\frac{1}{2\pi}\int_{-\pi}^0 \,dx+\frac{1}{2\pi}\int_{0}^\pi \,dx
=-\frac{1}{2}+\frac{1}{2}=0\] For \(n\ne 0\) \[c_n=\bigg[\frac{e^{-inx}}{2\pi i n}\bigg]_{-\pi}^0
-\bigg[\frac{e^{-inx}}{2\pi i n}\bigg]_{0}^\pi
=\frac{1}{2\pi in}(1-e^{in\pi}-e^{-in\pi}+1)
=\frac{i}{\pi n}((-1)^n-1)\] Hence \(c_{2m}=0\) and \(c_{2m+1}=\frac{-2i}{\pi(2m+1)}\) giving the complex form of the Fourier series \[f(x)=\sum_{m=-\infty}^\infty \frac{-2i}{\pi(2m+1)}e^{i(2m+1)x}\]
This complex form can be converted back to the usual real form as follows.
Using \(f(x)=\overline{f(x)}\) we have that \[2f(x)=\sum_{m=-\infty}^\infty \frac{-2i}{\pi(2m+1)}e^{i(2m+1)x}
+\sum_{m=-\infty}^\infty \frac{2i}{\pi(2m+1)}e^{-i(2m+1)x}\] hence \[f(x)=\sum_{m=-\infty}^\infty \frac{-i}{\pi(2m+1)}(e^{i(2m+1)x}-e^{-i(2m+1)x})
=\sum_{m=-\infty}^\infty \frac{-i}{\pi(2m+1)}2i\sin((2m+1)x)\] \[=\sum_{m=-\infty}^\infty \frac{2\sin((2m+1)x)}{{\pi(2m+1)}}
=\sum_{m=0}^\infty \frac{4\sin((2m+1)x)}{{\pi(2m+1)}}\]
Fourier series attempt to represent periodic functions as linear combinations of sines and cosines. You should know how to calculate Fourier coefficients so you can construct Fourier series (or Fourier partial sums). You should understand the interpretation of Fourier series as (infinite-dimensional) vectors where the orthogonal basis functions are the sines and cosines, and the components are the Fourier coefficients. Here are some key points:
If \(f(x)\) is a function of period \(2L\), its (full-range) Fourier series is the infinite series \(\frac{a_0}{2} + \sum_{n=1}^{\infty} \left( a_n \cos(n\pi x/L) + b_n \sin(n\pi x/L) \right)\) where the Fourier coefficients are given by \(a_n = \frac{1}{L} \int_{-L}^L \cos(n\pi x/L) f(x) dx\) (including \(n=0\)) and \(b_n = \frac{1}{L} \int_{-L}^L \sin(n\pi x/L) f(x) dx\). This arises for the vector interpretation with scalar product of \(\phi(x)\) and \(\psi(x)\) being \(\frac{1}{L} \int_{-L}^L \phi \psi dx\), noting that the sines and cosines are orthonormal using this scalar product.
If we include only the first \(N\) sines and cosines (i.e. have \(\sum_{n=1}^N\) rather than \(\sum_{n=1}^{\infty}\)) we have a Fourier partial sum. The Fourier series is then given by the limit as \(N \to \infty\).
An odd function has a sine Fourier series (all \(a_n = 0\)) while an even function has a cosine Fourier series (all \(b_n = 0\)).
Dirichlet’s theorem says that if \(f(x)\) is a periodic function with a finite number of extreme values and jump discontinuities in each period, and with \(|f(x)|\) integrable over a period then the Fourier series converges (to some real number) for all \(x\). It converges to \(f(x)\) at all points where \(f\) is continuous, and at jump discontinuities it converges to the midpoint of the jump.
The Gibbs phenomenon is the fact that at a jump discontinuity the Fourier series overshoots at the upper end and undershoots at the lower end by approximately \(9\%\) of the jump. This is visible in the Fourier partial sums with the peaks becoming both narrower and closer to the location of the jump as \(N \to \infty\), but not reducing in height.
Given any function \(f(x)\) on \((-L, L]\) we can define its periodic extension to be the function of period \(2L\) which equals \(f(x)\) on \((-L, L]\). We can also define the odd periodic extension of \(f(x)\) on \((0,L)\) to be the periodic extension of \(f_o(x) = \left\{ \begin{array}{ll} f(x) & \mathrm{if} x \in (0,L) \\ 0 & \mathrm{if} x \in \{0, L\} \\ -f(-x) & \mathrm{if} x \in (-L,0) \end{array} \right .\). Similarly the even periodic extension is the periodic extension of \(f_e(x) = \left\{ \begin{array}{ll} f(x) & \mathrm{if} x \in [0,L] \\ f(-x) & \mathrm{if} x \in (-L,0) \end{array} \right .\). We call the Fourier series for these odd/even periodic extensions half-range sine/cosine series.
Parseval’s theorem says that \(\frac{1}{L} \int_{-L}^L (f(x))^2 dx = \frac{1}{2}a_0^2 + \sum_{n=1}^{\infty} (a_n^2 + b_n^2)\). It is the Fourier series equivalent of the fact that the magnitude squared of a vector is the sum of the squares of its components. Parseval’s theorem can be used to evaluate infinite series if we can realise the series in terms of squares of Fourier coefficients for some function and we can calculate the integral of the function squared.
We can also evaluate infinite series if we have a Fourier series which we know converges to a specific value at some point – e.g. at a point where the function is continuous and Dirichlet’s theorem guarantees the Fourier series converges to the value of the function at that point.
Using the orthonormal basis functions \(e^{i n \pi x/L}\) with scalar product of \(\phi\) and \(\psi\) defined by \(\frac{1}{2L} \int_{-L}^L \overline{\phi} \psi dx\), we can write the Fourier series in complex form \(\sum_{-\infty}^{\infty} c_n e^{i n \pi x/L}\). The Fourier coefficients are given by \(c_n = \frac{1}{2L} \int_{-L}^L e^{-i n \pi x/L} f(x) dx\). If \(f\) is a real-valued function then \(c_{-n} = \overline{c}_n\). Note that the complex form of the Fourier series is just a different way to express the usual real Fourier series using Euler’s formula \(e^{i\theta} = \cos \theta + i \sin \theta\).