Uploaded by kingsley oluchi

Application of Fourier Series

advertisement
Fourier Series
Part 1: Introduction
Recall Taylor’s theorem: Suppose 𝑓(π‘₯) is a 𝐢 𝑛+1 ([π‘Ž, 𝑏]) function. Then
𝑓 β€² (𝑐)
𝑓 β€²β€² (𝑐)
𝑓 (𝑛) (𝑐)
2
(π‘₯ βˆ’ 𝑐) +
(π‘₯ βˆ’ 2) + β‹― +
(π‘₯ βˆ’ 𝑐)𝑛 + 𝑅𝑛+1 (π‘₯)
𝑓(π‘₯) = 𝑓(𝑐) +
1!
2!
𝑛!
where
𝑅𝑛+1 (π‘₯) =
1 π‘₯
∫ (π‘₯ βˆ’ 𝑑)𝑛 𝑓 (𝑛+1) (𝑑) 𝑑𝑑
𝑛! 𝑐
In particular, if 𝑓(π‘₯) is a 𝐢 ∞ ([π‘Ž, 𝑏]) function then the Taylor series 𝑇𝑓 (π‘₯, 𝑐) for the function 𝑓 converges to the function
𝑓 for all π‘₯ ∈ [π‘Ž, 𝑏] if and only if lim 𝑅𝑛+1 (π‘₯) = 0 for all π‘₯ ∈ [π‘Ž, 𝑏]. As corollary we can see that every 𝐢 𝑛+1 function
𝑛→ ∞
can be approximated by a polynomial of degree 𝑛:
Example: Approximate 𝑓(π‘₯) = tan(π‘₯ 2 + 1) by a second degree polynomial near the origin.
We know that
tan(π‘₯ 2 + 1) β‰ˆ 𝑓(0) + 𝑓 β€² (0) π‘₯ +
𝑓 β€²β€² (0) 2
π‘₯ =
2!
= (tan(π‘₯ 2 + 1)|π‘₯=0 ) + (sec 2 (π‘₯ 2 + 1)2π‘₯|π‘₯=0 ) π‘₯ +
+
(2Sec 2 (1 + π‘₯ 2 ) + 8π‘₯ 2 sec 2 (1 + π‘₯ 2 ) tan(1 + π‘₯ 2 )|π‘₯=0 ) 2
π‘₯ =
2!
= 1.55741+
6.85104 2
π‘₯ = 1.55741 + 3.42552 π‘₯ 2
2
This is nice: if I do not like a function 𝑓(π‘₯) I can instead approximate it by a polynomial (of degree n). So, instead of
dealing with the complicated function 𝑓(π‘₯) = tan(π‘₯ 2 + 1) I can instead deal with the (much simpler) function 𝑔(π‘₯) =
1.55741 + 3.42552 π‘₯ 2. As long as x is close to zero – the center of my series approximation – the difference between
both functions should be small (and I could use the remainder to estimate the maximum error). If I want a better
approximation, I could compute additional Taylor coefficients.
But this approach does not work so well if the original function is very β€œdifferent” from a polynomial. For example, any
polynomial goes to infinity if x goes to infinity, and functions that would be very different from these polynomials are
periodic functions that stay bounded if x goes to plus or minus infinity.
Thus, I try another approach: if 𝑓 is periodic, I want to try to approximate it by sums of periodic functions, like sine and
cosine. In other words, I want to write the (periodic) function 𝑓(π‘₯) between, say, [βˆ’πœ‹, πœ‹] as follows:
∞
∞
𝑓(π‘₯) β‰… π‘Ž0 + βˆ‘ π‘Žπ‘› cos(𝑛π‘₯) + βˆ‘ 𝑏𝑛 sin(𝑛π‘₯)
𝑛=1
𝑛=1
This type of series is called a Fourier series and the coefficients π‘Ž0 , π‘Žπ‘— , and 𝑏𝑗 are called Fourier coefficients. Note that at
this point I do not know whether the function 𝑓 really has such a series expression, nor do I know whether such series
converge. But we can hope, can’t we?
Definition: (Fourier Series)
A series of the form
∞
∞
π‘Ž0 + βˆ‘ π‘Žπ‘› cos(𝑛π‘₯) + βˆ‘ 𝑏𝑛 sin(𝑛π‘₯)
𝑛=1
𝑛=1
for βˆ’πœ‹ ≀ π‘₯ ≀ πœ‹ is called a Fourier series and the coefficients π‘Ž0 , π‘Žπ‘— , and 𝑏𝑗 are called Fourier coefficients.
As mentioned, we don’t worry about convergence at this point but we simply investigate what would happen if a given
function 𝑓(π‘₯) could be written as a Fourier series:
∞
∞
𝑓(π‘₯) β‰… π‘Ž0 + βˆ‘ π‘Žπ‘› cos(𝑛π‘₯) + βˆ‘ 𝑏𝑛 sin(𝑛π‘₯)
𝑛=1
𝑛=1
First, some preliminary calculations:
πœ‹
ο‚·
1
βˆ«βˆ’πœ‹ sin(𝑛π‘₯) 𝑑π‘₯ = βˆ’ 𝑛 cos(𝑛π‘₯)|
πœ‹
ο‚·
1
βˆ«βˆ’πœ‹ cos(𝑛π‘₯) 𝑑π‘₯ = 𝑛 sin(𝑛π‘₯)|
πœ‹
πœ‹
βˆ’πœ‹
= 0 for all n
= 0 for all n
βˆ’πœ‹
πœ‹
βˆ«βˆ’πœ‹ sin(𝑛π‘₯) cos(π‘šπ‘₯) 𝑑π‘₯ = 0 for all 𝑛, π‘š
πœ‹
βˆ«βˆ’πœ‹ sin(𝑛π‘₯) sin(π‘šπ‘₯) 𝑑π‘₯ = 0 if 𝑛 β‰  π‘š
πœ‹
βˆ«βˆ’πœ‹ cos(𝑛π‘₯) cos(π‘šπ‘₯) 𝑑π‘₯ = 0 if 𝑛 β‰  π‘š
πœ‹
πœ‹
βˆ«βˆ’πœ‹ sin(𝑛π‘₯) sin(𝑛π‘₯) 𝑑π‘₯ = βˆ«βˆ’πœ‹ sin2(𝑛π‘₯) 𝑑π‘₯ = πœ‹
πœ‹
πœ‹
βˆ«βˆ’πœ‹ cos(𝑛π‘₯) cos(𝑛π‘₯)𝑑π‘₯ = βˆ«βˆ’πœ‹ cos2(𝑛π‘₯) 𝑑π‘₯ = πœ‹
ο‚·
ο‚·
ο‚·
ο‚·
ο‚·
Now, assuming that
∞
∞
𝑓(π‘₯) = π‘Ž0 + βˆ‘ π‘Žπ‘› cos(𝑛π‘₯) + βˆ‘ 𝑏𝑛 sin(𝑛π‘₯)
𝑛=1
(βˆ—)
𝑛=1
we multiply both sides by sin(π‘šπ‘₯) then integrate from βˆ’πœ‹ to πœ‹:
πœ‹
πœ‹
∞
πœ‹
∞
πœ‹
∫ 𝑓(π‘₯) sin(π‘šπ‘₯) 𝑑π‘₯ = ∫ π‘Ž0 sin(π‘šπ‘₯) 𝑑π‘₯ + βˆ‘ ∫ π‘Žπ‘› cos(𝑛π‘₯) sin(π‘šπ‘₯) 𝑑π‘₯ + βˆ‘ ∫ 𝑏𝑛 sin(𝑛π‘₯) sin(π‘šπ‘₯) 𝑑π‘₯ =
βˆ’πœ‹
βˆ’πœ‹
𝑛=1 βˆ’πœ‹
𝑛=1 βˆ’πœ‹
= 0 + 0 + πœ‹ π‘π‘š
because the first integral is zero, and the second integrals are all zero as well, according to our preliminary calculations
above. And for the last sum, the only non-zero integral occurs when 𝑛 = π‘š.
Next, we multiply both sides of the representation (*) for 𝑓(π‘₯) by π‘π‘œπ‘ (π‘šπ‘₯) and integrate again from βˆ’πœ‹ to πœ‹:
πœ‹
πœ‹
∞
πœ‹
∞
πœ‹
∫ 𝑓(π‘₯) cos(π‘šπ‘₯) 𝑑π‘₯ = ∫ π‘Ž0 cos(π‘šπ‘₯) 𝑑π‘₯ + βˆ‘ ∫ π‘Žπ‘› cos(𝑛π‘₯) cos(π‘šπ‘₯) 𝑑π‘₯ + βˆ‘ ∫ 𝑏𝑛 sin(𝑛π‘₯) cos(π‘šπ‘₯) 𝑑π‘₯ =
βˆ’πœ‹
βˆ’πœ‹
𝑛=1 βˆ’πœ‹
𝑛=1 βˆ’πœ‹
= 0 + πœ‹ π‘Žπ‘š + 0
because again most integrals work out to be zero according to our preliminary calculations above.
Finally, we just integrate both sides of equation (*) to get:
πœ‹
∞
πœ‹
πœ‹
∞
πœ‹
∫ 𝑓(π‘₯)𝑑π‘₯ = ∫ π‘Ž0 𝑑π‘₯ + βˆ‘ ∫ π‘Žπ‘› cos(𝑛π‘₯) 𝑑π‘₯ + βˆ‘ ∫ 𝑏𝑛 sin(𝑛π‘₯) 𝑑π‘₯ =
βˆ’πœ‹
βˆ’πœ‹
𝑛=1 βˆ’πœ‹
𝑛=1 βˆ’πœ‹
2πœ‹π‘Ž0 + 0 + 0
Thus, we have proved the following theorem:
∞
Theorem: If 𝑓(π‘₯) = π‘Ž0 + βˆ‘βˆž
𝑛=1 π‘Žπ‘› cos(𝑛π‘₯) + βˆ‘π‘›=1 𝑏𝑛 sin(𝑛π‘₯) then
1 πœ‹
π‘Ž0 =
∫ 𝑓(π‘₯)𝑑π‘₯ ,
2πœ‹ βˆ’πœ‹
1 πœ‹
π‘Žπ‘› = ∫ 𝑓(π‘₯) cos(𝑛π‘₯) 𝑑π‘₯ ,
πœ‹ βˆ’πœ‹
1 πœ‹
𝑏𝑛 = ∫ 𝑓(π‘₯) sin(𝑛π‘₯) 𝑑π‘₯
πœ‹ βˆ’πœ‹
Example: Find the Fourier series for 𝑓(π‘₯) = π‘₯ for π‘₯ ∈ [βˆ’πœ‹, πœ‹]
We use the above formulas to find the Fourier coefficients, assuming that the function can be written as a
Fourier series:
1 πœ‹
1 πœ‹
π‘Ž0 =
∫ π‘₯ 𝑑π‘₯ = 0 π‘Žπ‘›π‘‘ π‘Žπ‘› = ∫ π‘₯ cos(𝑛π‘₯) 𝑑π‘₯ = 0
2πœ‹ βˆ’πœ‹
πœ‹ βˆ’πœ‹
because the integrants are both odd functions, and
1 πœ‹
1 πœ‹
2
𝑏𝑛 = ∫ π‘₯ sin(𝑛π‘₯) 𝑑π‘₯ = 2 (βˆ’1)𝑛+1 = (βˆ’1)𝑛+1
πœ‹ βˆ’πœ‹
πœ‹ 𝑛
𝑛
Thus:
∞
2
π‘₯ = βˆ‘ (βˆ’1)𝑛+1 sin(𝑛π‘₯)
𝑛
𝑛=1
Let’s verify this by plotting both functions in one coordinate system (using only the first 10 terms of the series):
Note that the Fourier series is actually periodic, as we can see if we plot it over the interval [βˆ’3πœ‹, 3 πœ‹]
Example: Find the Fourier series for 𝑓(π‘₯) = π‘₯ 2 for π‘₯ ∈ [βˆ’πœ‹, πœ‹]
We again use the above formulas to find the Fourier coefficients. This time we get:
1 πœ‹ 2
1 2 3 πœ‹2
π‘Ž0 =
∫ π‘₯ 𝑑π‘₯ =
πœ‹ =
2πœ‹ βˆ’πœ‹
2πœ‹ 3
3
1 πœ‹ 2
1 πœ‹
4
π‘Žπ‘› = ∫ π‘₯ cos(𝑛π‘₯) 𝑑π‘₯ = 4 2 cos(𝑛 πœ‹) = 2 (βˆ’1)𝑛
πœ‹ βˆ’πœ‹
πœ‹ 𝑛
𝑛
and
1 πœ‹
𝑏𝑛 = ∫ π‘₯ 2 sin(𝑛π‘₯) 𝑑π‘₯ = 0
πœ‹ βˆ’πœ‹
because this time the last integrant is odd. Thus, we have
∞
πœ‹2
4
π‘₯ =
+ βˆ‘ 2 (βˆ’1)𝑛 π‘π‘œπ‘ (𝑛π‘₯)
3
𝑛
2
𝑛=1
Let’s again plot both functions in one coordinate system:
Example: Now we will try to approximate a function that is not continuous by a Fourier series. Let
πœ‹,
0<π‘₯β‰€πœ‹
𝑓(π‘₯) = {
0,
βˆ’πœ‹ ≀ π‘₯ ≀ 0
and find once again the Fourier series of this function
Of course we compute:
πœ‹
1 πœ‹
πœ‹2 πœ‹
∫ πœ‹ 𝑑π‘₯ =
=
2πœ‹ 0
2πœ‹ 2
βˆ’πœ‹
1 πœ‹
1 πœ‹
π‘Žπ‘› = ∫ 𝑓(π‘₯)cos(𝑛π‘₯) 𝑑π‘₯ = ∫ πœ‹ cos(𝑛π‘₯) 𝑑π‘₯ = 0
πœ‹ βˆ’πœ‹
πœ‹ 0
πœ‹
πœ‹
1
1
1
1
𝑏𝑛 = ∫ 𝑓(π‘₯) sin(𝑛π‘₯) 𝑑π‘₯ = ∫ πœ‹ sin(𝑛π‘₯) 𝑑π‘₯ = (cos(π‘›πœ‹) βˆ’ 1) = (1 βˆ’ (βˆ’1)𝑛 )
πœ‹ βˆ’πœ‹
πœ‹ 0
𝑛
𝑛
π‘Ž0 = ∫ 𝑓(π‘₯) 𝑑π‘₯ =
so that
∞
∞
𝑛=1
𝑛=0
πœ‹
1
πœ‹
2
𝑓(π‘₯) = + βˆ‘ (1 βˆ’ (βˆ’1)𝑛 ) sin(𝑛π‘₯) = + βˆ‘
sin((2𝑛 + 1) π‘₯)
2
𝑛
2
2𝑛 + 1
Note on using Mathematica
So, finding Taylor series involves taking lots of derivatives, while finding Fourier series involves many integration
problems. Mathematica can be very helpful for this and can, in fact, often solve the problem completely. Here are some
βˆ’π‘₯, π‘₯ < 0
steps how to use Mathematica to find the Fourier series for, say 𝑓(π‘₯) = {
π‘₯, π‘₯ β‰₯ 0
Step 1: Define the function and plot its graph
Step 2: Define the coefficients of the Fourier series
Note that these coefficients can be simplified manually, since sin(𝑛 πœ‹) = 0 and cos(𝑛 πœ‹) = (βˆ’1)𝑛 but we don’t
have to do that for Mathematica.
Step 3: Verify the Fourier series by plotting the 10-th partial sum (say) together with the original function in one
coordinate system:
Exercises:
1. Assuming that the functions below have Fourier series expansions, find them:
a. 𝑓(π‘₯) = |π‘₯|
0, βˆ’πœ‹ ≀ π‘₯ < 0
b. 𝑓(π‘₯) = {
π‘₯,
0≀π‘₯β‰€πœ‹
2π‘₯, βˆ’πœ‹ ≀ π‘₯ < 0
c. 𝑓(π‘₯) = {
10π‘₯,
0≀π‘₯β‰€πœ‹
βˆ’1, βˆ’πœ‹ ≀ π‘₯ < 0
2. Assuming that the function 𝑓(π‘₯) = {
has a Fourier series, find it and use it to approximate the
1,
0≀π‘₯β‰€πœ‹
original function by plotting the function and several N-th partial Fourier series for N=1, 2, ,4, 5, 10, 20, and 100.
Describe in words how the N-th partial Fourier series approximates the original function as N increases.
3. Use a Taylor series and a Fourier series to approximate the function 𝑓(π‘₯) = 𝑒 π‘₯ , π‘₯ ∈ [βˆ’πœ‹, πœ‹]. Which one works
better? How about for f(π‘₯) = sin(5.3 π‘₯) ?
4. Prove that if 𝑓(π‘₯) had a Fourier series and 𝑓(π‘₯) was an odd function defined on [βˆ’πœ‹, πœ‹], then 𝑓(π‘₯) =
βˆ‘βˆž
𝑛=1 𝑏𝑛 sin(𝑛π‘₯), i.e. π‘Žπ‘› = 0 for all 𝑛. What about for even functions?