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["Graphics`Colors`"];

Section 11.1	Fourier Series

Section 11.2	The Dirichlet Problem for the Unit Disk

Section 11.3  Vibrations in Mechanical Systems

Consider a spring that resists compression as well as extension, that is suspended vertically from a fixed support, and a body of mass  m  that is attached at the lower end of the spring.  We make the assumption that the mass  m  is much larger than the mass of the spring so that we can neglect the mass of the spring.  If there is no motion then the system is in static equilibrium.  If the mass is pulled down further and released, then it will undergo an oscillatory motion.

	Suppose that there is no friction to slow down the motion of the mass, then we say that the system is undamped.  We will determine the Simple Harmonic Motion of this mechanical system by considering the forces acting on the mass during the motion.  This will lead to a differential equation relating the displacement as a function of time.  For details see page 412 in the textbook.  The undamped mechanical system is governed by the linear differential equation

	m U'' (t)  +  k U (t)  =  0,  

and the general solution to this D. E. is known to be  U (t)  =  
        A cos (ω t) + 
          B sin (ω t),   where  ω = (Sqrt[(k/m)]).

If we consider frictional forces that slow down the motion of the mass, then we say that the system is damped.  This is visualized by connecting a dashpot (or shock adsorber) to the mass.  For small velocities it is assumed that the frictional force is proportional to velocity.  The damping constant  c  must be positive.  For details see page 414 in the textbook.  The Damped Mechanical Motion is governed by the linear differential equation

	m U'' (t)  +  c U' (t)  +  k U (t)  =  0.

The two cases mentioned above are called free vibrations because all the forces that affect the motion of the system are internal to the system.  We extend our analysis to cover the case in which an external force  F(t)  acts on the mass.  Such a force might occur from vibrations of the support to which the top of the spring is attached, or from the effect of a magnetic field on a mass made of iron.  For details see page 414 in the textbook.  The forced motion of the mechanical system satisfies the nonhomogeneous linear differential equation  

	m U'' (t)  +  c U' (t)  +  k U (t)  =  
        F (t).  

The function  F(t)  is called the input or driving force and the solution  U(t)  is called the output or response.  Of particular interest are periodic inputs  F(t)  that can be represented by Fourier Series.

For damped mechanical systems that are driven by a periodic input  F(t),  the general solution involves a transient part that vanishes as  t  ->  +∞,  and a steady state part that is periodic.  The transient part of the solution  (Subscript[U, h]) (t)  is found by solving the homogeneous differential equation

	m (Subscript[U, h]^( '')) (t)  +  
          c (Subscript[U, h]^( ')) (t)  +  
          k (Subscript[U, h]) (t)  =  0.  

This D. E.  leads to the characteristic equation  m (λ^2)  +  c λ  +  k  =  0,  which has roots  \(λ\  = \ \(\(-\ c\)\ \  ± \ \ \@\(c\^2\ \  - \ \ 4  m\ k\)\)\/\(2  m\)\).  The constants  m, c, and k  are all positive, and there are three cases to consider.

	If  (c^2)   -   4  m k  > 0, then the roots are real and distinct, and since  (Sqrt[(c^2)   -   4  m k]) < c, it follows that the roots  (Subscript[λ, 1])  and  (Subscript[λ, 2]) are negative real numbers.  Thus for this case we have 

	\(\(U\_h\) \((t)\)\  = \ \(A\_1\) e\^\(\(λ\_1\) t\)\  + \ \(A\_2\) e\^\(\(λ\_2\) t\)\),  and  (lim_(t  ->  +∞)) (Subscript[U, h]) (t) = 0.

If  (c^2)   -   4  m k  = 0, then the roots are real and equal, (Subscript[λ, 1])  =  (Subscript[λ, 2]) = λ,  where λ  is a negative real number, and for this case we have 

	\(\(U\_h\) \((t)\)\  = \ \(A\_1\) e\^λt\  + \ \(A\_2\) t\ e\^λt\),  and  (lim_(t  ->  +∞)) (Subscript[U, h]) (t) = 0.

If  (c^2)   -   4  m k  < 0, then the roots are complex conjugates,  \(λ = \(-\ α\)\  ± \ i\ β\),  where  α  and  β  are positive real number, and it follows that

	\(\(U\_h\) \((t)\)\  = \ \(A\_1\) \(e\^\(\(-\ α\)\ t\)\) cos \((β\ t)\)\  + \ \(A\_2\) e\^\(\(-\ α\)\ t\)\ sin \((β\ t)\)\),  and  (lim_(t  ->  +∞)) (Subscript[U, h]) (t) = 0.

In all three cases, we see that the homogeneous solution  (Subscript[U, h]) (t)  decays to  0  as  t  ->  +∞.  

	The steady state solution  (Subscript[U, p]) (t)  can be obtained by representing  (Subscript[U, p]) (t)  by its Fourier series and substituting  \(\(U\_p\%\(\(\ \)\(''\)\)\) \((t)\), \(U\_p\%\(\(\ \)\('\)\)\) \((t)\), \ and\ \ \(U\_p\) \((t)\)\)  into the nonhomogeneous differential equation and solving the resulting system for the Fourier coefficients of  (Subscript[U, p]) (t).  The general solution to the nonhomogeneous linear differential equation is  

	U (t)  =  (Subscript[U, h]) (t)  +  (Subscript[U, p]) (t).

Example 11.4,  Page 504.  Find the general solution to  U'' (t) + 2 U' (t) + U (t) = F (t),  where F(t) is given by the Fourier series  \(F[
          t] = ∑\+\(k = 1\)\%∞ Cos[\((2  k\  - \ 1)\) t]\/\((2  k\  - \ 1)\)\^2\).

Solution 11.4.

First, find the transient solution to the differential equation.

Remove[c, U, t]; 
de = U''[t] + 2 U'[t] + U[t] == 0; 
solset = DSolve[de, U[t], t]; 
Uh[t_] = 
        ReplaceAll[
          (Subscript[solset, [[1, 1, 2]]]), {C[1] -> (Subscript[c, 1]), 
            C[2] -> (Subscript[c, 2])}]; 
Print[de]; 
Print[""]; 
Print[solset]; 
Print[""]; 
Print["The transient solution to the D.E. is"]; 
\(\(Print[\*""\!\(U\_h\)[t] = "", 
        Uh[t]];\)\ \)

Next, use Fourier series to construct the steady state solution to the differential equation.  Enter the formula for the n-th terms T[n,t] and F[n,t] of the Fourier Series for U[t] and F[t], respectively.  Then form the equation relating the n-terms and the equations involving Cos[n t] and Sin[n t].  Then solve these equations for the Fourier coefficients of  U[t].

Remove[a, b, A, B, S, t, T, 
        U]; 
Clear[EqA, EqB, f, F, k, L, m, n]; 
T[n_, t_]  =  (Subscript[A, n]) Cos[n t]  +  (Subscript[B, n]) Sin[n t]; 
F[0, t_]  =  0; 
F[n_, t_]  =  ((1 - (((-1))^n))/2) 
          Cos[n t]/(n^2); 
Print["T[n,t] = ", T[n, t]]; 
Print["F[n,t] = ", F[n, t]]; 
Print[""]; 
Print[
        Eq  =  (∂_(t, t))T[n, t]  +  
              2 (∂_t) T[n, t]  +  T[n, t]  ==  
            F[n, t]]; 
Print[""]; 
Print[
        EqA  =  
          ReplaceAll[
            Eq, {Cos[n t]  ->  1, 
              Sin[n t]  ->  0}]]; 
Print[
        EqB  =  
          ReplaceAll[
            Eq, {Sin[n t]  ->  1, 
              Cos[n t]  ->  0}]]; 
Print[""]; 
solset  =  Solve[{EqA, EqB},  {(Subscript[A, n]), (Subscript[B, n])}]; 
(Subscript[a, n])_  =  
        (Subscript[solset, [[1, 1, 2]]]); 
(Subscript[b, n])_  =  
        (Subscript[solset, [[1, 2, 2]]]); 
(Subscript[a, 0])   =  2 F[0, t]; 
\(\(Print[\*""\!\(a\_0\) = "", a\_0];\)\ \)
\(\(Print[\*""\!\(a\_n\) = "", a\_n];\)\ \)
\(\(Print[\*""\!\(b\_n\) = "", 
        b\_n];\)\ \)

Use the Fourier coefficients of U[t] and form the n-th term of the series  U[n,t], and verify that it satisfies the given D.E.

U[n_, t_]  =  
        (Subscript[a, n]) Cos[n t]  +  (Subscript[b, n]) Sin[n t]; 
U[0, t]    = (( (Subscript[a, 0]))/2); 
Print["U[0,t] = ", U[0, t]]; 
Print["U[n,t] = ", U[n, t]]; 
Print[""]; 
Print["Is the n-th term in the D.E. satisfied ?"]; 
L  =  (∂_(t, t))U[n, t]  +  
          2 (∂_t) U[n, t]  +  U[n, t]; 
\(\(Print[\*""(∂_(t, t))U[n,t] + 2(∂_t)U[n,t] + U[n,t] = "", 
        F[n, t]];\)\ \)
Print[""]; 
Print[L, " = ", F[n, t]]; 
Print[""]; 
Print[MapAll[Together, L], " = ", F[n, t]]; 
Print[
        MapAll[Together, L == F[n, t]]];

Construct the Trigonometric Polynomial  (Subscript[S, 5])[t]  of degree n = 5 and verify that it satisfies the D.E.

S[
          t_]  =  (∑_(n = 0)^5) U[n, t]; 
L  =  S''[t]  +  2 S'[t]  +  S[t]; 
\(\(Print[\*""(Subscript[S, 5])[t] = (∑_(n = 0)^5)U[n,t] = "", S[t]];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(S\_5\)'[t] = "", \(S'\)[t]];\)\ \)
\(\(Print[\*""\!\(S\_5\)''[t] = "", \(\(S'\)'\)[t]];\)\ \)
Print[" "]; 
Print["The left and right side of the D.E. are"]; 
\(\(Print[\*""(Subscript[S, 5])''[t] + 2 (Subscript[S, 5])'[t] + (Subscript[S, 5])[t] = "", Expand[L]];\)\ \)
f[t_]  =  (∑_(n = 0)^5) F[n, t]; 
\(\(Print[\*""(Subscript[f, 5])[t] =  (∑_(n = 0)^5)F[n,t] = "", f[t]];\)\ \)
Print[" "]; 
\(\(Print[\*""(Subscript[S, 5])''[t] + 2 (Subscript[S, 5])'[t] + (Subscript[S, 5])[t] == (Subscript[f, 5])[t]""];\)\ \)
Print[Expand[L], " == ", f[t]]; 
Print[Expand[L]  ==  f[t]];

Look at the size of the coefficients  (Subscript[a, n])  and  (Subscript[b, n])  and observe that
\(lim\_\(n -> ∞\)\ 
          a\_n = \(lim\_\(n -> ∞\)\ \(\((\(-1\)\  + \ \((\(-1\))\)\^n)\)\ \((\(-1\)\  + \ n\^2)\)\)\/\(2\ n\^2\ \((1\  + \ n\^2)\)\^2\)\  = \ 0\)\)
\(lim\_\(n -> ∞\)\ 
          b\_n = \(lim\_\(n -> ∞\)\ \(1\  - \ \((\(-1\))\)\^n\)\/\(n\ \((1\  + \ n\^2)\)\^2\)\  = \ 0\)\) 
We can investigate these sequences.

m = 5; 
as = Table[(Subscript[a, k]), {k, 0, m}]; 
bs = Table[(Subscript[b, k]), {k, 1, m}]; 
as = Append[as, "..."]; 
bs = Append[bs, "..."]; 
\(\(Print[\*""{\!\(a\_n\)} = "", 
        as];\)\ \)
\(\(Print[\*""{\!\(b\_n\)} = "", 
        bs];\)\ \)
Print[""]; 
\(\(Print[\*""{\!\(a\_n\)} = "", 
        NumberForm[N[as], 3]];\)\ \)
\(\(Print[\*""{\!\(b\_n\)} = "", 
        NumberForm[N[bs], 3]];\)\ \)

Maybe  (Subscript[S, 5])[t] is a close approximation to the solution. A graph of  (Subscript[S, 5])[t]  is given below.

\(
\(Plot[S[t], {t, \(-2\) Pi, 2  Pi}, 
        PlotStyle -> 
          Magenta, 
PlotRange -> {{\(-2\) π, 
              2  π}, {\(-0.5\), 0.5}}, 
        AxesLabel -> {"t", "s"}, 
Ticks -> {Range[\(-2\) π, 2  π, π], 
            Range[\(-0.5\), 0.5, 0.1]}];\)\ \)
\(\(Print[\*""The Trigonometric Polynomial (Subscript[S, 5])[t] is an approximation""];\)\ \)
\(\(Print[\*""to the steady state solution (Subscript[U, p])[t] of the D.E.""];\)\ \)
\(\(Print[\*""\!\(S\_5\)[t] = "", 
        S[t]];\)\ \)

For illustration purposes, use the approximate solution  U[t] = (Subscript[U, h])[t] + (Subscript[S, 5])[t]  and use it so solve  U[0] = 1, U'[0] = 0, and plot the result.

eqns = {Uh[0] + S[0] == 
            1, Uh'[0] + S'[0] == 0}; 
solset = Solve[eqns, {(Subscript[c, 1]), (Subscript[c, 2])}]; 
U[t_] = 
        S[t] + ReplaceAll[Uh[t], 
            (Subscript[solset, [[1]]])]; 
\(\(Plot[{U[t], S[t]}, {t, 0, 4  Pi}, 
        PlotStyle -> {Blue, 
            Magenta}, 
PlotRange -> {{0, 
              4  π}, {\(-0.5\), 1.05}}, 
        AxesLabel -> {"t", "s"}, 
Ticks -> {Range[0, 4  π, π], 
            Range[\(-0.5\), 1.0, 0.25]}];\)\ \)
\(\(Print[\*""The Trigonometric Polynomial (Subscript[S, 5])[t] is used to form""];\)\ \)
\(\(Print[\*""an approximation to the solution U[t] = (Subscript[U, h])[t] + (Subscript[S, 5])[t]""];\)\ \)
\(\(Print["with the initial conditions U[0]=1, and U'[0] = 0"];\)\ \)
Print["U[t] = ", U[t]];

Exercise 1 (a),  Page 505.  Find the general solution to  U'' (t) + 3 U' (t) + U (t) = F (t),  where F(t) is given by the Fourier series  F[
          t] = (∑_(n = 1)^∞)((((-1))^(n - 1))/n) Sin[
              n t].

Solution 1 (a).

First, find the transient solution to the differential equation.

Remove[c]; 
Clear[U, t]; 
de = U''[t] + 3 U'[t] + U[t] == 0; 
solset = DSolve[de, U[t], t]; 
Uh[t_] = 
        ReplaceAll[
          (Subscript[solset, [[1, 1, 2]]]), {C[1] -> (Subscript[c, 1]), 
            C[2] -> (Subscript[c, 2])}]; 
Print[de]; 
Print[""]; 
Print[solset]; 
Print[""]; 
Print["The transient solution to the D.E. is"]; 
\(\(Print[\*""\!\(U\_h\)[t] = "", 
        Uh[t]];\)\ \)

Next, use Fourier series to construct the steady state solution to the differential equation.  Enter the formula for the n-th terms T[n,t] and F[n,t] of the Fourier Series for U[t] and F[t], respectively.  Then form the equation relating the n-terms and the equations involving Cos[n t] and Sin[n t].  Then solve these equations for the Fourier coefficients of  U[t].

Remove[a, b, A, B, S, t, T, 
        U]; 
Clear[EqA, EqB, f, F, k, L, m, n]; 
T[n_, t_]  =  (Subscript[A, n]) Cos[n t]  +  (Subscript[B, n]) Sin[n t]; 
F[0, t_]  =  0; 
F[n_, 
          t_]  =  (((((-1))^(n - 1)) Sin[n t])/n); 
Print["T[n,t] = ", T[n, t]]; 
Print["F[n,t] = ", F[n, t]]; 
Print[""]; 
Print[
        Eq  =  (∂_(t, t))T[n, t]  +  
              3 (∂_t) T[n, t]  +  T[n, t]  ==  
            F[n, t]]; 
Print[""]; 
Print[
        EqA  =  
          ReplaceAll[
            Eq, {Cos[n t]  ->  1, 
              Sin[n t]  ->  0}]]; 
Print[
        EqB  =  
          ReplaceAll[
            Eq, {Sin[n t]  ->  1, 
              Cos[n t]  ->  0}]]; 
Print[""]; 
solset  =  Solve[{EqA, EqB},  {(Subscript[A, n]), (Subscript[B, n])}]; 
(Subscript[a, n])_  =  
        (Subscript[solset, [[1, 1, 2]]]); 
(Subscript[b, n])_  =  
        (Subscript[solset, [[1, 2, 2]]]); 
(Subscript[a, 0])   =  2 F[0, t]; 
\(\(Print[\*""\!\(a\_0\) = "", a\_0];\)\ \)
\(\(Print[\*""\!\(a\_n\) = "", a\_n];\)\ \)
\(\(Print[\*""\!\(b\_n\) = "", 
        b\_n];\)\ \)

Use the Fourier coefficients of U[t] and form the n-th term of the series  U[n,t], and verify that it satisfies the given D.E.

U[n_, t_]  =  
        (Subscript[a, n]) Cos[n t]  +  (Subscript[b, n]) Sin[n t]; 
U[0, t]    = (( (Subscript[a, 0]))/2); 
Print["U[0,t] = ", U[0, t]]; 
Print["U[n,t] = ", U[n, t]]; 
Print[""]; 
Print["Is the n-th term in the D.E. satisfied ?"]; 
L  =  (∂_(t, t))U[n, t]  +  
          3 (∂_t) U[n, t]  +  U[n, t]; 
\(\(Print[\*""(∂_(t, t))U[n,t] + 3 (∂_t)U[n,t] + U[n,t] = "", F[n, t]];\)\ \)
Print[""]; 
Print[L, " = ", F[n, t]]; 
Print[""]; 
Print[MapAll[Together, L], " = ", F[n, t]]; 
Print[
        MapAll[Together, L == F[n, t]]];

Construct the Trigonometric Polynomial  (Subscript[S, 5])[t]  of degree n = 5 and verify that it satisfies the D.E.

S[
          t_]  =  (∑_(n = 0)^5) U[n, t]; 
L  =  S''[t]  +  3 S'[t]  +  S[t]; 
\(\(Print[\*""(Subscript[S, 5])[t] = (∑_(n = 0)^5)U[n,t] = "", S[t]];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(S\_5\)'[t] = "", \(S'\)[t]];\)\ \)
\(\(Print[\*""\!\(S\_5\)''[t] = "", \(\(S'\)'\)[t]];\)\ \)
Print[" "]; 
Print["The left and right side of the D.E. are"]; 
\(\(Print[\*""(Subscript[S, 5])''[t] + 3 (Subscript[S, 5])'[t] + (Subscript[S, 5])[t] = "", Expand[L]];\)\ \)
f[t_]  =  (∑_(n = 0)^5) F[n, t]; 
\(\(Print[\*""(Subscript[f, 5])[t] = (∑_(n = 0)^5)F[n,t] = "", f[t]];\)\ \)
Print[" "]; 
\(\(Print[\*""(Subscript[S, 5])''[t] + 3 (Subscript[S, 5])'[t] + (Subscript[S, 5])[t] == (Subscript[f, 5])[t]""];\)\ \)
Print[Expand[L], " == ", f[t]]; 
Print[Expand[L]  ==  f[t]];

Look at the size of the coefficients  (Subscript[a, n])  and  (Subscript[b, n])  and observe that
\(lim\_\(n -> ∞\)\ 
          a\_n = \(lim\_\(n -> ∞\)\ \(3\ \((\(-1\))\)\^n\)\/\(1 + 7\ n\^2 + n\^4\)\  = \ 0\)\)
\(lim\_\(n -> ∞\)\ 
          b\_n = \(lim\_\(n -> ∞\)\ \(\((\(-1\))\)\^n\ \((\(-1\) + n\^2)\)\)\/\(n\ \((1 + 7\ n\^2 + n\^4)\)\)\  = \ 0\)\) 
We can investigate these sequences.

m = 5; 
as = Table[(Subscript[a, k]), {k, 0, m}]; 
bs = Table[(Subscript[b, k]), {k, 1, m}]; 
as = Append[as, "..."]; 
bs = Append[bs, "..."]; 
\(\(Print[\*""{\!\(a\_n\)} = "", 
        as];\)\ \)
\(\(Print[\*""{\!\(b\_n\)} = "", 
        bs];\)\ \)
Print[""]; 
\(\(Print[\*""{\!\(a\_n\)} = "", 
        NumberForm[N[as], 3]];\)\ \)
\(\(Print[\*""{\!\(b\_n\)} = "", 
        NumberForm[N[bs], 3]];\)\ \)

Maybe  (Subscript[S, 5])[t] is a close approximation to the solution. A graph of  (Subscript[S, 5])[t]  is given below.

\(
\(Plot[S[t], {t, \(-2\) Pi, 2  Pi}, 
        PlotStyle -> 
          Magenta, 
PlotRange -> {{\(-2\) π, 
              2  π}, {\(-0.3\), 0.5}}, 
        AxesLabel -> {"t", "s"}, 
Ticks -> {Range[\(-2\) π, 2  π, π], 
            Range[\(-0.2\), 0.4, 0.1]}];\)\ \)
\(\(Print[\*""The Trigonometric Polynomial (Subscript[S, 5])[t] is an approximation""];\)\ \)
\(\(Print[\*""to the steady state solution (Subscript[U, p])[t] of the D.E.""];\)\ \)
\(\(Print[\*""\!\(S\_5\)[t] = "", 
        S[t]];\)\ \)

For illustration purposes, use the approximate solution  U[t] = (Subscript[U, h])[t] + (Subscript[S, 5])[t]  and use it so solve  U[0] = 1, U'[0] = 0, and plot the result.

eqns = {Uh[0. ] + S[0. ] == 
            1. , Uh'[0. ] + S'[0. ] == 0. }; 
solset = Solve[eqns, {(Subscript[c, 1]), (Subscript[c, 2])}]; 
U[t_] = 
        S[t] + ReplaceAll[Uh[t], 
            (Subscript[solset, [[1]]])]; 
\(\(Plot[{U[t], S[t]}, {t, 0, 4  Pi}, 
        PlotStyle -> {Cyan, 
            Magenta}, 
PlotRange -> {{0, 
              4  π}, {\(-0.3\), 1.05}}, 
        AxesLabel -> {"t", "s"}, 
Ticks -> {Range[0, 4  π, π], 
            Range[\(-0.5\), 1.0, 0.25]}];\)\ \)
\(\(Print[\*""The Trigonometric Polynomial (Subscript[S, 5])[t] is used to form""];\)\ \)
\(\(Print[\*""an approximation to the solution U[t] = (Subscript[U, h])[t] + (Subscript[S, 5])[t]""];\)\ \)
\(\(Print["with the initial conditions U[0]=1, and U'[0] = 0"];\)\ \)
Print["U[t] = ", U[t]];

Exercise 2 (a),  Page 506.  Find the general solution to  2  U'' (t) + 2  U' (t) + U (t) = F (t),  where F(t) is given by the Fourier series  F[
          t] = (∑_(n = 1)^∞)((((-1))^(n - 1))/n) Sin[
              n t].

Solution 2 (a).

First, find the transient solution to the differential equation.

Clear[U, t]; 
de = 2  U''[t] + 2 U'[t] + U[t] == 0; 
solset = DSolve[de, U[t], t]; 
Uh[t_] = 
        ReplaceAll[
          (Subscript[solset, [[1, 1, 2]]]), {C[1] -> (Subscript[c, 1]), 
            C[2] -> (Subscript[c, 2])}]; 
Print[de]; 
Print[""]; 
Print[solset]; 
Print[""]; 
Print["The transient solution to the D.E. is"]; 
\(\(Print[\*""\!\(U\_h\)[t] = "", 
        Uh[t]];\)\ \)

Next, use Fourier series to construct the steady state solution to the differential equation.  Enter the formula for the n-th terms T[n,t] and F[n,t] of the Fourier Series for U[t] and F[t], respectively.  Then form the equation relating the n-terms and the equations involving Cos[n t] and Sin[n t].  Then solve these equations for the Fourier coefficients of  U[t].

Remove[a, b, A, B, S, t, T, 
        U]; 
Clear[EqA, EqB, f, F, k, L, m, n]; 
T[n_, t_]  =  (Subscript[A, n]) Cos[n t]  +  (Subscript[B, n]) Sin[n t]; 
F[0, t_]  =  0; 
F[n_, 
          t_]  =  (((((-1))^(n - 1)) Sin[n t])/n); 
Print["T[n,t] = ", T[n, t]]; 
Print["F[n,t] = ", F[n, t]]; 
Print[""]; 
Print[
        Eq  =  2 (∂_(t, t))T[n, t]  +  
              2 (∂_t) T[n, t]  +  T[n, t]  ==  
            F[n, t]]; 
Print[""]; 
Print[
        EqA  =  
          ReplaceAll[
            Eq, {Cos[n t]  ->  1, 
              Sin[n t]  ->  0}]]; 
Print[
        EqB  =  
          ReplaceAll[
            Eq, {Sin[n t]  ->  1, 
              Cos[n t]  ->  0}]]; 
Print[""]; 
solset  =  Solve[{EqA, EqB},  {(Subscript[A, n]), (Subscript[B, n])}]; 
(Subscript[a, n])_  =  
        (Subscript[solset, [[1, 1, 2]]]); 
(Subscript[b, n])_  =   (Subscript[solset, [[1, 2, 2]]]); 
(Subscript[a, 0])   =  2 F[0, t]; 
\(\(Print[\*""\!\(a\_0\) = "", a\_0];\)\ \)
\(\(Print[\*""\!\(a\_n\) = "", a\_n];\)\ \)
\(\(Print[\*""\!\(b\_n\) = "", 
        b\_n];\)\ \)

Use the Fourier coefficients of U[t] and form the n-th term of the series  U[n,t], and verify that it satisfies the given D.E.

U[n_, t_]  =  
        (Subscript[a, n]) Cos[n t]  +  (Subscript[b, n]) Sin[n t]; 
U[0, t]    = (( (Subscript[a, 0]))/2); 
Print["U[0,t] = ", U[0, t]]; 
Print["U[n,t] = ", U[n, t]]; 
Print[""]; 
Print["Is the n-th term in the D.E. satisfied ?"]; 
L  =  
        2 (∂_(t, t))U[n, t]  +  2 (∂_t) U[n, t]  +  
          U[n, t]; 
\(\(Print[\*""2 (∂_(t, t))U[n,t] + 2 (∂_t)U[n,t] + U[n,t] = "", 
        F[n, t]];\)\ \)
Print[""]; 
Print[L, " = ", F[n, t]]; 
Print[""]; 
Print[MapAll[Together, L], " = ", F[n, t]]; 
Print[
        MapAll[Together, L == F[n, t]]];

Construct the Trigonometric Polynomial  (Subscript[S, 5])[t]  of degree n = 5 and verify that it satisfies the D.E.

S[
          t_]  =  (∑_(n = 0)^5) U[n, t]; 
L  =  
        2  S''[t]  +  2 S'[t]  +  S[t]; 
\(\(Print[\*""(Subscript[S, 5])[t] = (∑_(n = 0)^5)U[n,t] = "", S[t]];\)\ \)
Print[""]; 
\(\(Print[\*""\!\(S\_5\)'[t] = "", \(S'\)[t]];\)\ \)
\(\(Print[\*""\!\(S\_5\)''[t] = "", \(\(S'\)'\)[t]];\)\ \)
Print[" "]; 
Print["The left and right side of the D.E. are"]; 
\(\(Print[\*""2 (Subscript[S, 5])''[t] + 2 (Subscript[S, 5])'[t] + (Subscript[S, 5])[t] = "", Expand[L]];\)\ \)
f[t_]  =  (∑_(n = 0)^5) F[n, t]; 
\(\(Print[\*""(Subscript[f, 5])[t] = (∑_(n = 0)^5)F[n,t] = "", f[t]];\)\ \)
Print[" "]; 
\(\(Print[\*""2 (Subscript[S, 5])''[t] + 2 (Subscript[S, 5])'[t] + (Subscript[S, 5])[t] == (Subscript[f, 5])[t]""];\)\ \)
Print[Expand[L], " == ", f[t]]; 
Print[Expand[L]  ==  f[t]];

Look at the size of the coefficients  (Subscript[a, n])  and  (Subscript[b, n])  and observe that
\(lim\_\(n -> ∞\)\ 
          a\_n = \(lim\_\(n -> ∞\)\ \(2\ \((\(-1\))\)\^n\)\/\(1 + 4\ n\^4\)\  = \ 0\)\)
\(lim\_\(n -> ∞\)\ 
          b\_n = \(lim\_\(n -> ∞\)\ \(\((\(-1\))\)\^n\ \((\(-1\) + 2\ n\^2)\)\)\/\(n\ \((1 + 4\ n\^4)\)\)\  = \ 0\)\) 
We can investigate these sequences.

m = 5; 
as = Table[(Subscript[a, k]), {k, 0, m}]; 
bs = Table[(Subscript[b, k]), {k, 1, m}]; 
as = Append[as, "..."]; 
bs = Append[bs, "..."]; 
\(\(Print[\*""{\!\(a\_n\)} = "", 
        as];\)\ \)
\(\(Print[\*""{\!\(b\_n\)} = "", 
        bs];\)\ \)
Print[""]; 
\(\(Print[\*""{\!\(a\_n\)} = "", 
        NumberForm[N[as], 3]];\)\ \)
\(\(Print[\*""{\!\(b\_n\)} = "", 
        NumberForm[N[bs], 3]];\)\ \)

Maybe  (Subscript[S, 5])[t] is a close approximation to the solution. A graph of  (Subscript[S, 5])[t]  is given below.

\(
\(Plot[S[t], {t, \(-2\) Pi, 2  Pi}, 
        PlotStyle -> 
          Magenta, 
PlotRange -> {{\(-2\) π, 
              2  π}, {\(-0.4\), 0.6}}, 
        AxesLabel -> {"t", "s"}, 
Ticks -> {Range[\(-2\) π, 2  π, π], 
            Range[\(-0.4\), 0.6, 0.2]}];\)\ \)
\(\(Print[\*""The Trigonometric Polynomial (Subscript[S, 5])[t] is an approximation""];\)\ \)
\(\(Print[\*""to the steady state solution (Subscript[U, p])[t] of the D.E.""];\)\ \)
\(\(Print[\*""\!\(S\_5\)[t] = "", 
        S[t]];\)\ \)

For illustration purposes, use the approximate solution  U[t] = (Subscript[U, h])[t] + (Subscript[S, 5])[t]  and use it so solve  U[0] = 1, U'[0] = 0, and plot the result.

eqns = {Uh[0. ] + S[0. ] == 
            1. , Uh'[0. ] + S'[0. ] == 0. }; 
solset = Solve[eqns, {(Subscript[c, 1]), (Subscript[c, 2])}]; 
U[t_] = 
        S[t] + ReplaceAll[Uh[t], 
            (Subscript[solset, [[1]]])]; 
\(\(Plot[{U[t], S[t]}, {t, 0, 4  Pi}, 
        PlotStyle -> {Blue, 
            Magenta}, 
PlotRange -> {{0, 
              4  π}, {\(-0.5\), 1.05}}, 
        AxesLabel -> {"t", "s"}, 
Ticks -> {Range[0, 4  π, π], 
            Range[\(-0.5\), 1.0, 0.25]}];\)\ \)
\(\(Print[\*""The Trigonometric Polynomial (Subscript[S, 5])[t] is used to form""];\)\ \)
\(\(Print[\*""an approximation to the solution U[t] = (Subscript[U, h])[t] + (Subscript[S, 5])[t]""];\)\ \)
\(\(Print["with the initial conditions U[0]=1, and U'[0] = 0"];\)\ \)
Print["U[t] = ", U[t]];

Section 11.3  Exercises for Vibrations in Mechanical Systems
See textbook page 505.

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