The answer to the question at the end of the Section 7.2 is very positive: most functions can, in fact, be approximated by a series with term \(\sin
nx\text{.}\) These series are called Fourier series and I’ll spend the current section defining and investigating them.
Subsection7.3.1Series and Bases for Functions
The series in Section 7.2 only involved sine functions, but the general Fourier series involves both sine and cosine.
Definition7.3.1.
Let \(a_n\) and \(b_n\) be real numbers. A Fourier series is a series of the form
In general, function as series can be consider a sums over a particular basis. For Taylor series, the basis was the set of monomials: \(x^n\) for \(n \in \NN\text{.}\) A Taylor series is an attempt to write a general function as a sum of these monomials. For Fourier series, the is \(\{ 1, \cos nx, \sin nx
\}\) for \(n \in \NN\text{.}\)
In a Fourier series, I can split the basis into two pieces: the sine pieces and the cosine pieces (including the constant \(1\) in the later). If I restrict to only one piece, I could form a Fourier sine series or Fourier cosine series. The sine pieces are all odd functions; therefore, a Fourier sine series must be an odd function. Likewise, the cosine pieces (including the constant) are all even functions, so a Fourier cosines series must be an even function.
Given a general function \(f\text{,}\) I can write \(f = f_+
+ f_-\) where \(f_+\) is even and \(f_-\) is odd. The pieces are easy to define: \(f_+ = \frac{1}{2} (f(x) +
f(-x))\) and \(f_- = \frac{1}{2} (f(x) - f(-x))\text{.}\) If \(f\) has a Fourier series, then \(f_-\text{,}\) the odd piece, will have a Fourier sine series and \(f_+\text{,}\) the even piece, will have a Fourier cosine series. The heat equation, since I insisted on starting at \((0,0)\) and only considering positive values, only needs one of the two types. Since sines arose in the solution, I’ll assume the solution to the heat equation is odd and rely on Fourier sine series.
Subsection7.3.2Scope of Fourier Series
The good news about Fourier series is that they cover a large family of functions.
Theorem7.3.2.
If \(f\) is periodic and piecewise continuous on \(\RR\) with period \(2T\text{,}\) the there exists \(a_n\) and \(b_n\) such that
If I don’t want to work with periodic functions, I can simply look at any piecewise-continuous function defined on \([0,2T)\text{,}\) thinking of it as one period, and find a Fourier series for it. (This method works for any finite intervals.)
Theorem7.3.3.
If \(f\) is piecewise continuous on \([0,2T)\) then there exists \(a_n\) and \(b_n\) such that
Therefore, I can use Fourier series to approximate any piecewise continuous function on a bounded interval. This is a very large class of functions.
Subsection7.3.3Properties of Fourier Series
When I talked about the Legendre polynomials, I derived a very nice orthogonality property for them. As opposed to the ordinary monomials \(x^n\text{,}\) the Legengre polynomials were pair-wise orthogonal, using integration on \([-1,1]\) as the inner product. When I find a basis for a type of series, it is very convenient for integration if the basis functions are orthogonal. (Like in linear algebra, an orthogonal basis is always easy to use).
Fourier series terms have wonderful orthogonality properties. For convenience, these properties are stated for the period \(T
= 2\pi\text{.}\)
Proposition7.3.4.
Let \(n, m \in \NN\text{,}\) with the possibility that \(m=0\) to account for the constant term.
Therefore, all the Fourier basis functions are orthogonal under the scalar product given by integration on \([-\pi,\pi]\text{.}\)
Proof.
For the proof, I use the trig identities for products of \(\sin\) and \(\cos\text{,}\) such as
\begin{equation*}
\cos A \cos B = \frac{1}{2} \left( \cos(A-B) + \cos (A+B)
\right)\text{.}
\end{equation*}
I only show the proof of the first of the three statements. The proof is to show a particular integral is zero, so I just calculate that integral. I use a trig identity to make the product into a sum, so that the integral has an antiderivative which is reasonable to find.
For Taylor series, there were convenient properties for the calculus of the series and the calculation of coefficients. Similar properties exist for Fourier series. If I know a series is convergent, I can integrate and differentiate term-wise. (Not that differentiation and integration change a Fourier sine series into a Fourier cosine series and vice-versa.)
A method for the the calculation of coefficients comes from the orthogonality property. Assume that \(f(x)\) is expressed as a Fourier series.
The integral calculates the coefficient \(a_n\text{.}\) Similarly, the constant coefficient \(a_0\) and the sine coefficients are calculated by integrals. This gives a general result for calculating Fourier coefficients, for \(n \in \NN\text{.}\)
Proposition7.3.5.
If \(f\) is expressed as a Fourier series, then the Fourier coefficient \(a_n\) and \(b_n\) satisfy these equations.
I’ll express \(f(x) = x\) on \((-\pi, \pi)\) as a Fourier series. Notice that \(f(x)\) is odd, so only sine terms are expected. I calculate the coefficients of the sine terms with integrals.
Subsection7.3.4Finishing the Heat Equation Solution
If I go back to the heat equation, the initial conditions where \(u(x,0) = f(x)\) for some given function \(f\) on \([0,
\pi]\) with \(f(0) = f(\pi) = 0\text{.}\) When \(t=0\text{,}\) I wrote that
The coefficients \(T_n\) in the full solution to the heat equation must be the Fourier coefficients of the initial function \(f(x)\text{.}\) Now I know how to calculate these coefficients. Since this is a sine series, we expect that \(f\) is odd, and we extend it to \((-\pi,\pi)\) as an odd function. Then I integrate to find the coefficients.
Therefore, the full solution to the heat equation, with initial conditions \(f(t)\) and boundary conditions \(u(0,t) =
u(\pi,t) = 0\text{,}\) is the following function.