Some Animated Fourier Series

These animations demonstrate the development of each Fourier series as new terms are gradually added.

For a function such as x2 on the interval 0<x<L, if you ask for a Fourier series representation there are many possible answers, depending on the basis you choose, and each basis is defined by a set of boundary conditions. You can get cosines, sines, even an occasional hyperbolic function, and each of these choices appear in one or another animated gif.

The Fourier series here are based on solutions of the equation u'' = λu on the interval 0<x<L with the boundary conditions as stated in the fourth column. Each set of boundary conditions on the differential equation leads to a different basis for the Fourier expansion. Notice that the boundary conditions matching the behavior of the function being expanded give Fourier series that converge faster.

When the series is evaluated outside its original domain, 0<x<L, it provides an extension of the original function, and each series gives a different extension. .

See also Power Series Animations
Drumhead Oscillations


Animations Fourier Series Boundary Conditions     Extended Function
x2 u'( 0 ) = 0,
u'( L ) = 0    

    f( x + 2L ) = f( x )
 
x2       u( 0 ) = 0,
u( L ) = 0

    f( x + 2L ) = f( x )
 
x2       u( 0 ) = 0,
u'( L ) = 0

    f( x + 4L ) = f( x )
 
x2       u( 0 ) = u( L ),
u'( 0 ) = u'( L )

    f( x + L ) = f( x )
 
x2       u'( 0 ) = 0,
u'( L ) = 2u( L )/L

 
 
 
1       u( 0 ) = 0,
u( L ) = 0

    f( x + 2L ) = f( x )

The 4th form uses periodic boundary conditions, and that is the form that you find in most (all?) descriptions of Fourier series in mathematics texts.

The 5th form of the Fourier series is not a familiar one, so it requires some comment. The function being expanded, x2, has derivative =0 at the origin. It has derivative 2L = 2L2/L at x=L. The boundary conditions specified in the above table then match these properties exactly. All the other examples miss in some way at one or both ends. That is why this form converges so much faster than the others.

The coefficients in this series are
a0 = +0.207         a1 = -0.212         a2 = +0.006         a3 = -0.001
so that the series is essentially complete after the first two terms (one cosh and one cos). If you look closely at the animation you can see the effect of the next term (n=2), as it centers the curve on the dots. It's a small effect, and it is most apparent in the third dot.

The theory behind this expansion appears in the fifth chapter of the text "Mathematical Tools." The key equation follows from the differential equation u'' = λu. It is the identity

Here, a = 0 and b = L. To get orthogonal solutions you require that the left side of the equation is zero, and that is satisfied with the boundary conditions u'( 0 ) = 0 and u'( L ) = 2u( L )/L. These equations have two cases, one for cosh (λ>0) and one for cos (λ<0). The former has one solution for λ and the latter has an infinite number.

u = cosh αx → α sinh αL = (2/L) cosh αL       u = cos αx → - α sin αL = (2/L) cos αL

These transcendental equations don't have simple explicit solutions, but a few iterations of Newton's method gets the answers.

α0L/π = 0.657         α1L/π = 0.783         α2L/π = 1.896
α3L/π = 2.932         α4L/π = 3.949         α5L/π = 4.959