These animations demonstrate the development of each Fourier series as new terms are gradually added.
For a function such as x^{2} 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  
x^{2} 
u'( 0 ) = 0,
u'( L ) = 0 
f( x + 2L ) = f( x ) 

x^{2} 
u( 0 ) = 0,
u( L ) = 0 
f( x + 2L ) = f( x ) 

x^{2} 
u( 0 ) = 0,
u'( L ) = 0 
f( x + 4L ) = f( x ) 

x^{2} 
u( 0 ) = u( L ),
u'( 0 ) = u'( L ) 
f( x + L ) = f( x ) 

x^{2} 
u'( 0 ) = 0,
u'( L ) = 2u( L )/L 


1 
u( 0 ) = 0,
u( L ) = 0 
f( x + 2L ) = f( x ) 
The 4^{th} form uses periodic boundary conditions, and that is the form that you find in most (all?) descriptions of Fourier series in mathematics texts.
The 5^{th} form of the Fourier series is not a familiar one, so it requires some comment. The function being expanded, x^{2}, has derivative =0 at the origin. It has derivative 2L = 2L^{2}/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
a_{0} = +0.207
a_{1} = 0.212
a_{2} = +0.006
a_{3} = 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.
These transcendental equations don't have simple explicit solutions, but
a few iterations of Newton's method gets the answers.