Linear Methods of Applied Mathematics

Differentiating Fourier series

version of 23 October 1997
V.  Differentiating Fourier series^†

^† Copyright © 1994-1997 by Evans M. Harrell II and James V. Herod.

One of the most important uses of Fourier series is as a tool in solving differential equations.  Because of that we will frequently want to differentiate a Fourier series.  Since the Fourier series, like any infinite series, is a limit, questions can arise about whether it is permissible to differentiate in x before summing in n.  In your advanced calculus class you should have seen examples where interchanging the order of two limits leads to different answers.  This can happen quite easily.  

Example V.1.  Let f[n,x] := 0 if -1/n £ x £ 1/n, and 1 otherwise - the indicator function of the complement of the interval [-1/n, 1/n].  Then f[n,0] = 0 for all n, so if we let x tend to zero before n tends to infinity, 
	
whereas if n tends to infinity first, 

One of the great things about Fourier series is that, despite a very reasonable worry, it is usually completely reliable to interchange limits.  Indeed, one nice way to calculate Fourier series is to differentiate or integrate other Fourier series.  We'll do some examples and see how reliable the answer is, as well as a couple of situations where we have to be careful.

With the formulae for the Fourier coefficients given in chapter IV it is a routine matter to calculate the Fourier series for the function x-x^3 defined for -1 < x < 1.  We find that there are no cosine contributions, and 
	
To get a feel for this series, let us plot the sum of the first three terms and compare with 
x-x^3:

Wonderful!   The function and the truncated series match rather closely.  
What happens if we differentiate?  

Model Problem V.1.  Differentiate the terms in the Fourier series for this function, and compare with 1 - 3 x^2.

Solution.
If we differentiate the series for x-x^3, we get the series

supposing that it is legitimate to differentiate the infinite series term by term.  (Sometimes it definitely is not.)  We could calculate the Fourier series for 1-3x^2 directly with the formulae of chapter IV, either by hand or with software, and compare, but before doing so, let's evaluate the differentiated series on its own merits.  First note that the function 1-3x^2 is even, so there will only be cosine contributions, as we have found.  Next, let us plot the sum of the first four terms in the differentiated series and compare with the exact function:

A superb match!  Just for fun, let's see the comparison outside the interval where we cut off the polynomials:

Remember - the Fourier series always corresponds to the periodic extension of the function on the basic interval.  The formula 
	
is not valid for the series outside [-1,1].

Finally, let us calculate the Fourier series using the integral formulae.  The result, using software, is:
	a_0 = 0, 
	
as expected.  (Notice that this example has something to do with the Legendre polynomials.)

Suppose now that instead of differentiating, we integrate a Fourier series term by term.  If a_0 (which = c_0) is different from 0, we get another Fourier series!  If a_0 is not 0, then we would only get another Fourier series after replacing the function x with a Fourier series, but we won't consider that case now.

Does the integrated series converge to the integral of the original function?  According to our experiment with differentiation, it seems so.  Let us try again, by integrating the series for x - x^3 term by term.  We find:
	
plus a constant of integration.  Let us plot the sum of the first 4 of these functions and compare with x^2/2 - x^4/4:

What does this show about the constant of integration?  When we integrated the series we got the integral with average average a_0, chosen here as 0.  Remember that a_0 is always the average of the function.  The difference in height between the two graphs is just the average of x^2/2 - x^4/4, which doesn't happen to be 0.

Exercises.

Exercise V.1.  Use the tricks of this chapter to calculate the Fourier series for the functions x^n, n = 0, 1, ..., on the interval -1 < x < 1.

Exercise V.2.  What series do you obtain by differentiating the Fourier series for the square pulse (cf. model problem IV.1)?  If you know about the Diracdelta function, comment on the relationship between the series you get for the square pulse and the one for the delta function d(x-a) (periodically extended).

Exercise V.3.  Consider what happens when a Legendre series is differentiated term by term.  Is the result a Legendre series?  Does the result converge to the derivative of the original function?

Exercise V.4.  Check the convergence of Exercise V.3 numerically in a specific example such as f(x) = sin(px), -1 < x < 1.

Orthogonal Series and Boundary Value Problems