In addition, the global input parameter listed in Table 2 determines the nature of the output of the FourierCoeff command.
FourierCoeff
Parameters

Coefficients Returned

FourierReal

and for trigonometric sinecosine series, displayed

FourierComplex (FourierExp)

for exponential series, as function of index

FourierCos

from the trigonometric sinecosine series, as function of index

FourierSin

from the trigonometric sinecosine series, as function of index

Table 3 Parameters accepted by the FourierCoeff command

Although it takes the four parameters listed in Table 3, the FourierCoeff command always computes the coefficients of the complex series. The parameter FourierReal causes FourierCoeff to display the coefficients of the trigonometric (sinecosine) series, whereas the parameter FourierExp causes it to return, as a function of the index, the coefficients of the exponential form of the series.
The FourierCos and FourierSin options do not instruct the FourierCoeff command to create the cosine or sine series. Instead, they generate, as functions of the index , and , the coefficients of the cosine terms, and sine terms, respectively, of the sinecosine series.
To display the Fourier sinecosine coefficients for
> 

on use the syntax
> 

Note that the quotes on the parameter FourierReal are necessary.
The piecewise functions displayed as and are not assigned to these names. For example, trying to obtain with the syntax
> 

shows no assignments have been made.
To obtain the coefficients as functions, separately generate and with
> 

The coefficients and are now functions of the index , as we see from
> 

Although the calls
> 

produce the generic expressions generated by the int command, a partial sum of the associated Fourier series can be obtained with the syntax
> 

Notice from the generic expressions for and that each expression is undefined for The add command in Maple evaluates and as per their definitions as piecewise functions of , and produces the appropriate partial sum. For and as created by the FourierCoeff command, the sum command (and its 2D counterpart from the Expression palette) behaves differently, and will not provide evaluation of either or as we see from
> 

Error, (in SumTools:DefiniteSum:ClosedForm) summand is singular in the interval of summation 
In the special case where is a piecewise linear function, it can be entered as a list of points. For example, the Fourier series coefficients for the piecewise linear function
> 

defined on and whose graph appears in Figure 1,
> 


Figure 1 Graph of piecewise linear function

are given by
> 

With a setting of the global parameter
> 

the FourierSeries command will now provide the piecewise representation of the list of points used to describe the piecewise linear function.
> 

Unfortunately, there are no provisions for declaring the name of the independent variable, or for specifying a domain for the resulting . The echo of the function is suppressed with
> 

The coefficients for the complex (or exponential) form of the Fourier series for are obtained with the syntax
> 

A partial sum of the associated (exponential) Fourier series is
> 

The trigonometric form is then
> 

Since is an odd function, this is easily checked by computing
> 

and hence,
> 

With sufficient care, the FourierCoeff command can also be used to display the coefficients of a sine or cosine series. For example, to obtain the sine series of the function
> 

whose domain is the interval write the odd extension of as
> 

The alternative to the FourierExtend command would be
> 

requiring Maple coding at a more fundamental level.
Figure 2 verifies that is indeed the odd extension of to the interval
> 


Figure 2 The odd extension of to

The Fourier sinecosine series will have and the coefficients will be the coefficients of the sine series. We can see this from
> 

but the actual calculation we want to make is
> 

By way of comparison, we can also obtain the by evaluating the integral
> 

whose value is
> 

which compares favorably with
> 

The comparison can also be make by partitioning via
> 

FourierPlot, FourierAnimate, and FourierSpectrum
The remaining three commands in the FourierSeries package generate graphs. When working outside the package, the standard approach is to generate the Fourier coefficients, then form a partial sum of the series, and finally, to draw an appropriate graph. Using the FourierPlot command, however, the graph of a partial sum is superimposed on a graph of the function without the user having to obtain either the coefficients or the partial sum. Thus, for the function
> 

we obtain Figure 3.
> 


Figure 3

Partial sum of Fourier sinecosine series for superimposed on the periodic extension of the function


The partial sum graphed in Figure 3 can be obtained by writing
> 

and then
> 

Figure 4 provides proof that the parameter used in the FourierPlot command gives rise to the partial sum
> 


Figure 4 Graph of the partial sum and

Figure 5 contains the animation provided by the FourierAnimate command, and shows how a sequence of partial sums converges to .
> 


Figure 5 Animation showing convergence of partial sums

Finally, Figure 6 contains a graph of the frequency spectrum, a bar graph representing the points drawn by the FourierSpectrum command. (It is essential to add at least one plot option to this command.)
> 


Figure 6 Frequency spectrum vs for
