Application Center - Maplesoft

App Preview:

Functional Approximation through Finite Fourier Series

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image 

Functional Approximation through Finite Fourier Series 

INSTITUTO DE ESTUDIOS SUPERIORES DE TAMAULIPAS
MEXICO, MMVI
 

Prepared by David Macias Ferrer
E-mail:
david.macias@iest.edu.mx
Madero City, Mexico
URL:
http://www.geocities.com/dmacias_iest/MyPage.html 

Goals 

  • To aproximate a Piecewise Continuous Function through Trigonometric Polynomials commonly called Fourier Partial Sums or Finite Fourier Series.
 

  • To show the convergence of these aproximation via Bessel's Inequality and using Maple spreadsheets.
 

  • To verify the Weiersstras's Theorem applied to case.
 

  • To show the powerful Maple 8 graphics tools to visualize the application of Weierstrass's Theorem.
 

 

Fourier Partial Sums 

The theory of approximation of functions is one of the central branches in mathematical analysis and has been developed over a number of decades. In 1822 the French mathematician Jean Baptiste Joseph Fourier (1768-1830) had completed his important essay "Th?orie Analytique de la Chaleur". Although in his work, the current "Fourier series" don't appear, Fourier's work provided the impetus for later work on trigonometric series and the theory of functions of a real variable. In 1900 the Hungarian mathematician Lip?t Fej?r (1880-1959) published a fundamental summation theorem for Fourier series;  he worked on power series and on potential theory. Much of his work is on Fourier series and their singularities but he also contributed to Approximation Theory. Another important contribution to Approximation Theory was the work of the russian mathematician Pafnuty Lvovich Chebyshev (1821-1894) "Th?orie des M?canismes Connus sous le nom de Parall?logrammes" published in 1854. It was in this work that his famous Chebyshev Orthogonals Polynomials appeared for the first time. In this work the notion abs(f(x)-P(x)) < epsilon is found.   

We will use the trigonometric polynomials approximation of the form:  g(x) = a[0]/2+(sum(a[n]*cos(n*x)+b[n]*sin(n*x), n = 1 .. N))  to particular case of a periodic piecewise continuous function f(x) defined on closed interval [-Pi, Pi].  

 

> restart:
 

The piecewise continuous function f(x) is given by: 

> f :=x->piecewise(-Pi<=x and x<0,-2*x,0<x and x<=Pi,3*x);
 

proc (x) options operator, arrow; piecewise(-Pi <= x and x < 0, -2*x, 0 < x and x <= Pi, 3*x) end proc (2.1)
 

the graphic is: 

> plot(f(x),x=-Pi..Pi,color=blue);
 

Plot
 

We will calculate the Fourier Coefficients: 

> cos(n*Pi):=(-1)^n;
 

(-1)^n (2.2)
 

> sin(n*Pi):=0;
 

0 (2.3)
 

> a[0]:=1/Pi*int(f(x),x=-Pi..Pi);
 

5/2*Pi (2.4)
 

> a[n]:=1/Pi*int((f(x)*cos(n*x)),x=-Pi..Pi);
 

5*((-1)^n-1)/(Pi*n^2) (2.5)
 

> simplify(%,trig);
 

5*((-1)^n-1)/(Pi*n^2) (2.6)
 

which may rewritten as:  

> a[n]:=(5/(n^2*Pi))*((-1)^n-1);
 

5*((-1)^n-1)/(Pi*n^2) (2.7)
 

> b[n]:=1/Pi*int((f(x)*sin(n*x)),x=-Pi..Pi);
 

(2*(-1)^n*Pi/n+3*(-1)^(1+n)*Pi/n)/Pi (2.8)
 

> b[n]:=(-1)^(n+1)/n;
 

(-1)^(1+n)/n (2.9)
 

The following theorem is verified 

Theorem.- Let f(x) be a piecewise continuous function on [-Pi, Pi] the Fourier coefficients associated satisfy the following relationships: 

 

limit(a[n], n = infinity) = 0   and   limit(b[n], n = infinity) = 0 

with the Maple commands the previous theorem is verified: 

> limit('a[n]','n'=infinity)=limit(a[n],n=infinity);
 

limit(a[n], n = infinity) = 0 (2.10)
 

> limit('b[n]','n'=infinity)=limit(b[n],n=infinity);
 

limit(b[n], n = infinity) = 0 (2.11)
 

The Finite Fourier Series associated to function is: 

g(x) = 5*Pi/4+(Sum(5*((-1)^n-1)*cos(n*x)/(n^2*Pi)+(-1)^(n+1)*sin(n*x)/n, n = 1 .. infinity)) ~f(x) 

 

Exist several types of convergence criteria for functional approximations. One of the most useful for Fourier Approximations is L^2. This clearly implies the following result: 

Theorem. Bessel's Inequality. Let f(x) be a function defined on [-Pi, Pi] such that f(x)^2 has a finite integral on [-Pi, Pi]. If a[n] and b[n] are the Fourier coefficient of the function f(x), then we have: 

a[0]^2/2+(sum(a[n]^2+b[n]^2, n = 1 .. infinity)) <= Int(f(x)^2, x = -Pi .. Pi)/Pi 

In particular the series sum(a[n]^2+b[n]^2, n = 1 .. infinity) is convergent. We will use this criterion but using the inequality: 

a[0]^2/2+(sum(a[n]^2+b[n]^2, n = 1 .. N)) <= Int(f(x)^2, x = -Pi .. Pi)/Pi 

this is, the Fourier partial series for n = N. 

Using the Maple command we have: 

> 1/Pi*Int(('f(x)^2'),x=-Pi..Pi)>='a[0]^2'/2+sum('a[n]^2+b[n]^2','n'=1..N);
 

1/2*a[0]^2+(sum(a[n]^2+b[n]^2, n = 1 .. N)) <= Int(f(x)^2, x = -Pi .. Pi)/Pi (2.12)
 

where: 

> 1/Pi*Int((f(x)^2),x=-Pi..Pi)=1/Pi*int((f(x)^2),x=-Pi..Pi);
 

Int(piecewise(-Pi <= x and x < 0, -2*x, 0 < x and x <= Pi, 3*x)^2, x = -Pi .. Pi)/Pi = 13/3*Pi^2 (2.13)
 

> I[B]=evalf(1/Pi*int((f(x)^2),x=-Pi..Pi));
 

I[B] = 42.76828575 (2.14)
 

 

with Fourier coefficients we will use a spreadsheet to show the convergence of Fourier partial series 

 

SpreadSheet001 

 

In this spreadsheet for n = 97,  delta = abs(([a[0]^2/2+(sum(a[n]^2+b[n]^2, n = 1 .. N))])-1/Pi*Int(f(x)^2, x = -Pi .. Pi))   and Limit(delta, n = infinity) = 0. Although the convergence is slow 

 

Limit([a[0]^2/2+(sum(a[n]^2+b[n]^2, n = 1 .. N))], n = infinity) = Float(4276828575, -8) 

For n = 1000, we have: 

> abs((a[0]^2/2+Sum('a[n]^2+b[n]^2','n' = 1 .. 1000))-(1/Pi)*Int(f(x)^2,x = -Pi .. Pi));
 

abs(25/8*Pi^2+(Sum(a[n]^2+b[n]^2, n = 1 .. 1000))-Int(piecewise(-Pi <= x and x < 0, -2*x, 0 < x and x <= Pi, 3*x)^2, x = -Pi .. Pi)/Pi) (2.15)
 

> evalf(%);
 

0.99949e-3 (2.16)
 

 

Weierstrass Approximation Theorem 

Theorem. (Weierstrass).- If f(x) is a continuous real-valued function on [a, b] and if any 0 < epsilon given, then there exist a polynomial P(x) on [a, b] such that: 

 

abs(f(x)-P(x)) < epsilon 

 

for all x on [a, b]. In our problem P(x) represent a trigonometric polynomial and  P(x) = g(x). 

 

> f :=x->piecewise(-Pi<=x and x<0,-2*x,0<=x and x<=Pi,3*x);
 

proc (x) options operator, arrow; piecewise(-Pi <= x and x < 0, -2*x, 0 <= x and x <= Pi, 3*x) end proc (3.1)
 

> g1:=x->5/4*Pi+sum(5/(n^2*Pi)*((-1)^n-1)*cos(n*x)+(-1)^(n+1)/n*sin(n*x),n = 1 .. 3);
 

proc (x) options operator, arrow; 5/4*Pi+(sum(5*((-1)^n-1)*cos(n*x)/(n^2*Pi)+(-1)^(1+n)*sin(n*x)/n, n = 1 .. 3)) end proc (3.2)
 

> g2:=x->5/4*Pi+sum(5/(n^2*Pi)*((-1)^n-1)*cos(n*x)+(-1)^(n+1)/n*sin(n*x),n = 1 .. 10);
 

proc (x) options operator, arrow; 5/4*Pi+(sum(5*((-1)^n-1)*cos(n*x)/(n^2*Pi)+(-1)^(1+n)*sin(n*x)/n, n = 1 .. 10)) end proc (3.3)
 

> plot([f(x),g1(x),g2(x)],x=-Pi..Pi,linestyle=[1,3,3],color=[red,blue,black], legend=["Function","Fourier Series for N=3","Fourier Series for N=10"],thickness=[2,2,2]);
 

Plot
 

>
 

> g3:=x->5/4*Pi+sum(5/(n^2*Pi)*((-1)^n-1)*cos(n*x)+(-1)^(n+1)/n*sin(n*x),n = 1 .. 50);
 

proc (x) options operator, arrow; 5/4*Pi+(sum(5*((-1)^n-1)*cos(n*x)/(n^2*Pi)+(-1)^(1+n)*sin(n*x)/n, n = 1 .. 50)) end proc (3.4)
 

> g4:=x->5/4*Pi+sum(5/(n^2*Pi)*((-1)^n-1)*cos(n*x)+(-1)^(n+1)/n*sin(n*x),n = 1 .. 100);
 

proc (x) options operator, arrow; 5/4*Pi+(sum(5*((-1)^n-1)*cos(n*x)/(n^2*Pi)+(-1)^(1+n)*sin(n*x)/n, n = 1 .. 100)) end proc (3.5)
 

> plot([f(x),g3(x)],x=-Pi..Pi,linestyle=[1,3],color=[red,blue], legend=["Function","Fourier Series for N=50"],thickness=[2,2]);
 

Plot
 

>
 

SpreadSheet002 

Is evident that each delta decreases when n increases, thie is 

 

abs(f(x)-g(x)) < epsilon 

where delta < epsilon 

 

Bibliography 

 

Piskunov, N., "C?lculo Diferencial e Integral", Volume II, Spanish Edition, Mir Mosc? Editorial, Mosc?, Russian, 1986 

 

Copyright 2006 


Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.
 

Image