12.3 Fourier Cosine and Sine Series

INTRODUCTION

The effort expended in the evaluation of coefficients a0, an , and bn in expanding a function f in a Fourier series is reduced significantly when f is either an even or an odd function. A function f is said to be

even if f(–x) = f(x) and odd if f(x) = –f(x).

On a symmetric interval such as (–p, p), the graph of an even function possesses symmetry with respect to the y-axis, whereas the graph of an odd function possesses symmetry with respect to the origin.

Even and Odd Functions

It is likely the origin of the words even and odd derives from the fact that the graphs of polynomial functions that consist of all even powers of x are symmetric with respect to the y-axis, whereas graphs of polynomials that consist of all odd powers of x are symmetric with respect to the origin. For example,

See FIGURE 12.3.1 and 12.3.2. The trigonometric cosine and sine functions are even and odd functions, respectively, since cos (–x) = cos x and sin (–x) = –sin x. The exponential functions f(x) = ex and f(x) = ex are neither even nor odd.

A parabola y = x^2 is graphed on an x y coordinate plane. The parabola enters the top left of the second quadrant, goes down and to the right, reaches a low point at the origin, then goes up and to the right and exits the top right of the first quadrant. Two dashed vertical lines go up from the x axis to the left and to the right of the origin, from negative x and x. The lines are labeled f(negative x) and f(x) respectively.

FIGURE 12.3.1 Even function

A curve y = x^3 is graphed on an x y coordinate plane. The curve enters the bottom left of the third quadrant, goes up and to the right, goes through the origin, then goes up and to the right and exits the top right of the first quadrant. Two dashed vertical lines go up and down from the x axis to the left and to the right of the origin, from negative x and x. The lines are labeled f(negative x) and f(x) respectively.

FIGURE 12.3.2 Odd function

Properties

The following theorem lists some properties of even and odd functions.

THEOREM 12.3.1 Properties of Even/Odd Functions

  1. The product of two even functions is even.
  2. The product of two odd functions is even.
  3. The product of an even function and an odd function is odd.
  4. The sum (difference) of two even functions is even.
  5. The sum (difference) of two odd functions is odd.
  6. If f is even, then f(x) dx = 2 f(x) dx.
  7. If f is odd, then f(x) dx = 0.
PROOF OF (b):

Let us suppose that f and g are odd functions. Then we have f(–x) = –f(x) and g(–x) = –g(x). If we define the product of f and g as F(x) = f(x)g(x), then

F(–x) = f(–x)g(–x) = (–f(x))(–g(x)) = f(x)g(x) = F(x).

This shows that the product F of two odd functions is an even function. The proofs of the remaining properties are left as exercises. See Problem 56 in Exercises 12.3.

Cosine and Sine Series

If f is an even function on the interval (–p, p), then in view of the foregoing properties, the coefficients (9), (10), and (11) of Section 12.2 become

Similarly, when f is odd on the interval (–p, p),

an = 0, n = 0, 1, 2, …, bn = f(x) sin x dx.

We summarize the results in the following definition.

DEFINITION 12.3.1 Fourier Cosine and Sine Series

(i) The Fourier series of an even function on the interval (–p, p) is the cosine series

(1)

where (2)

(3)

(ii) The Fourier series of an odd function on the interval (–p, p) is the sine series

(4)

where (5)

EXAMPLE 1 Expansion in a Sine Series

Expand f(x) = x, –2 < x < 2, in a Fourier series.

SOLUTION

Inspection of FIGURE 12.3.3 shows that the given function is odd on the interval (–2, 2), and so we expand f in a sine series. With the identification 2p = 4, we have p = 2. Thus (5), after integration by parts, is

A straight line is graphed on an x y plane. It starts at the point (negative 2, negative 2), goes up and to the right through the origin, and ends at the point (2, 2). The line is labeled y equals x, negative 2 less than x less than 2.

FIGURE 12.3.3 Odd function f in Example 1

Therefore (6)

The function in Example 1 satisfies the conditions of Theorem 12.2.1. Hence the series (6) converges to the function on (–2, 2) and the periodic extension (of period 4) given in FIGURE 12.3.4.

Five parts of a function f are graphed on an x y plane. The first part represented by a dashed red line starts at the point (negative 10, negative 2), goes up and to the right through the point (negative 8, 0), and ends at the point (negative 6, 2). The second part represented by a dashed red line starts at the point (negative 6, negative 2), goes up and to the right through the point (negative 4, 0), and ends at the point (negative 2, 2). The third part represented by a solid blue line starts at the point (negative 2, negative 2), goes up and to the right through the point (0, 0), and ends at the point (2, 2). The fourth part represented by a dashed red line starts at the point (2, negative 2), goes up and to the right through the point (4, 0), and ends at the point (6, 2). The fifth part represented by a dashed red line starts at the point (6, negative 2), goes up and to the right through the point (8, 0), and ends at the point (10, 2). Six solid dots are placed at the following points: (negative 10, 0), (negative 6, 0), (negative 2, 0), (2, 0), (6, 0), and (10, 0).

FIGURE 12.3.4 Periodic extension of the function f shown in Figure 12.3.3

EXAMPLE 2 Expansion in a Sine Series

The function f(x) = shown in FIGURE 12.3.5 is odd on the interval (–π, π). With p = π we have from (5)

Two parts of a function are graphed on an x y plane. The first part is a horizontal line that starts at the point (negative pi, negative 1), goes to the right, and ends at the point (0, negative 1). The second part is also a horizontal line that starts at the point (0, 1), goes to the right, and ends at the point (pi, 1).

FIGURE 12.3.5 Odd function f in Example 2

and so (7)

Gibbs Phenomenon

With the aid of a CAS we have plotted in FIGURE 12.3.6 the graphs S1(x), S2(x), S3(x), S15(x) of the partial sums of nonzero terms of (7). As seen in Figure 12.3.6(d), the graph of S15(x) has pronounced spikes near the discontinuities at x = 0, x = π, x = –π, and so on. This “overshooting” by the partial sums SN from the function values near a point of discontinuity does not smooth out but remains fairly constant, even when the value N is taken to be large. This behavior of a Fourier series near a point at which f is discontinuous is called the Gibbs phenomenon after the American mathematician/scientist Josiah Willard Gibbs (1839–1903). Gibbs was the co-inventor of modern vector analysis.

The first graph is captioned (a) S subscript 1 (x). A curve of sine wave pattern is graphed on an x y plane. It starts approximately at (negative 3, 0), goes down and to the right, and reaches a low point approximately at (negative 1.5, negative 1.5). Then it goes up and to the right through the origin, reaches a high point approximately at (1.5, 1.5), and ends approximately at (3, 0). The second graph is captioned (b) S subscript 2 (x). A curve is graphed on an x y plane. It starts approximately at (negative 3, 0), goes down and to the right, then goes up and to the right, again goes down and to the right and goes up and to the right through the origin, and reaches a point in the first quadrant. Then it follows the same pattern as going up, down, up, down and to the right, and ends approximately at (3, 0). The third graph is captioned (c) S subscript 3 (x). A curve is graphed on an x y plane. It starts approximately at (negative 3, 0), goes down and to the right, then goes up and to the right, again goes down, up, down and to the right, then goes up and to the right through the origin, and reaches a point in the first quadrant. Then it follows the same pattern as going up, down, up, down, up, down and to the right, and ends approximately at (3, 0). The fourth graph is captioned (d) S subscript 15 (x). A curve is graphed on an x y plane. It starts approximately at (negative 3.2, 0.2), goes down and to the right, follows an oscillatory pattern of many small and dense spikes until near x equals 0, then goes up and to the right through the origin, and reaches a point in the first quadrant. Then it follows the same pattern, and ends approximately at (3.2, 0.2).

FIGURE 12.3.6 Partial sums of sine series (7) on the interval (–π, π)

The periodic extension of f in Example 2 onto the entire x-axis is a meander function (see page 255).

Half-Range Expansions

Throughout the preceding discussion it was understood that a function f was defined on an interval with the origin as midpoint, that is, (–p, p). However, in many instances we are interested in representing a function that is defined on an interval (0, L) by a trigonometric series. This can be done in many different ways by supplying an arbitrary definition of the function on the interval (–L, 0). For brevity we consider the three most important cases. If y = f(x) is defined on the interval (0, L), then:

  1. reflect the graph of the function about the y-axis onto (–L, 0); the function is now even on the interval (–L, L) (see FIGURE 12.3.7); or
  2. reflect the graph of the function through the origin onto (–L, 0); the function is now odd on the interval (–L, L) (see FIGURE 12.3.8); or
  3. define f on (–L, 0) by f(x) = f(x + L) (see FIGURE 12.3.9).
A curve is graphed on an x y plane. It starts at the origin, goes up and to the right, and reaches a point in the first quadrant. Then it goes down and to the right, ends at a point in the first quadrant that corresponds to the x value of L. The reflection of the curve about the y axis is represented by a dashed red curve in the second quadrant.

FIGURE 12.3.7 Even reflection

A curve is graphed on an x y plane. It starts at the origin, goes up and to the right, and reaches a point in the first quadrant. Then it goes down and to the right, ends at a point in the first quadrant that corresponds to the x value of L. The reflection of the curve through the origin is represented by a dashed red curve in the third quadrant.

FIGURE 12.3.8 Odd reflection

A curve is graphed on an x y plane. It starts at the origin, goes up and to the right, and reaches a point in the first quadrant. Then it goes down and to the right, ends at a point in the first quadrant that corresponds to the x value of L. The identity reflection of the curve is represented by a dashed red curve in the second quadrant. The dashed curve starts at (negative L, 0), follows the similar pattern as the solid curve, and ends at a point on the positive y axis.

FIGURE 12.3.9 Identity reflection

Note that the coefficients of the series (1) and (4) utilize only the definition of the function on (0, p), that is, for half of the interval (–p, p). Hence in practice there is no actual need to make the reflections described in (i) and (ii). If f is defined on (0, L), we simply identify the half-period as the length of the interval p = L . The coefficient formulas (2), (3), and (5) and the corresponding series yield either an even or an odd periodic extension of period 2L of the original function. The cosine and sine series obtained in this manner are known as half-range expansions. Last, in case (iii) we are defining the function values on the interval (–L, 0) to be the same as the values on (0, L). As in the previous two cases, there is no real need to do this. It can be shown that the set of functions in (1) of Section 12.2 is orthogonal on [a, a + 2p] for any real number a. Choosing a = –p, we obtain the limits of integration in (9), (10), and (11) of that section. But for a = 0 the limits of integration are from x = 0 to x = 2p. Thus if f is defined over the interval (0, L), we identify 2p = L or p = L/2. The resulting Fourier series will give the periodic extension of f with period L. In this manner the values to which the series converges will be the same on (–L, 0) as on (0, L).

EXAMPLE 3 Expansion in Three Series

Expand f(x) = x2, 0 < x < L, (a) in a cosine series, (b) in a sine series, (c) in a Fourier series.

SOLUTION

The graph of the function is given in FIGURE 12.3.10.

A curve is graphed on an x y plane. It starts at the origin, goes up and to the right, and ends at a point in the first quadrant that corresponds to the x value of L. The curve is labeled y equals x^2, 0 less than x less than L.

FIGURE 12.3.10 Function f in Example 3

(a) We have

where integration by parts was used twice in the evaluation of an . Thus

(8)

(b) In this case we must again integrate by parts twice:

Hence (9)

(c) With p = L/2, 1/p = 2/L, and /p = 2/L, we have

and

Therefore (10)

The series (8), (9), and (10) converge to the 2L-periodic even extension of f, the 2L-periodic odd extension of f, and the L-periodic extension of f, respectively. The graphs of these periodic extensions are shown in FIGURE 12.3.11.

Three graphs. The first graph captioned (a) Cosine series has a function graphed on an x y plane as five curves. The first curve enters the left of the second quadrant, goes down and to the right, reaches a low point (negative 4L, 0), then goes up and to the right, and ends at a point that correspond to the x value of negative 3L. This pattern is repeated for the remaining four curves with their low points as (negative 2L, 0), (0, 0), (2L, 0), and (4L, 0), respectively. The part of the third curve from the point (0, 0) to the point that correspond to the x value of L is shown in solid line, while the other part and curves are shown in red dashed lines. The second graph captioned (b) Sine series has a function graphed on an x y plane as five curves. The first curve enters the bottom of the third quadrant, goes up and to the right through the point (negative 4L, 0), and ends at a point that correspond to the x value of negative 3L. This pattern is repeated for the remaining four curves passing through the x axis at (negative 2L, 0), (0, 0), (2L, 0), and (4L, 0), respectively. The part of the third curve from the point (0, 0) to the point that correspond to the x value of L is shown in solid line, while the other part and curves are shown in red dashed lines. Four dots are marked at the points (negative 3L, 0), (negative L, 0), (L, 0), and (3L, 0). The third graph captioned (c) Fourier series has a function graphed on an x y plane as eight curves. The first curve starts from the point (negative 4L, 0), goes up and to the right, and ends at a point that correspond to the x value of negative 3L. This pattern is repeated for the remaining seven curves starting from the points (negative 3L, 0), (negative 2L, 0), (negative L, 0), (0, 0), (L, 0), (2L, 0), and (3L, 0), respectively. The fifth curve from the point (0, 0) to the point that correspond to the x value of L is shown in solid line, while the other curves are shown in red dashed lines. Eight dots are marked in a straight line at the points that corresponds to the x value of negative 3L, negative 2L, negative L, 0, L, 2L, 3L, and 4L. These dots are below the endpoints of the curves.

FIGURE 12.3.11 Different periodic extensions of the function f in Example 3

Periodic Driving Force

Fourier series are sometimes useful in determining a particular solution of a differential equation describing a physical system in which the input or driving force f(t) is periodic. In the next example we find a particular solution of the differential equation

(11)

by first representing f by a half-range sine expansion and then assuming a particular solution of the form

(12)

EXAMPLE 4 Particular Solution of a DE

An undamped spring/mass system, in which the mass m = slug and the spring constant k = 4 lb/ft, is driven by the 2-periodic external force f(t) shown in FIGURE 12.3.12. Although the force f(t) acts on the system for t > 0, note that if we extend the graph of the function in a 2-periodic manner to the negative t-axis, we obtain an odd function. In practical terms this means that we need only find the half-range sine expansion of f(t) = πt, 0 < t < 1. With p = 1 it follows from (5) and integration by parts that

Five parts of a function are graphed on the t f(t) plane. The first part is a dashed red line that starts at the point (negative 1, negative pi), goes up and to the right, and ends at (0, 0). The second part is a solid line that starts at (0, 0), goes up and to the right, and ends at the point (1, pi). The third part is a solid line that starts at the point (1, negative pi), goes up and to the right through the point (2, 0), and ends at the point (3, pi). The fourth part is a solid line that starts at the point (3, negative pi), goes up and to the right through the point (4, 0), and ends at the point (5, pi). The fifth part is a solid line that starts at the point (5, negative pi), goes up and to the right, and ends at a point in the fourth quadrant.

FIGURE 12.3.12 Periodic forcing function f in Example 4

From (11) the differential equation of motion is seen to be

(13)

To find a particular solution xp(t) of (13), we substitute the series (12) into the differential equation and equate coefficients of sin nπt. This yields

Thus (14)

Observe in the solution (14) that there is no integer n ≥ 1 for which the denominator 64 – n2π2 of Bn is zero. In general, if there is a value of n, say, N, for which /p = ω, where ω = , then the system described by (11) is in a state of pure resonance. In other words, we have pure resonance if the Fourier series expansion of the driving force f(t) contains a term sin(/L)t (or cos(/L)t) that has the same frequency as the free vibrations.

Of course, if the 2p-periodic extension of the driving force f onto the negative t-axis yields an even function, then we expand f in a cosine series.

12.3 Exercises Answers to selected odd-numbered problems begin on page ANS-32.

In Problems 1–10, determine whether the given function is even, odd, or neither.

  1. f(x) = sin 3x
  2. f(x) = x cos x
  3. f(x) = x2 + x
  4. f(x) = x3 – 4x
  5. f(x) = e|x|
  6. f(x) = exex
  7. f(x) = x3, 0 ≤ x ≤ 2
  8. f(x) = |x5|

In Problems 11–24, expand the given function in an appropriate cosine or sine series.

  1. f(x) = |x|, –π < x < π
  2. f(x) = x, –π < x < π
  3. f(x) = x2, –1 < x < 1
  4. f(x) = x|x|, –1 < x < 1
  5. f(x) = π2x2, –π < x < π
  6. f(x) = x3, –π < x < π
  7. f(x) = |sin x|, –π < x < π
  8. f(x) = cos x, –π/2 < x < π/2

In Problems 25–34, find the half-range cosine and sine expansions of the given function.

  1. f(x) = cos x, 0 < x < π/2
  2. f(x) = sin x, 0 < x < π
  3. f(x) = x2 + x, 0 < x < 1
  4. f(x) = x(2 – x), 0 < x < 2

In Problems 35–38, expand the given function in a Fourier series.

  1. f(x) = x2, 0 < x < 2π
  2. f(x) = x, 0 < x < π
  3. f(x) = x + 1, 0 < x < 1
  4. f(x) = 2 – x, 0 < x < 2

In Problems 39–42, suppose the function y = f(x), 0 < x < L, given in the figure is expanded in a cosine series, in a sine series, and in a Fourier series. Sketch the periodic extension to which each series converges.

  1. A function is graphed on an x y plane as two parts. The first part is a horizontal line that starts at a point on the positive y axis and ends at a point in the first quadrant. The second part is a straight line that starts from the endpoint of the first part, goes down and to the right, and ends at the point (L, 0). The function is labeled y equals f(x).

    FIGURE 12.3.13 Graph for Problem 39

  2. A function is graphed on an x y plane as two parts. The first part is a horizontal line that starts at the origin and ends at a point on the positive x axis. The second part is a curve that starts from the endpoint of the first part, goes up and to the right, reaches a high point, then goes down and to the right, and ends at the point (L, 0). The function is labeled y equals f(x).

    FIGURE 12.3.14 Graph for Problem 40

  3. A function is graphed on an x y plane. It is a curve that starts from a point on the positive y axis, goes down and to the right through the positive x axis, and reaches a low point in the fourth quadrant. Then it goes up and to the right, and ends at the point (L, 0). The function is labeled y equals f(x).

    FIGURE 12.3.15 Graph for Problem 41

  4. A function is graphed on an x y plane. It is a curve that starts from a point on the positive y axis, goes up and to the right, then goes down and to the right through the positive x axis, and reaches a low point in the fourth quadrant. Then it goes up and to the right through the positive x axis, and ends at a point in the first quadrant that corresponds to the x value of L. The function is labeled y equals f(x).

    FIGURE 12.3.16 Graph for Problem 42

In Problems 43 and 44, proceed as in Example 4 to find a particular solution xp(t) of equation (11) when m = 1, k = 10, and the driving force f(t) is as given. Assume that when f(t) is extended to the negative t-axis in a periodic manner, the resulting function is odd.

  1. f(t) = 1 – t, 0 < t < 2; f(t + 2) = f(t)

In Problems 45 and 46, proceed as in Example 4 to find a particular solution xp(t) of equation (11) when m = , k = 12, and the driving force f(t) is as given. Assume that when f(t) is extended to the negative t-axis in a periodic manner, the resulting function is even.

  1. f(t) = 2πtt2, 0 < t < 2π; f(t + 2π) = f(t)
    1. Solve the differential equation in Problem 43, x″ + 10x = f(t), subject to the initial conditions x(0) = 0, x′(0) = 0.
    2. Use a CAS to plot the graph of the solution x(t) in part (a).
    1. Solve the differential equation in Problem 45, x″ + 12x = f(t), subject to the initial conditions x(0) = 1, x′(0) = 0.
    2. Use a CAS to plot the graph of the solution x(t) in part (a).
  2. Suppose a uniform beam of length L is simply supported at x = 0 and at x = L. If the load per unit length is given by w(x) = w0 x/L, 0 < x < L, then the differential equation for the deflection y(x) is

    where E, I, and w0 are constants. See (4) in Section 3.9.

    1. Expand w(x) in a half-range sine series.
    2. Use the method of Example 4 to find a particular solution y(x) of the differential equation.
  3. Proceed as in Problem 49 to find a particular solution y(x) when the load per unit length is as given in FIGURE 12.3.17.
A function is graphed on an x w(x) plane as three parts. The first part is a horizontal line that starts from the origin and ends at the point (L over 3, 0). The second part is a horizontal line that starts at the point (L over 3, w subscript 0) and ends at the point (2 L over 3, w subscript 0). The third part is also a horizontal line that starts at the point (2 L over 3, 0) and ends at the point (L, 0).

FIGURE 12.3.17 Graph for Problem 50

Computer Lab Assignments

In Problems 51 and 52, use a CAS to graph the partial sums {SN (x)} of the given trigonometric series. Experiment with different values of N and graphs on different intervals of the x-axis. Use your graphs to conjecture a closed-form expression for a function f defined for 0 < x < L that is represented by the series.

Discussion Problems

  1. Is your answer in Problem 51 or in Problem 52 unique? Give a function f defined on a symmetric interval about the origin (–a, a) that has the same trigonometric series as in Problem 51; as in Problem 52.
  2. Discuss why the Fourier cosine series expansion of f(x) = ex, 0 < x < π converges to ex on the interval (–π, 0).
  3. Suppose f(x) = ex, 0 < x < π is expanded in a cosine series, and then f(x) = ex, 0 < x < π is expanded in a sine series. If the two series are added and then divided by 2 (that is, the average of the two series) we get a series with cosines and sines that also represents f(x) = ex on the interval (0, π). Is this a full Fourier series of f ? [Hint: What does the averaging of the cosine and sine series represent on the interval (–π, 0)?]
  4. Prove properties (a), (c), (d), (e), (f), and (g) in Theorem 12.3.1.