Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

5.4: Sine and Cosine Series

( \newcommand{\kernel}{\mathrm{null}\,}\)

In the last two examples (f(x)=|x| and f(x)=x on [π,π]) we have seen Fourier series representations that contain only sine or cosine terms. As we know, the sine functions are odd functions and thus sum to odd functions. Similarly, cosine functions sum to even functions. Such occurrences happen often in practice. Fourier representations involving just sines are called sine series and those involving just cosines (and the constant term) are called cosine series.

Another interesting result, based upon these examples, is that the original functions, |x| and x agree on the interval [0,π]. Note from Figures 5.7-5.9 that their Fourier series representations do as well. Thus, more than one series can be used to represent functions defined on finite intervals. All they need to do is to agree with the function over that particular interval. Sometimes one of these series is more useful because it has additional properties needed in the given application.

We have made the following observations from the previous examples:

  1. There are several trigonometric series representations for a function defined on a finite interval.
  2. Odd functions on a symmetric interval are represented by sine series and even functions on a symmetric interval are represented by cosine series.

These two observations are related and are the subject of this section. We begin by defining a function f(x) on interval [0,L]. We have seen that the Fourier series representation of this function appears to converge to a periodic extension of the function.

In Figure 5.10 we show a function defined on [0,1]. To the right is its periodic extension to the whole real axis. This representation has a period of L=1. The bottom left plot is obtained by first reflecting f about the y-axis to make it an even function and then graphing the periodic extension of this new function. Its period will be 2L=2. Finally, in the last plot we flip the function about each axis and graph the periodic extension of the new odd function. It will also have a period of 2L=2.

Screen Shot 2022-07-05 at 12.19.05 PM.png
Figure 5.10. This is a sketch of a function and its various extensions. The original function f(x) is defined on [0,1] and graphed in the upper left corner. To its right is the periodic extension, obtained by adding replicas. The two lower plots are obtained by first making the original function even or odd and then creating the periodic extensions of the new function.

In general, we obtain three different periodic representations. In order to distinguish these we will refer to them simply as the periodic, even and odd extensions. Now, starting with f(x) defined on [0,L], we would like to determine the Fourier series representations leading to these extensions. [For easy reference, the results are summarized in Table 5.2] We have already seen that the periodic extension of f(x) is obtained through the Fourier series representation in Equation (5.53).

Fourier Series on [0,L]

f(x)a02+n=1[ancos2nπxL+bnsin2nπxL]

an=2LL0f(x)cos2nπxLdx.n=0,1,2,bn=2LL0f(x)sin2nπxLdx.n=1,2,

Fourier Cosine Series on [0,L]

f(x)a0/2+n=1ancosnπxL

where

an=2LL0f(x)cosnπxLdx.n=0,1,2,

Fourier Sine Series on [0,L]

f(x)n=1bnsinnπxL

where

bn=2LL0f(x)sinnπxLdx.n=1,2,

Table 5.2. Fourier Cosine and Sine Series Representations on [0,L]

Given f(x) defined on [0,L], the even periodic extension is obtained by simply computing the Fourier series representation for the even function

fe(x){f(x),0<x<Lf(x)L<x<0

Since fe(x) is an even function on a symmetric interval [L,L], we expect that the resulting Fourier series will not contain sine terms. Therefore, the series expansion will be given by [Use the general case in (5.51) with a=L and b=L.]

fe(x)a02+n=1ancosnπxL

with Fourier coefficients

an=1LLLfe(x)cosnπxLdx.n=0,1,2,

However, we can simplify this by noting that the integrand is even and the interval of integration can be replaced by [0,L]. On this interval fe(x)=f(x). So, we have the Cosine Series Representation of f(x) for x[0,L] is given as

f(x)a02+n=1ancosnπxL

where

an=2LL0f(x)cosnπxLdx.n=0,1,2,

Similarly, given f(x) defined on [0,L], the odd periodic extension is obtained by simply computing the Fourier series representation for the odd function

fo(x){f(x),0<x<Lf(x)L<x<0

The resulting series expansion leads to defining the Sine Series Representation of f(x) for x[0,L] as

f(x)n=1bnsinnπxL

where

bn=2LL0f(x)sinnπxLdx.n=1,2,

Example 5.4.1

In Figure 5.10 we actually provided plots of the various extensions of the function f(x)=x2 for x[0,1]. Let's determine the representations of the periodic, even and odd extensions of this function.

For a change, we will use a CAS (Computer Algebra System) package to do the integrals. In this case we can use Maple. A general code for doing this for the periodic extension is shown in Table 5.3

> restart: 
> L:=1: 
> f:=x^2: 
> assume(n,integer): 
> a0:=2/L*int(f,x=0..L); 
                              a0 := 2/3 
> an:=2/L*int(f*cos(2*n*Pi*x/L),x=0..L); 
                                       1 
                              an := ------- 
                                      2 2 
                                     n~ Pi 
> bn:=2/L*int(f*sin(2*n*Pi*x/L),x=0..L); 
                                       1 
                             bn := - ----- 
                                     n~ Pi 
> F:=a0/2+sum((1/(k*Pi)^2)*cos(2*k*Pi*x/L) -1/(k*Pi)*sin(2*k*Pi*x/L),k=1..50): 
> plot(F,x=-1..3,title=‘Periodic Extension‘, titlefont=[TIMES,ROMAN,14],font=[TIMES,ROMAN,14]);

Table 5.3. Maple code for computing Fourier coefficients and plotting partial sums of the Fourier series.

Example 5.4.1: Periodic Extension - Trigonometric Fourier Series

Using the above code, we have that a0=23an=1n2π2 and bn=1nπ. Thus, the resulting series is given as

f(x)13+n=1[1n2π2cos2nπx1nπsin2nπx].

In Figure 5.11 we see the sum of the first 50 terms of this series. Generally, we see that the series seems to be converging to the periodic extension of f. There appear to be some problems with the convergence around integer values of x. We will later see that this is because of the discontinuities in the periodic extension and the resulting overshoot is referred to as the Gibbs phenomenon which is discussed in the appendix.

Example 5.12. Even Periodic Extension - Cosine Series

In this case we compute a0=23 and an=4(1)nn2π2. Therefore, we have

f(x)13+4π2n=1(1)nn2cosnπx

In Figure 5.12 we see the sum of the first 50 terms of this series. In this case the convergence seems to be much better than in the periodic extension case. We also see that it is converging to the even extension.

Example 5.13. Odd Periodic Extension - Sine Series

Finally, we look at the sine series for this function. We find that bn=2n3π3(n2π2(1)n2(1)n+2). Therefore,

Screen Shot 2022-07-05 at 12.44.32 PM.png
Figure 5.11. The periodic extension of f(x)=x2 on [0,1].

f(x)2π3n=11n3(n2π2(1)n2(1)n+2)sinnπx.

Screen Shot 2022-07-05 at 12.46.24 PM.png
Figure 5.12. The even periodic extension of f(x)=x2 on [0,1].

Once again we see discontinuities in the extension as seen in Figure 5.13. However, we have verified that our sine series appears to be converging to the odd extension as we first sketched in Figure 5.10.

Screen Shot 2022-07-05 at 12.47.20 PM.png
Figure 5.13. The odd periodic extension of f(x)=x2 on [0,1].

This page titled 5.4: Sine and Cosine Series is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Russell Herman via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?