Partial Differential Equations
7.2 Fourier Series
To solve partial differential equations we often use a method that transforms complex partial differential equations into simpler ordinary differential equations. A key step in this method involves expressing functions as trigonometric Fourier series. Therefore, this section provides a brief overview of the Fourier Series, which will enable us to effectively tackle the solution of partial differential equations in subsequent sections.
A. Fourier Series
A Fourier series is an expansion of a function [asciimath]f(x)[/asciimath] in terms of an infinite sum of sines and cosines. The series makes it possible to express a complex periodic waveform as a combination of simple oscillating functions.
Decomposition into Sines and Cosines
The formula for a Fourier series of a function [asciimath]f(x)[/asciimath] defined in the interval [asciimath]-L leq x leq L[/asciimath] is
[asciimath]f(x) = a_0 + sum_{n=1}^{infty} [a_n cos(frac{npi x}{L}) + b_n sin(frac{npi x}{L})][/asciimath]
Here, [asciimath]a_0[/asciimath], [asciimath]a_n[/asciimath], and [asciimath]b_n[/asciimath] are the Fourier coefficients that determine the amplitude of the corresponding sine and cosine terms. They are calculated as follows:
[asciimath]a_0 = frac{1}{2L} int_{-L}^{L} f(x) dx[/asciimath]
[asciimath]a_n = frac{1}{L} int_{-L}^{L} f(x) cos(frac{npi x}{L}) dx[/asciimath] for [asciimath]n = 1, 2, 3, ldots[/asciimath]
[asciimath]b_n = frac{1}{L} int_{-L}^{L} f(x) sin(frac{npi x}{L}) dx[/asciimath] for [asciimath]n = 1, 2, 3, ldots[/asciimath]
B. Sine and Cosine Fourier Series
In certain cases, the function [asciimath]f(x)[/asciimath] may have specific symmetries, which simplify the Fourier series:
Sine Series: If [asciimath]f(x)[/asciimath] is an odd function (i.e., [asciimath]f(-x) = -f(x)[/asciimath]), the cosine terms in the Fourier series vanish, and only the sine terms remain. This results in a sine series, which is particularly useful for functions defined on symmetric intervals and satisfying certain boundary conditions, like being zero at the endpoints.
Cosine Series: If [asciimath]f(x)[/asciimath] is an even function (i.e., [asciimath]f(-x) = f(x)[/asciimath]), the sine terms disappear, leaving only the cosine terms. The resulting cosine series is useful for problems where the derivative of [asciimath]f(x)[/asciimath] is zero at the endpoints.
Fourier series are integral in solving PDEs, especially when using the method of Separation of Variables. This method often requires satisfying boundary conditions, and the Fourier series provides a way to do this. By expressing a function as a Fourier series, PDEs can be transformed into simpler ODEs, each associated with a different frequency component of the original function.
Find the Fourier Series of [asciimath]f(x)=x[/asciimath] on [asciimath][-2,2][/asciimath].
Show/Hide Solution
The endpoint [asciimath]L[/asciimath] is 2. Therefore, the Fourier Series is
[asciimath]f(x) = a_0 + sum_{n=1}^{infty} [a_n cos(frac{npi x}{2}) + b_n sin(frac{npi x}{2})][/asciimath]
where
[asciimath]a_0 = frac{1}{4} int_{-2}^{2} x dx[/asciimath]
[asciimath]a_n = frac{1}{2} int_{-2}^{2} x cos(frac{npi x}{2}) dx,[/asciimath] [asciimath]n = 1, 2, 3, ldots[/asciimath]
[asciimath]b_n = frac{1}{2} int_{-2}^{2} x sin(frac{npi x}{2}) dx,[/asciimath] [asciimath]n = 1, 2, 3, ldots[/asciimath]
[asciimath]f(x)=x[/asciimath] is an odd function and thus [asciimath]a_0[/asciimath] and [asciimath]a_n[/asciimath] will equal zero. Also, both [asciimath]x[/asciimath] and sine are odd functions, and thus their product is an even function. Thus, the integral over a symmetric interval of [asciimath][-2,2][/asciimath] simplifies to
[asciimath]b_n = int_{0}^{2} x sin(frac{npi x}{2}) dx[/asciimath]
We evaluate [asciimath]b_n[/asciimath] using the integration by parts technique.
[asciimath]=[-(2x)/(npi)cos((npix)/2)]_0^2+2/(npi) int_0^2cos((npix)/2 )dx[/asciimath]
[asciimath]=[-(2x)/(npi)cos((npix)/2)+4/(npi)^2 sin((npix)/2 )]_0^2[/asciimath]
[asciimath]=(-4cos(npi))/(npi)[/asciimath]
Given [asciimath]cos(npi)=(-1)^n[/asciimath], [asciimath]b_n[/asciimath] is simplifies to
[asciimath]b_n=(4(-1)^(n+1))/(npi)[/asciimath]
Therefore the Fourier series is
[asciimath]f(x) = sum_{n=1}^{infty} (4(-1)^(n+1))/(npi) sin(frac{npi x}{2})[/asciimath]
The below figure shows the graph of [asciimath]f(x)=x[/asciimath] (solid black line) and its approximation by the partial sums of its Fourier Series on [asciimath][-2,2][/asciimath] for [asciimath]N=3[/asciimath] (the blue dashed curve) and [asciimath]N=10[/asciimath] (the red dotted curve).
The below interactive figure presents a visual comparison between a mathematical function’s Fourier series approximation and the linear function [asciimath]f(x)=x[/asciimath], plotted over the interval [asciimath][−2,2][/asciimath]. The Fourier series approximation, depicted as a blue dashed line, illustrates how a function can be represented as a sum of simpler sine functions. The number of terms included in the Fourier series approximation can be adjusted dynamically using an interactive slider, ranging from 1 to 10 terms. This feature allows you to observe the impact of increasing the series terms on the approximation’s accuracy towards the actual function. The linear function [asciimath]f(x)=x[/asciimath] is plotted as a solid red line for reference.
Find the Fourier Series of [asciimath]f(x)=x^2[/asciimath] on [asciimath][-2,2][/asciimath].
Show/Hide Solution
The endpoint [asciimath]L[/asciimath] is 2. Therefore, the Fourier Series is
[asciimath]f(x) = a_0 + sum_{n=1}^{infty} [a_n cos(frac{npi x}{2}) + b_n sin(frac{npi x}{2})][/asciimath]
where
[asciimath]a_0 = frac{1}{4} int_{-2}^{2} x^2 dx[/asciimath]
[asciimath]a_n = frac{1}{2} int_{-2}^{2} x^2 cos(frac{npi x}{2}) dx,[/asciimath] [asciimath]n = 1, 2, 3, ldots[/asciimath]
[asciimath]b_n = frac{1}{2} int_{-2}^{2} x^2 sin(frac{npi x}{2}) dx,[/asciimath] [asciimath]n = 1, 2, 3, ldots[/asciimath]
[asciimath]f(x)=x^2[/asciimath] is an even function while sine is an odd function, so their product is an odd function. Thus, [asciimath]b_n=0[/asciimath]. The product of cosine (also an even function) and [asciimath]x^2[/asciimath] is an even function and thus [asciimath]a_0[/asciimath] and [asciimath]a_n[/asciimath] simplify to
[asciimath]a_0 = 1/2 int_{0}^{2} x^2 dx=1/2[x^3/3]_0^2=4/3[/asciimath]
[asciimath]a_n = int_{0}^{2} x^2 cos(frac{npi x}{2}) dx[/asciimath]
To evaluate [asciimath]a_n[/asciimath], we need to use the integration by parts technique twice.
[asciimath]=[(2x^2)/(npi)sin((npix)/2)]_0^2-4/(npi) int_0^2 xsin((npix)/2 ) dx[/asciimath]
[asciimath]=[(2x^2)/(npi)sin((npix)/2)-16/(npi)^3((-npi)/2xcos((npix)/2)+sin((npix)/2))]_0^2[/asciimath]
[asciimath]=16/(n^2pi^2)cos(npi)[/asciimath]
Given [asciimath]cos(npi)=(-1)^n[/asciimath], [asciimath]a_n[/asciimath] is simplified to
[asciimath]a_n=(16(-1)^(n))/(n^2pi^2)[/asciimath]
Therefore, the Fourier series is
[asciimath]f(x) = 4/3 + sum_{n=1}^{infty} (16(-1)^(n))/(n^2pi^2) cos(frac{npi x}{2})[/asciimath]
The below figure shows the graph of [asciimath]f(x)=x^2[/asciimath] (solid black line) and its approximation by the partial sums of its Fourier Series on [asciimath][-2,2][/asciimath] for [asciimath]N=10[/asciimath] (the red dashed curve).
The below interactive figure presents a visual comparison between a mathematical function’s Fourier series approximation and the quadratic function [asciimath]f(x)=x^2[/asciimath], plotted over the interval [asciimath][−2,2][/asciimath]. The Fourier series approximation, depicted as a blue dashed line, illustrates how a function can be represented as a sum of simpler sine functions. The number of terms included in the Fourier series approximation can be adjusted dynamically using an interactive slider, ranging from 1 to 10 terms. This feature allows you to observe the impact of increasing the series terms on the approximation’s accuracy towards the actual function. The function [asciimath]f(x)=x^2[/asciimath] is plotted as a solid red line for reference.
Try an Example
Section 7.2 Exercises
- Find the Fourier series for[asciimath]f[/asciimath] over the given interval.
[asciimath]f(x)=4 x[/asciimath], [asciimath][-1,1][/asciimath]
Show/Hide Answer
[asciimath]f(x) = sum_{n=1}^{infty} (8(-1)^(n+1))/(npi) sin(npi x)[/asciimath]
- Find the Fourier series for[asciimath]f[/asciimath] over the given interval.
[asciimath]f(x)=1-x^2[/asciimath], [asciimath][-1,1][/asciimath]
Show/Hide Answer
[asciimath]f(x) = 2/3 - sum_{n=1}^{infty} (4(-1)^(n))/(n^2pi^2) cos(npi x)[/asciimath]