08extend.mws

Partial Differential Equations PowerTool

by Dr. Jim Herod

Section 2.2: Extensions

Maple Packages for Section 2.2

>    restart:

>   

Before examining the character of convergence for Fourier Trigonometric Series, there is one more idea we need to have clear in our understanding of functions on intervals of the form [0, a ] or [- a , a ]. We need to consider how such functions might be extended to the entire real line. After all, as we explain next, with whatever character the Fourier Trigonometric Series converges to a function, it will converge on the real line.

Most often, Fourier Trigonometric Series will come in one of three types:

                                 sum(a[p]*cos(p*Pi*x/L),p = 0 .. infinity) ,

        or                     sum(b[p]*sin(p*Pi*x/L),p = 1 .. infinity) ,

        or            a[0]   + sum(a[p]*cos(p*Pi*x/L)+b[p]*sin(p*Pi*x/L),p = 1 .. infinity)  .

If the first of these, if the cosine series, converges to a function f , then f  will be even and will be periodic. To see this, simply recall elementary properties of the cosine function. If the second converges to a function f , then f  must be an odd, periodic function. Finally, if the third series converges to f , then f  might be even, or odd, or neither. Again, in the third case the function f  will be periodic.

If we know the function f  on an interval [0, a ] or [- a , a ], it will be important to know how to make extensions so that we know which type series to generate. Also, as we discuss the nature of convergence, we need to have reviewed these concepts: even or odd extensions and periodic extensions. This review is the subject of this section.

Suppose a function is defined on an interval [0, L ]. We now illustrate how to extend the definition of the function so that it is defined on a larger interval. We discuss even, odd, and periodic extensions. We examine even and odd extensions first.

We draw the graph of f ( x )  = 4  x (1 -x ) on the interval [0, 1]. On this graph there also will be the even and the odd extension. The black graph is the original function. The union of the black and red graphs is the even extension of the original function. The black and green graph is the odd extension of the original function.

>    a:=1;
f:=x->4*x*(1-x);
fe:=proc(x) if x<0 then f(-x)
               else f(x)
            end if
    end:

a := 1

f := proc (x) options operator, arrow; 4*x*(1-x) end proc

fe := proc (x) if x < 0 then f(-x) else f(x) end if end proc

>    fe:=proc(x) if x<0 then f(-x)
              else f(x)
            end if
    end:
fo:=proc(x) if x<0 then -f(-x)
              else f(x)
            end if
    end:

fe := proc (x) if x < 0 then f(-x) else f(x) end if end proc

fo := proc (x) if x < 0 then -f(-x) else f(x) end if end proc

>    plot([[x,f(x),x=0..1],[x,'fe(x)',x=-1..1],[x,'fo(x)',x=-1..1]],
   color=[BLACK,RED,GREEN]);

[Maple Plot]

>   

  Definition  of Even Function : f  is even on the interval [- a, a ] if f ( x )  = f ( -x ) for all x in the interval.

  Definition  of Odd Function :   f  is odd on the interval [- a, a ] if f ( x )  = -f ( -x ) for all x in the interval.

These definitions are algebraic. There is also a geometric interpretation. A function is even if its graph is symmetric about the Y axis. A function is odd if its graph is symmetric about the origin. Look at the last graphs drawn.

There are functions that are neither even nor odd. You know many; here is one:

>    plot(x^3+x^2,x=-1..1);

[Maple Plot]

>   

 

An important idea, however, is that every function defined on an interval symmetric about the origin can be written as the sum of an even and an odd function. Here's an example for how to do that:

>    f:=x->x^3+x^2;

f := proc (x) options operator, arrow; x^3+x^2 end proc

We make the even part of f and the odd part of f .

>    fe:=x->(f(x)+f(-x))/2;
fo:=x->(f(x)-f(-x))/2;

fe := proc (x) options operator, arrow; 1/2*f(x)+1/2*f(-x) end proc

fo := proc (x) options operator, arrow; 1/2*f(x)-1/2*f(-x) end proc

Adding them together gets back the original function.

>    fe(x)+fo(x);

x^3+x^2

Look at the plot of f , its even part, and its odd part.

>    plot([[x,f(x),x=-1..1],[x,'fe(x)',x=-1..1],[x,'fo(x)',x=-1..1]],
   color=[BLACK,RED,GREEN]);

[Maple Plot]

>   

Remarks.  Of course, if a function is even or if it is odd on an interval symmetric about the origin, this has implications to what form the Fourier Series will take.

(1) Suppose that f is even on the interval [- pi ,   pi ]. Then int(f(x)*sin(n*x),x = -Pi .. Pi)  = 0.

(2) Suppose that f is odd on the interval [- pi ,   pi ]. Then int(f(x)*cos(n*x),x = -Pi .. Pi)  = 0.

(3) From either of the above two remarks if follows that

                           int(sin(n*x)*cos(m*x),x = -Pi .. Pi)  = 0.

We next want to discuss periodic extensions. Recall what a periodic function is.

Definition: The function is periodic  if there is a number P  such that f ( x+P ) = f ( x ) for all x . The smallest such positive number P  is called the period .

Examples:  The sine and cosine functions have period 2*Pi .

It is clear, is it not, that if a function is specified on some interval, then one could ask for a periodic extension. If the function were defined on an interval [0, L ], one could ask for an even periodic extension or an odd, periodic extension. In this case, one would first make an even (or odd) extension, and then make a 2  L  periodic extension. We illustrate with graphs. These notes begin with a particular function. You can modify the code to choose your f .

Generating even and odd extensions of functions

Here is an even 2 a  extension of a function defined on [0, a ].

>    a:=2;
  f:=x->x;

a := 2

f := proc (x) options operator, arrow; x end proc

>    ff:= proc(x)
if 0 <= x and x < a then f(x)
elif a <= x and x <= 2*a then f(2*a-x)
end if
end:

ff := proc (x) if 0 <= x and x < a then f(x) elif a <= x and x <= 2*a then f(2*a-x) end if end proc

>    plot(ff,0..2*a);

[Maple Plot]

>    fe:= x->ff(frac(abs(x)/(2*a))*2*a);

fe := proc (x) options operator, arrow; ff(2*frac(1/2*abs(x)/a)*a) end proc

>    plot(fe,-3*a..3*a);

[Maple Plot]

>   

Here is an odd 2  a  extension of a function defined on [0, a ].

>    a:=1;
  f:=x->x^2;

a := 1

f := proc (x) options operator, arrow; x^2 end proc

>    ff:= proc(x)
if 0 <= x and x < a then f(x)
elif a <= x and x <= 2*a then -f(2*a-x)
end if
end:

>    plot(ff,0..2*a);

[Maple Plot]

>    fo:= x->sign(x)*ff(frac(abs(x)/(2*a))*2*a);

fo := proc (x) options operator, arrow; sign(x)*ff(2*frac(1/2*abs(x)/a)*a) end proc

>    plot(fo,-3*a..3*a);

[Maple Plot]

>   

Generating periodic extensions of functions.

Suppose that f is defined on the interval [ a,b ]. In MapleTech ,   Vol . 3, NO.3, Monagan and Lopez provided the following method to output a function which extends the definition of f  to the real line using

        f ( a  + k  ( b - a ) + delta ) = f ( a  + delta )

for integer k .

>    PeriodicExtender:=proc(f,d::range)
  subs( {'F' = f, 'L'=lhs(d),
         'D'=rhs(d)-lhs(d)},
  proc(x::algebraic) local y;
      y:=floor((x-L)/D);
      F(x-y*D);
end)
end:

We try this extender for the signum function defined over the interval [-1, 2].

>    sw:=PeriodicExtender(signum,-1..2):

>    plot('sw(x)','x'=-4..4);

[Maple Plot]

We use the extender for the absolute value function defined on the interval [-1, 1].

>    g:=x->abs(x);

g := abs

>    st:=PeriodicExtender(g,-1..1):

>    plot('st(x)','x'=-3..3);

[Maple Plot]

>   

>   

Finally, we consider the implications for a Fourier Trigonometric series depending on characteristics for a function f . Here are four possible characters for the graph of f :

1a. f  is even and has period 2*pi .

1b. f  is odd and has period 2*pi .

1c. f  has period pi .

1d. f  has period 2*pi  and alternates on each half period, in the sense that

      f (x + pi ) = - f (x).

Match those possibilities with the following Fourier Series for  f:

2a. The series contains only sine terms.

2b. The series contains only cosine terms.

2c. The series contains sin(nx) and cos(nx) terms, but only for odd values of n.

2d. The series contains sin(nx) and cos(nx) terms, but only for even values of n.

In order to help see the connections in those types of series, we make examples for each of the above 2 a  through 2 c .

>    fa:=x->sum(sin(n*x)/n,n=1..4);
fb:=x->sum(cos(n*x)/n,n=1..4);
fc:=x->sum(sin((2*n+1)*x)/n+cos((2*n+1)*x)/n,n=1..4);
fd:=x->sum(sin(2*n*x)/n+cos(2*n*x)/n,n=1..4);

fa := proc (x) options operator, arrow; sum(sin(n*x)/n,n = 1 .. 4) end proc

fb := proc (x) options operator, arrow; sum(cos(n*x)/n,n = 1 .. 4) end proc

fc := proc (x) options operator, arrow; sum(sin((2*n+1)*x)/n+cos((2*n+1)*x)/n,n = 1 .. 4) end proc

fd := proc (x) options operator, arrow; sum(sin(2*n*x)/n+cos(2*n*x)/n,n = 1 .. 4) end proc

>    plot(fa(x),x=-Pi..3*Pi);

[Maple Plot]

>    plot(fb(x),x=-Pi..3*Pi);

[Maple Plot]

>    plot(fc(x),x=-Pi..3*Pi);

[Maple Plot]

>    plot(fd(x),x=-Pi..3*Pi);

[Maple Plot]

>   

>   

EMAIL: herod@math.gatech.edu   or    jherod@tds.net

URL: http://www.math.gatech.edu/~herod

Copyright ©  2003  by James V. Herod

All rights reserved