COMPLEX ANALYSIS: Mathematica 4.1 Notebooks
(c) John H. Mathews, and
Russell W. Howell, 2002
Complimentary software to accompany our textbook:

COMPLEX ANALYSIS: for Mathematics and Engineering, 
4th Edition,  2001,  ISBN: 0-7637-1425-9
Jones & Bartlett Publishers, Inc.  
40 Tall Pine Drive, Sudbury, MA 01776  
Tele.  (800) 832-0034, FAX:  (508)  443-8000  
E-mail:  mkt@jbpub.com  
Internet:  http://www.jbpub.com/  
This free software is compliments of the authors.
John H. Mathews,   mathews@fullerton.edu 
Russell W. Howell,  howell@westmont.edu

CHAPTER 11  FOURIER SERIES and the LAPLACE TRANSFORM

a = A = b = B = c = d = s = S = t = T = u = U = v = V = w = W = x = X = y = Y = z = Z = 
                                        0; 
Clear[a,a1,a2,a3,A,A1,A2,b,b1,b2,B1,B2,B,c,d,EqA,EqB,f,f1,f2,f12,F,F1,F2,F12,F3,g,G,h,H,i,int,j,k,L,Ly,L1,L2,Lf,LDf,ℒf,ℒDf,n,PQ,PR,r,res1,res2,s,solset,s1,s2,s3,S,S9,t,table,τ,T,θ,u,U,U1,U2,U7,v,v1,v2,v3,v4,val,V,w,w1,w2,W,x,X,y,y0,y1,Y,Yi,z,z1,z2,Z]; 
Needs["Calculus`FourierTransform`"]; 
Needs["Graphics`Colors`"];

Section 11.1  Fourier Series

In this chapter we show how Fourier Series, the Fourier Transform, and the Laplace Transform are related to the study of complex analysis.  We develop the Fourier Series representation for a real-valued function U(t) of the real variable t.  Complex Fourier Series and Fourier Transforms are then discussed.  Finally, we develop the Laplace Transform and the complex variable technique for finding its inverse.  This chapter focuses on applying these ideas to solving problems involving real-valued functions, so many of the theorems throughout are stated without proof.

	Let U(t) be a real-valued function that is periodic with period  2  π,  that is

		U (t + 2  π) = U (t)  for all  t.

Familiar examples of real functions that have period  2  π,  are cos (nt) and sin (nt), where n is an integer.  This raises the question whether any periodic function can be represented by a sum of terms involving (Subscript[a, n]) cos (nt) and (Subscript[b, n]) sin (nt), where (Subscript[a, n])  and  (Subscript[b, n]) are real constants.  As we shall soon see, the answer to this question is often yes.

Definition 11.1 (Piecewise Continuous), Page 484. The function U (t) is piecewise continuous on the closed interval [a,b], if there exists values (Subscript[t, 0]), (Subscript[t, 1]),  ... , (Subscript[t, n]) with a = (Subscript[t, 0]) < (Subscript[t, 1]) <  ...  < (Subscript[t, n]) = b such that U is continuous in each of the open intervals (Subscript[t, k - 1]) < t < (Subscript[t, k]), for k = 1, 2,  ... , n and has left-hand and right-hand limits at each of the values (Subscript[t, k]), for k = 0, 1, 2,  ... , n.

Definition 11.2 (Fourier Series), Page 485. If U (t) is periodic with period 2  π and is piecewise continuous on[-π, π], then the Fourier Series S (t) for U (t) is

	S (t) = 
        ((Subscript[a, 0])/2) + (∑_(j = 1)^∞)((Subscript[a, j]) 
                  cos (j t) + (Subscript[b, j]) sin (j t)),

where the coefficients (Subscript[a, j]) and (Subscript[b, j])  are given by the so-called Euler's formulae:  

	(Subscript[a, j])=(1/π)(∫_(-π)^π)U(t)cos(j t)dt  for j=0,1,...,  

	and  

	(Subscript[b, j])=(1/π)(∫_(-π)^π)U(t)sin(j t)dt  for j=1,2,....

Theorem 11.1 (Fourier Expansion), Page 485. Assume that S (t) is the Fourier Series for U (t). If U(t) and U'(t) are piecewise continuous on [-π, π], then S (t) is convergent for all t ϵ[-π, π].  

The relation U (t) = S (t) holds for all t ϵ[-π, π]where U is continuous. If t = a is a point of discontinuity of U, then

 	\(S \((a)\) = \(U \((\(a\^-\))\)\  + \ U \((\(a\^+\))\)\)\/2\),  
 
 where U\((\(a\^-\))\) and U\((\(a\^+\))\) denote the left-hand and right-hand limits, respectively.  With this understanding, we have the Fourier Series expansion:
 
	U (t)  =  
        ((Subscript[a, 0])/2) + (∑_(j = 1)^∞)((Subscript[a, j]) 
                  cos (j t) + (Subscript[b, j]) sin (j t)) .

A complete discussion of the details of the proof of Theorem 1.1 can be found in some advanced texts.  See for example, John W. Dettman, Chapter 8 in "Applied Complex Variables", The Macmillan Company, New York, 1965.

Method I. Fourier Series - Trigonometric Polynomials.  Execute the following sells to set up the procedure S[n,t] for finding the Fourier Series - Trigonometric Polynomial of degree n.

Clear[a, b, j, n, t, u];  
a[
          j_]  =  (1/π) (∫_(-π)^π) u[t] 
              Cos[j t] \[DifferentialD]t;  
b[
          j_]  =  (1/π) (∫_(-π)^π) u[t] 
              Sin[j t] \[DifferentialD]t;  
FS[n_, t_] := 
        a[0]/2 + (∑_(j = 1)^n)(a[j] Cos[j t] + 
                b[j] Sin[j t]);  
\(\(Print[\*""   \!\(a\_n\) = "", a[j]];\)\ \ \)
\(\(Print[\*""   \!\(b\_n\) = "", b[j]];\)\ \ \)
\(\(Print[\*""(Subscript[S, n])[t] = a[0]/2+(∑_(j = 1)^n)(a[j]Cos[j t]+b[j]Sin[j t]""];\)\ \ \)

Example 11.1,  Page 485.  Find the Fourier Series expansion of  u (t) = 
        (t/2)  for   - π ≤ t ≤ π.

Solution 11.1.

Enter the function u[t], and for illustration construct the Fourier Series - Trigonometric Polynomial of degree n = 9.

Clear[S, S9, t, u];  
u[t_]  =  (t/2);  
S9[t_]  =  FS[9, t];  
Print[" u[t] = ", u[t]];  
\(\(Print[\*""\!\(S\_9\)[t] = "", 
        S9[t]];\)\ \ \)

We can also get this result using Mathematica's built in procedure FourierTrigSeries.

S9[t_]  =  
        Expand[FourierTrigSeries[u[t], t, 
            9, 
FourierParameters -> {0, 
                (1/(2  π))}]];  
\(\(Print[\*""\!\(S\_9\)[t] = "", 
        S9[t]];\)\ \ \)

A graph of  u[t], (Subscript[S, 1])[t], (Subscript[S, 2])[t], and  (Subscript[S, 3])[t]  is given below.

S1[t_]  =  FS[1, t];  
S2[t_]  =  FS[2, t];  
S3[t_]  =  FS[3, t];  
\(\(Plot[{u[t], S1[t], S2[t], S3[t]}, {t, \(-Pi\), Pi}, 

        PlotRange -> {{\(-π\), π}, {\(-π\)\/2, π\/2}}, 
        AspectRatio -> 1\/2, 
        PlotStyle -> {Magenta, Red, Green, Blue}, 
        AxesLabel -> {"t", "s"}, 
        Ticks -> {Range[\(-π\), π, π\/2], 
            Range[\(-π\)\/2, π\/2, π\/2]}];\)\ \ \)
Print[" u[t] = ", u[t]];  
\(\(Print[\*""\!\(S\_1\)[t] = "", S1[t]];\)\ \ \)
\(\(Print[\*""\!\(S\_2\)[t] = "", S2[t]];\)\ \ \)
\(\(Print[\*""\!\(S\_3\)[t] = "", 
        S3[t]];\)\ \ \)

The general term for the series is  ((((-1))^(n - 1))/n) Sin[n t].  We can sum up 9 terms and see that it agrees with (Subscript[S, 9])[t].
Then we can sum the infinite series  S[
          t] = (∑_(j = 1)^∞)((((-1))^(j - 1))/j) Sin[
              j t]  and see if it agrees with  u[t] = (t/2).

s9 =  (∑_(j = 1)^9)((((-1))^(j - 1))/j) Sin[j t];  
S[
          t_] =  (∑_(j = 1)^∞)((((-1))^(j - 1))/j) Sin[j t];  
\(\(Print[\*""Does (Subscript[S, 9])[t] = (∑_(j = 1)^9)((((-1))^(j - 1))/j) Sin[j t] ? "", 
        S9[t] == s9];\)\ \ \)
Print[""];  
\(\(Print[\*""S[t] = (∑_(j = 1)^∞)((((-1))^(j - 1))/j) Sin[j t]""];\)\ \ \)
Print[""];  
Print["S[t] = ", S[t]];  
Print["u[t] = ", u[t]];

We can plot  S[t]  to see what it looks like.

\(
\(Plot[{S[t], S1[t], S2[t], 
          S3[t]}, {t, \(-3\) π, 3  π}, 

        PlotRange -> {{\(-3\) π, 
              3  π}, {\(-π\)\/2, π\/2}}, 
        AspectRatio -> 1\/2, 
        PlotStyle -> {Magenta, Red, Green, Blue}, 
        AxesLabel -> {"t", "s"}, 
        Ticks -> {Range[\(-2\) π, 2  π, π], 
            Range[\(-π\)\/2, π\/2, π\/2]}];\)\ \ \)
Print[" S[t] = ", S[t]];  
\(\(Print[\*""\!\(S\_1\)[t] = "", S1[t]];\)\ \ \)
\(\(Print[\*""\!\(S\_2\)[t] = "", S2[t]];\)\ \ \)
\(\(Print[\*""\!\(S\_3\)[t] = "", 
        S3[t]];\)\ \ \)

Therefore,  S[t] = 
        (1/2) i (Log[
                1 + (e^(-i t))] - 
              Log[1 + (e^(i t))]) is the periodic extension of  u[t] = (t/2).

Theorem 11.2,  Page 486.  If  U (t)  and  V (t)  have Fourier series representations, then their sum  W (t) = U (t) + V (t)  has a Fourier series representation, and the Fourier coefficients of  W  are obtained by adding the corresponding coefficients of  U  and  V.

Theorem 11.3 (Fourier Cosine Series), Page 487. Assume that U (t) is an even function and has period 2  π. If U(t) and U'(t) are piecewise continuous, the Fourier series for   U (t)  involves only the cosine terms,  (i.e.  (Subscript[b, j])=0  for all  j),  and we write  

	U (t) = 
        ((Subscript[a, 0])/2) + (∑_(j = 1)^∞) (Subscript[a, j]) cos (j t),  

where (Subscript[a, j]) = (2/π) (∫_0^π) U (t) 
                cos (j t) dt  for  j = 0, 
      1,  ... .

Theorem 11.4 (Fourier Sine Series), Page 487. Assume that U (t) is an odd function and has period 2  π. If U(t) and U'(t) are piecewise continuous, the Fourier series for   U (t)  involves only the sine terms,  (i.e.  (Subscript[a, j])=0  for all  j),  and we write  

	U (t) = (∑_(j = 1)^∞) (Subscript[b, j]) 
            sin (j t),  

where  (Subscript[b, j]) = (2/π) (∫_0^π) U (t) 
                sin (j t) dt  for  j = 1, 
      2,  ... .

Theorem 11.5  (Termwise Integration),  Page 487.  Assume that  U (t)  has the Fourier series representation  

  	U (t) = 
        ((Subscript[a, 0])/2) + (∑_(j = 1)^∞)((Subscript[a, j]) 
                  cos (j t) + (Subscript[b, j]) sin (j t)).  

Then the integral  of  U (t)  has a Fourier series representation which can be obtained by termwise integration of the Fourier series of  U (t),  that is  

	\(∫\_0\%t\ 
          U \((τ)\) dτ = ∑\+\(j = 1\)\%∞\((\((a\_j\  + \ \((\(-1\))\)\^\(j + 1\)\ a\_0)\)\/j\ sin\ \((j\ t)\) - \(b\_j\/j\) cos\ \((j\ t)\))\)\),  

where we have used the expansion  \(\(\(a\_0\) t\)\/2 = ∑\+\(j = 1\)\%∞\(\(\((\(-1\))\)\^\(j + 1\)\ a\_0\)\/j\) sin\ \((j\ t)\)\).

Theorem 11.6  (Termwise Differentiation),  Page 488.  Assume that both  U (t)  and  U' (t)  have Fourier series representation and that  

	U (t) = 
        ((Subscript[a, 0])/2) + (∑_(j = 1)^∞)((Subscript[a, j]) 
                  cos (j t) + (Subscript[b, j]) sin (j t)).  

Then  U' (t)  can be obtained by termwise differentiation of  U (t),  that is  

	\(U' \((t)\) = ∑\+\(j = 1\)\%∞\((j\ b\_j\ cos\ \((j\ t)\) - j\ a\_j\ sin\ \((j\ t)\))\)\).

Method II.  Fourier Series - Trigonometric Polynomials.  Modify procedure S[n,t] for finding the Fourier Series - Trigonometric Polynomial of degree n to the case of a piecewise continuous function on the subintervals  [-π, 0)  and  (0, π].

Clear[a, b, j, n, t, u1, u2]; 
a[
          j_]  =  (1/π) ((∫_(-π)^0) u2[t] 
                  Cos[j t] \[DifferentialD]t  + (∫_0^π) u1[t] 
                  Cos[j t] \[DifferentialD]t) ; 
b[
          j_]  =  (1/π) ((∫_(-π)^0) u2[t] 
                  Sin[j t] \[DifferentialD]t  + (∫_0^π) u1[t] 
                  Sin[j t] \[DifferentialD]t) ; 
TP[n_, t_] := 
        a[0]/2 + (∑_(j = 1)^n)(a[j] Cos[j t] + 
                b[j] Sin[j t]); 
\(\(Print[\*""   \!\(a\_n\) = "", a[j]];\)\ \)
\(\(Print[\*""   \!\(b\_n\) = "", b[j]];\)\ \)
\(\(Print[\*""(Subscript[T, n])[t] = a[0]/2+(∑_(j = 1)^n)(a[j]Cos[j t]+b[j]Sin[j t])""];\)\ \)

Example 11.2,  Page 488.  The function  u[
          t] = |t|  for   - π ≤ 
            t ≤ π  has the Fourier series representation  

\(T[
          t] = π\/2 - \(4\/π\) \(∑\+\(j = 1\)\%∞ Cos[\((2  j\  - \ 1)\) t]\/\((2  j\  - \ 1)\)\^2\)\).

Solution 11.2.

Enter the function u[t], and for illustration construct the Fourier Series - Trigonometric Polynomial of degree n = 9.

Clear[T, T9, t]; 
u1[t_]  =  t; 
u2[t_]  =  -t; 
T9[t_]  =  TP[9, t]; 
Print[" u[t] = ", 
        u1[t], "   for  0 ≤ t ≤ π"]; 
Print[" u[t] = ", 
        u2[t], "  for -π ≤ t ≤ 0"]; 
\(\(Print[\*""\!\(T\_9\)[t] = "", 
        T9[t]];\)\ \)

We can also get this result using Mathematica's built in procedure FourierTrigSeries.

T9[t_]  =  
        Expand[FourierTrigSeries[Abs[t], t, 
            9, 
FourierParameters -> {0, 
                (1/(2  π))}]]; 
\(\(Print[\*""\!\(T\_9\)[t] = "", 
        T9[t]];\)\ \)

A graph of  u[t], (Subscript[T, 1])[t], and  (Subscript[T, 3])[t]  is given below.

T1[t_]  =  TP[1, t]; 
T3[t_]  =  TP[3, t]; 
\(\(Plot[{Abs[t], T1[t], T3[t]}, {t, \(-π\), π}, 

        PlotRange -> {{\(-π\), π}, {0, π}}, 
        AspectRatio -> 1\/2, PlotStyle -> {Magenta, Blue, Green}, 
        AxesLabel -> {"t", "s"}, 
        Ticks -> {Range[\(-π\), π, π\/2], 
            Range[0, π, π\/2]}];\)\ \)
Print[" u[t] = ", Abs[t]]; 
\(\(Print[\*""\!\(T\_1\)[t] = "", T1[t]];\)\ \)
\(\(Print[\*""\!\(T\_3\)[t] = "", 
        T3[t]];\)\ \)

The general term for the series is  Cos[(2  j  -  1) t]/(((2  j  -  1))^2).  We can sum up 5 terms and see that it agrees with  (Subscript[T, 9])[t].
Then we can sum the infinite series  \(T[
          t] = π\/2 - \(4\/π\) \(∑\+\(j = 1\)\%∞ Cos[\((2  j\  - \ 1)\) t]\/\((2  j\  - \ 1)\)\^2\)\)  and see if it agrees with  u[t] = |t|.

t9 = 
        Expand[(π/2) - (4/π) (∑_(j = 1)^5) Cos[(2  j - 1) t]/(((2  j - 1))^2)]; 
T[
          t_] = (π/2) - (4/π) (∑_(j = 1)^∞) Cos[(2  j - 1) t]/(((2  j - 1))^2); 
\(\(Print[\*""Does (Subscript[T, 9])[t] = (π/2)-(4/π)(∑_(j = 1)^5)Cos[(2  j - 1) t]/(((2  j - 1))^2) ? "", 
        T9[t] == t9];\)\ \)
Print[""]; 
\(\(Print[\*""T[t] = (π/2)-(4/π)(∑_(j = 1)^∞)Cos[(2  j - 1) t]/(((2  j - 1))^2)""];\)\ \)
Print[""]; 
Print["T[t] = ", T[t]]; 
Print["u[t] = ", Abs[t]];

We can plot  T[t]  to see what it looks like.

\(
\(Plot[{T[t], T1[t], 
          T3[t]}, {t, \(\(-5\) π\)\/2, \(5  π\)\/2}, 

        PlotRange -> {{\(\(-5\) π\)\/2, \(5  π\)\/2}, {0, π}}, AspectRatio -> 1\/2, PlotStyle -> {Magenta, Blue, Green}, 
        AxesLabel -> {"t", "s"}, 
        Ticks -> {Range[\(-2\) π, 2  π, π], 
            Range[0, π, π\/2]}];\)\ \)
Print[" T[t] = ", T[t]]; 
\(\(Print[\*""\!\(T\_1\)[t] = "", T1[t]];\)\ \)
\(\(Print[\*""\!\(T\_3\)[t] = "", 
        T3[t]];\)\ \)

Therefore,  \(T[
          t] = π\/2 - \(e\^\(\(-i\)\ t\)\ \((LerchPhi[e\^\(\(-2\)\ i\ t\), 2, 1\/2] + e\^\(2\ i\ t\)\ LerchPhi[e\^\(2\ i\ t\), 2, 1\/2])\)\)\/\(2\ π\)\) is the periodic extension of  u[t] = |t|.

Section 11.1  Exercises for Fourier Series
See textbook page 490.

Section 11.2	The Dirichlet Problem for the Unit Disk

Section 11.3	Vibrations in Mechanical Systems

Section 11.4	The Fourier Transform

Section 11.5	The Laplace Transform

Section 11.6	Laplace Transforms of Derivatives and Integrals

Section 11.7	Shifting Theorems and the Step Function

Section 11.8	Multiplication and Division by  t

Section 11.9	Inverting the Laplace Transform

Section 11.10	Convolution

GO TO  THE  Table of Contents