[Go to the Notes on Diffy Qs home page] [PDF version]

[next] [prev] [prev-tail] [tail] [up]

Chapter 2
Higher order linear ODEs

2.1 Second order linear ODEs

Note: less than 1 lecture, first part of §3.1 in EP

Let us consider the general second order linear differential equation

     ′′        ′
A(x)y + B (x)y + C(x)y = F(x).

We usually divide through by A(x)  to get

y′′ + p(x)y′ + q(x)y = f (x),
(2.1)

where p (x ) = B(x)∕A(x)   , q (x ) = C(x)∕A(x)   , and f (x ) = F(x)∕A(x)   . The word linear means that the equation contains no powers nor functions of y , y′ , and y′′ .

In the special case when f (x ) = 0  we have a so-called homogeneous equation

y′′ + p (x)y′ + q(x)y = 0.
(2.2)

We have already seen some second order linear homogeneous equations.

y′′ + k2y = 0       Two  solutions are:  y1 = coskx,   y2 = sinkx.
 ′′   2                                      kx        -kx
y  - k y = 0        Two  solutions are:  y1 = e ,   y2 = e  .

If we know two solutions of a linear homogeneous equation, we know a lot more of them.

Theorem 2.1.1 (Superposition). Suppose y1   and y2   are two solutions of the homogeneous equation (2.2). Then

y(x) = C y(x) + C y (x),
        1 1      2 2

also solves (2.2) for arbitrary constants C 1   and C 2   .

That is, we can add solutions together and multiply them by constants to obtain new and different solutions. We will prove this theorem because the proof is very enlightening and illustrates how linear equations work.

Proof: Let y = C 1y1 + C2y2   . Then

y′′ + py ′ + qy = (C 1y1 + C 2y2)′′ + p(C1y1 + C2y2)′ + q(C1y1 + C 2y2)
                  ′′     ′′      ′       ′
             = C1y1 + C2y2 + C1py1 + C2py2 + C1qy1 + C2qy2
             = C1(y′′1 + py ′1 + qy1) + C 2(y′′2 + py′2 + qy2)

             = C1 ⋅ 0 + C 2 ⋅ 0 = 0.

The proof becomes even simpler to state if we use the operator notation. An operator is an object that eats functions and spits out functions (kind of like what a function is, but a function eats numbers and spits out numbers). Define the operator L by

Ly = y′′ + py ′ + qy.

The differential equation now becomes Ly = 0  . The operator (and the equation) L being linear means that L (C 1y1 + C 2y2) = C1Ly 1 + C2Ly 2   . The proof above becomes

Ly = L(C 1y1 + C2y2) = C1Ly1 + C2Ly2 = C 1 ⋅ 0 + C2 ⋅ 0 = 0.

Two different solutions to the second equation  ′′   2
y  - k y = 0  are y1 = co sh kx and y2 = sinh kx . Let us remind ourselves of the definition,          ex+e-x
cosh x = --2--   and          ex-e-x
sinh x = --2--   . Therefore, these are solutions by superposition as they are linear combinations of the two exponential solutions.

The functions sinh  and cosh  are sometimes more convenient to use than the exponential. Let us review some of their properties.

cosh0 = 1                            sinh0 = 0

d--                                  d--
dx coshx = sinhx                     dx sin hx = coshx
cosh2x - sin h2x = 1

Exercise 2.1.1: Derive these properties using the definitions of sinh  and cosh  in terms of exponentials.

Linear equations have nice and simple answers to the existence and uniqueness question.

Theorem 2.1.2 (Existence and uniqueness). Suppose p,q,f are continuous functions and a, b0,b 1   are constants. The equation

y′′ + p(x)y′ + q(x)y = f (x),

has exactly one solution y(x)  satisfying the initial conditions

y(a) = b0,    y′(a) = b1.

For example, the equation y′′ + k2y = 0  with y(0) = b0   and y′(0) = b1   has the solution

y(x) = b0 coskx + b1-sin kx.
                 k

The equation y′′ - k2y = 0  with y(0) = b 0   and y′(0) = b1   has the solution

                  b
y(x ) = b0co sh kx +-1-sinh kx.
                  k

Using cosh  and sinh  in this solution allows us to solve for the initial conditions in a cleaner way than if we have used the exponentials.

The initial conditions for a second order ODE consist of two equations. Common sense tells us that if we have two arbitrary constants and two equations, then we should be able to solve for the constants and find a solution to the differential equation satisfying the initial conditions.

Question: Suppose we find two different solutions y1   and y2   to the homogeneous equation (2.2). Can every solution be written (using superposition) in the form y = C1y1 + C2y2   ?

Answer is affirmative! Provided that y1   and y2   are different enough in the following sense. We will say y
 1   and y
 2   are linearly independent if one is not a constant multiple of the other.

Theorem 2.1.3. Let p, q,f be continuous functions and take the homogeneous equation (2.2). Let y1   and y2   be two linearly independent solutions to (2.2). Then every other solution is of the form

y = C1y1 + C 2y2.

That is, y = C 1y1 + C 2y2   is the general solution.

For example, we found the solutions y1 = sinx and y2 = co sx for the equation y′′ + y = 0  . It is obvious that sine and cosine are not multiples of each other. If sin x = Aco sx for some constant A , we let x = 0  and this would imply A = 0 = sin x , which is preposterous. So y1   and y2   are linearly independent. Hence

y = C 1cosx + C2 sin x

is the general solution to y′′ + y = 0  .

We will study the solution of nonhomogeneous equations in § 2.5. We will first focus on finding general solutions to homogeneous equations.

2.1.1 Exercises

Exercise 2.1.2: Show that      x
y = e  and      2x
y = e  are linearly independent.

Exercise 2.1.3: Take  ′′
y  + 5y = 10x + 5  . Find (guess!) a solution.

Exercise 2.1.4: Prove the superposition principle for nonhomogeneous equations. Suppose that y1   is a solution to Ly1 = f(x)  and y2   is a solution to Ly 2 = g(x)  (same linear operator L ). Show that y solves Ly = f(x) + g(x)  .

Exercise 2.1.5: For the equation x 2y′′ - xy′ = 0  , find two solutions, show that they are linearly independent and find the general solution. Hint: Try y = xr  .

Note that equations of the form ax 2y′′ + bxy′ + cy = 0  are called Euler’s equations or Cauchy-Euler equations. They are solved by trying y = xr  and solving for r (we can assume that x ≥ 0  for simplicity).

Exercise 2.1.6: Suppose that (b - a)2 - 4ac > 0  . a) Find a formula for the general solution of ax2y′′ + bxy′ + cy = 0  . Hint: Try y = xr  and find a formula for r . b) What happens when        2
(b - a) - 4ac = 0  or        2
(b - a) - 4ac < 0  ?

We will revisit the case when (b - a)2 - 4ac < 0  later.

Exercise 2.1.7: Same equation as in Exercise 2.1.6. Suppose (b - a )2 - 4ac = 0  . Find a formula for the general solution of ax2y′′ + bxy ′ + cy = 0  . Hint: Try y = xr lnx for the second solution.

If you have one solution to a second order linear homogeneous equation you can find another one. This is the reduction of order method.

Exercise 2.1.8: Suppose y
 1   is a solution to y′′ + p(x)y′ + q(x)y = 0  . Show that

            ∫   -∫ p(x)dx
y (x ) = y (x)  e-------dx
 2      1      (y1(x))2

is also a solution.

If you wish to come up with the formula for reduction of order yourself, start by trying y2(x) = y1(x)v(x)  . Then plug y2   into the equation, use the fact that y1   is a solution, substitute      ′
w = v , and you have a first order linear equation in w . Solve for w and then for v . When solving for w , make sure to include a constant of integration. Let us solve some famous equations using the method.

Exercise 2.1.9 (Chebychev’s equation of order 1): Take      2  ′′    ′
(1 - x )y - xy  + y = 0  . a) Show that y = x is a solution. b) Use reduction of order to find a second linearly independent solution. c) Write down the general solution.

Exercise 2.1.10 (Hermite’s equation of order 2): Take y′′ - 2xy′ + 4y = 0  . a) Show that y = 1 - 2x2   is a solution. b) Use reduction of order to find a second linearly independent solution. c) Write down the general solution.

2.2 Constant coefficient second order linear ODEs

Note: more than 1 lecture, second part of §3.1 in EP

Suppose we have the problem

y′′ - 6y′ + 8y = 0,   y(0 ) = - 2,   y′(0) = 6.

This is a second order linear homogeneous equation with constant coefficients. Constant coefficients means that the functions in front of  ′′
y ,  ′
y , and y are constants, not depending on x .

To guess a solution, think of a function that you know stays essentially the same when we differentiate it, so that we can take the function and its derivatives, add some multiples of these together, and end up with zero.

Let us try a solution of the form      rx
y = e  . Then  ′    rx
y = re  and   ′′   2 rx
y  = r e  . Plug in to get

     y′′ - 6y′ + 8y = 0,

r2erx - 6rerx + 8erx = 0,
        2                                   rx
       r  - 6r + 8 = 0    (divide through by e  ),
     (r - 2 )(r - 4 ) = 0.
Hence, if r = 2  or r = 4  , then erx  is a solution. So let y1 = e2x  and y2 = e4x  .

Exercise 2.2.1: Check that y1   and y2   are solutions.

The functions e2x  and e4x  are linearly independent. If they were not we could write e4x = Ce 2x  , which would imply that e2x = C , which is clearly not possible. Hence, we can write the general solution as

       2x      4x
y = C1e  + C 2e .

We need to solve for C1   and C 2   . To apply the initial conditions we first find y′ = 2C1e2x + 4C 2e4x  . We plug in x = 0  and solve.

- 2 = y(0 ) = C 1 + C2,
       ′
  6 = y(0) = 2C1 + 4C2.
Either apply some matrix algebra, or just solve these by high school math. For example, divide the second equation by 2 to obtain 3 = C1 + 2C2   , and subtract the two equations to get 5 = C 2   . Then C 1 = - 7  as - 2 = C1 + 5  . Hence, the solution we are looking for is
       2x    4x
y = - 7e + 5e  .

Let us generalize this example into a method. Suppose that we have an equation

  ′′     ′
ay + by  + cy = 0,
(2.3)

where a, b,c are constants. Try the solution y = erx  to obtain

  2 rx     rx    rx
ar e  + bre  + ce  = 0,
        ar2 + br + c = 0.
The equation   2
ar + br + c = 0  is called the characteristic equation of the ODE. Solve for the r by using the quadratic formula.
             √ -2------
r ,r = --b-±---b---4ac.
 1  2         2a

Therefore, we have er1x  and er2x  as solutions. There is still a difficulty if r1 = r2   , but it is not hard to overcome.

Theorem 2.2.1. Suppose that r
 1   and r
2   are the roots of the characteristic equation.

(i)
If r1   and r2   are distinct and real (when  2
b - 4ac > 0  ), then (2.3) has the general solution
       rx      rx
y = C 1e1 + C 2e2 .

(ii)
If r1 = r2   (happens when   2
b  - 4ac = 0  ), then (2.3) has the general solution
              r x
y = (C 1 + C 2x)e 1 .

For another example of the first case, take the equation  ′′   2
y  - k y = 0  . Here the characteristic equation is r2 - k2 = 0  or (r - k)(r + k) = 0  . Consequently, e-kx  and ekx  are the two linearly independent solutions.

Example 2.2.1: Find the general solution of

 ′′     ′
y - 8y  + 16y = 0.

The characteristic equation is r2 - 8r + 16 = (r - 4)2 = 0  . The equation has a double root r1 = r2 = 4  . The general solution is, therefore,

y = (C  + C  x)e4x = C e4x + C xe4x.
      1    2        1       2

Exercise 2.2.2: Check that e4x  and xe4x  are linearly independent.

That  4x
e  solves the equation is clear. If   4x
xe  solves the equation then we know we are done. Let us compute y′ = e4x + 4xe4x  and y′′ = 8e4x + 16xe4x  . Plug in

y′′ - 8y′ + 16y = 8e4x + 16xe4x - 8(e4x + 4xe4x) + 16xe 4x = 0.

We should note that in practice, doubled root rarely happens. If coefficients are picked truly randomly we are very unlikely to get a doubled root.

Let us give a short “proof” for why the solution xerx  works when the root is doubled. This case is really a limiting case of when the two roots are distinct and very close. Note that er2x-er1x
  r2-r1    is a solution when the roots are distinct. When r1   goes to r2   in the limit this is like taking derivative of  rx
e  using r as a variable. This limit is xerx  , and hence this is a solution in the doubled root case.

2.2.1 Complex numbers and Euler’s formula

It may happen that a polynomial has some complex roots. For example, the equation r2 + 1 = 0  has no real roots, but it does have two complex roots. Here we review some properties of complex numbers.

Complex numbers may seem a strange concept especially because of the terminology. There is nothing imaginary or really complicated about complex numbers. A complex number is simply a pair of real numbers, (a,b)  . We can think of a complex number as a point in the plane. We add complex numbers in the straightforward way, (a,b) + (c,d) = (a + c,b + d)  . We define a multiplication by

             def
(a,b) × (c,d )=  (ac - bd,ad + bc).

It turns out that with this multiplication rule, all the standard properties of arithmetic hold. Further, and most importantly (0,1 ) × (0, 1) = (-1, 0)  .

Generally we just write (a,b )  as a + ib , and we treat i as if it were an unknown. You can just do arithmetic with complex numbers just as you would do with polynomials. The property we just mentioned becomes 2
i = -1  . So whenever you see 2
i   you can replace it by - 1  . The numbers i and - i are roots of r2 + 1 = 0  .

Note that engineers often use the letter j instead of i for the square root of - 1  . We will use the mathematicians convention and use i .

Exercise 2.2.3: Make sure you understand (that you can justify) the following identities:

We can also define the exponential ea+ib  of a complex number. We can do this by just writing down the Taylor series and plugging in the complex number. Because most properties of the exponential can be proved by looking at the Taylor series, we note that many properties still hold for the complex exponential. For example,  x+y   x y
e   = e e  . This means that  a+ib   a ib
e   = e e  and hence if we can compute eib  easily, we can compute ea+ib  . Here we will use the so-called Euler’s formula.

Theorem 2.2.2 (Euler’s formula).

|--iθ-------------------------------iθ-----------------|
--e--=-cosθ-+-isin-θ-----and------e--=--cosθ-- i-sin-θ.|

Exercise 2.2.4: Using Euler’s formula, check the identities:

         iθ    -iθ                     iθ    -iθ
co sθ = e--+-e--     and     sin θ = e----e--.
           2                           2i

Exercise 2.2.5: Double angle identities: Start with  i(2θ)  ( iθ)2
e   =  e   . Use Euler on each side and deduce:

cos2 θ = co s2 θ - sin2θ   and     sin2θ = 2 sin θcosθ.

We also will need some notation. For a complex number a + ib we call a the real part and b the imaginary part of the number. Often the following notation is used,

Re(a + ib) = a   and      Im (a + ib) = b.

2.2.2 Complex roots

Now suppose that the equation ay′′ + by′ + cy = 0  has a characteristic equation ar2 + br + c = 0  which has complex roots. By quadratic formula the roots are    √-----
-b±-b2-4ac
    2a  . These are complex if b2 - 4ac < 0  . In this case we can see that the roots are

             √ --------
       -b-   --4ac---b2
r1,r2 = 2a ± i    2a    .

As you can see, you will always get a pair of roots of the form α ± iβ . In this case we can still write the solution as

       (α+iβ)x      (α-iβ)x
y = C1e     + C 2e     .

However, the exponential is now complex valued. We would need to choose C 1   and C2   to be complex numbers to obtain a real valued solution (which is what we are after). While there is nothing particularly wrong with this approach, it can make calculations harder and it is generally preferred to find two real valued solutions.

Here we can use Euler’s formula. First let

y = e(α+iβ)x     and    y  = e(α-iβ)x.
 1                      2

Then note that

     αx          αx
y1 = e co sβx + ie  sin βx,
y2 = eαxco sβx - ieαxsin βx.

We note that linear combinations of solutions are also solutions. Hence,

     y1 +-y2   αx
y3 =   2    = e  cosβx,
     y1 - y2   αx
y4 = --2i---= e  sinβx,
are also solutions. And furthermore they are real valued. It is not hard to see that they are linearly independent (not multiples of each other). Therefore, we have the following theorem.

Theorem 2.2.3. Take the equation

  ′′     ′
ay  + by + cy = 0.

If the characteristic equation has the roots α ± iβ (when b2 - 4ac < 0  ), then the general solution is

       αx            αx
y = C1e  co sβx + C2e  sinβx.

Example 2.2.2: Find the general solution of y′′ + k2y = 0  , for a constant k > 0  .

The characteristic equation is r2 + k2 = 0  . Therefore, the roots are r = ±ik and by the theorem we have the general solution

y = C1co skx + C2sinkx.

Example 2.2.3: Find the solution of y′′ - 6y′ + 1 3y = 0  , y(0) = 0  , y′(0) = 10  .

The characteristic equation is  2
r - 6r + 13 = 0  . By completing the square we get       2   2
(r - 3) + 2  = 0  and hence the roots are r = 3 ± 2i . By the theorem we have the general solution

y = C 1e3xco s2x + C2e3xsin 2x.

To find the solution satisfying the initial conditions, we first plug in zero to get

0 = y(0) = C1e0cos 0 + C 2e0sin 0 = C1.

Hence C1 = 0  and         3x
y = C 2e  sin 2x . We differentiate

 ′       3x             3x
y = 3C 2e  sin 2x + 2C2e  cos2x.

We again plug in the initial condition and obtain       ′
10 = y(0) = 2C2   , or C 2 = 5  . Hence the solution we are seeking is

y = 5e 3x sin 2x.

2.2.3 Exercises

Exercise 2.2.6: Find the general solution of   ′′    ′
2y  + 2y - 4y = 0  .

Exercise 2.2.7: Find the general solution of y′′ + 9y′ - 10y = 0  .

Exercise 2.2.8: Solve y′′ - 8y′ + 16y = 0  for y(0) = 2  , y′(0) = 0  .

Exercise 2.2.9: Solve y′′ + 9y′ = 0  for y(0) = 1  , y′(0 ) = 1  .

Exercise 2.2.10: Find the general solution of    ′′
2y  + 50y = 0  .

Exercise 2.2.11: Find the general solution of y′′ + 6y′ + 1 3y = 0  .

Exercise 2.2.12: Find the general solution of y′′ = 0  using the methods of this section.

Exercise 2.2.13: The method of this section applies to equations of other orders than two. We will see higher orders later. Try to solve the first order equation   ′
2y  + 3y = 0  using the methods of this section.

Exercise 2.2.14: Let us revisit Euler’s equations of Exercise 2.1.6. Suppose now that        2
(b - a) - 4ac < 0  . Find a formula for the general solution of   2 ′′      ′
ax y  + bxy + cy = 0  . Hint: Note that   r   rlnx
x  = e  .

2.3 Higher order linear ODEs

Note: somewhat more than 1 lecture, §3.2 and §3.3 in EP

After reading this lecture, it may be good to first try Project III from the IODE website: http://www.math.uiuc.edu/iode/.

Most equations that appear in applications tend to be second order. Higher order equations do appear from time to time, but it is a general assumption of modern physics that the world is “second order.”

The basic results about linear ODEs of higher order are essentially exactly the same as for second order equations with 2 replaced by n . The important concept of linear independence is somewhat more complicated when more than two functions are involved.

For higher order constant coefficient ODEs, the methods are also slightly harder, but we will not dwell on these. You can always use the methods for systems of linear equations from Chapter 3 to solve higher order constant coefficient equations.

So let us start with a general homogeneous linear equation

 (n)          (n-1)             ′
y  + pn-1(x)y    + ⋅⋅⋅ + p1(x)y + p0(x)y = 0.
(2.4)

Theorem 2.3.1 (Superposition). Suppose y1   , y2   , …, yn  are solutions of the homogeneous equation (2.4). Then

y(x) = C 1y1(x ) + C2y2(x) + ⋅⋅⋅ + Cnyn(x)

also solves (2.4) for arbitrary constants C 1   , …, Cn  .

We also have the existence and uniqueness theorem for nonhomogeneous linear equations.

Theorem 2.3.2 (Existence and uniqueness). Suppose p0   through pn-1   , and f are continuous functions and a,b0,b1,...,bn-1   are constants. The equation

 (n)          (n-1)             ′
y  + pn-1(x)y    + ⋅⋅⋅ + p1(x)y + p0(x)y = f (x )

has exactly one solution y(x)  satisfying the initial conditions

             ′                 (n-1)
y(a) = b0,  y (a ) = b1, ...,  y    (a) = bn-1.

2.3.1 Linear independence

When we had two functions y
 1   and y
 2   we said they were linearly independent if one was not the multiple of the other. Same idea holds for n functions. In this case it is easier to state as follows. The functions y1   , y 2   , …, yn  are linearly independent if

c1y1 + c2y2 + ⋅⋅⋅ + cnyn = 0,

has only the trivial solution c1 = c2 = ⋅⋅⋅ = cn = 0  . If we can write the equation with a nonzero constant, say c1 ⇔ 0  , then we can solve for y1   as a linear combination of the others. If the functions are not linearly independent, we say they are linearly dependent.

Example 2.3.1: Show  x 2x  3x
e ,e  ,e  are linearly independent.

Let us give several ways to show this fact. Many textbooks (including [EP] and [F]) introduce Wronskians, but that is really not necessary here.

Let us write down

c1ex + c2e2x + c3e3x = 0.

We use rules of exponentials and write      x
z = e  . Then we have

c z + c z2 + c z3 = 0.
 1    2     3

The left hand side is a third degree polynomial in z . It can either be identically zero, or it can have at most 3 zeros. Therefore, it is identically zero and c1 = c2 = c3 = 0  and the functions are linearly independent.

Let us try another way. As before we write

c1ex + c2e2x + c3e3x = 0.

This equation has to hold for all x . What we could do is divide through by e3x  to get

c1e-2x + c2e-x + c3 = 0.

As the equation is true for all x , let x → ∞ . After taking the limit we see that c3 = 0  . Hence our equation becomes

   x     2x
c1e + c2e  = 0.

Rinse, repeat!

How about yet another way. We again write

c1ex + c2e2x + c3e3x = 0.

We can evaluate the equation and its derivatives at different values of x to obtain equations for c1   , c2   , and c
 3   . Let us first divide by ex  for simplicity.

c1 + c2ex + c3e2x = 0.

We set x = 0  to get the equation c1 + c2 + c3 = 0  . Now differentiate both sides

c ex + 2c e2x = 0.
 2       3

We set x = 0  to get c2 + 2c3 = 0  . We divide by  x
e  again and differentiate to get     2x
4c3e  = 0  . It is clear that c3   is zero. Then c2   must be zero as c2 = -2c3   , and c1   must be zero because c1 + c2 + c3 = 0  .

There is no one best way to do it. All of these methods are perfectly valid.

Example 2.3.2: On the other hand, the functions ex  , e-x  , and co sh x are linearly dependent. Simply apply definition of the hyperbolic cosine:

          x   -x
cosh x = e-+-e--.
            2

2.3.2 Constant coefficient higher order ODEs

When we have a higher order constant coefficient homogeneous linear equation. The song and dance is exactly the same as it was for second order. We just need to find more solutions. If the equation is nth   order we need to find n linearly independent solutions. It is best seen by example.

Example 2.3.3: Find the general solution to

 ′′′    ′′   ′
y  - 3y  - y + 3y = 0.
(2.5)

Try: y = erx  . We plug in and get

 3 rx    2 rx    rx     rx
r e  - 3r e  - re  + 3e  = 0.

We divide through by  rx
e  . Then

r3 - 3r 2 - r + 3 = 0.

The trick now is to find the roots. There is a formula for the roots of degree 3 and 4 polynomials but it is very complicated. There is no formula for higher degree polynomials. That does not mean that the roots do not exist. There are always n roots for an  th
n   degree polynomial. They might be repeated and they might be complex. Computers are pretty good at finding roots approximately for reasonable size polynomials.

Best place to start is to plot the polynomial and check where it is zero. Or you can try plugging in. Sometimes it is a good idea to just start plugging in numbers r = -2,- 1,0,1,-1,2, ... and see if you get a hit. There are some signs that you might have missed a root. For example, if you plug in - 2  into our polynomial you get - 15  . If you plug in 0 you get 3. That means there is a root between - 2  and 0 because the sign changed.

A good strategy at first is to look for roots - 1  , 1, or 0, these are easy to see. Our polynomial happens to have two roots r1 = -1  and r2 = 1  . There must be 3 roots and the last root is reasonably easy to find. The constant term in a polynomial is the multiple of the negations of all the roots because r3 - 3r2 - r + 3 = (r - r )(r - r )(r - r)
                      1      2      3  . In our case we see that

3 = (-r1)(- r2)(-r3) = (1 )(- 1)(- r3) = r3.

You should check that r =  3
 3  really is a root. Hence we know that e-x  , ex  and e3x  are solutions to (2.5). They are linearly independent as can easily be checked, and there are 3 of them, which happens to be exactly the number we need. Hence the general solution is

y = C e-x + C ex + C e3x.
     1       2     3

Suppose we were given some initial conditions y(0) = 1  , y′(0) = 2  , and y′′(0) = 3  . Then

 1 = y(0) = C1 + C 2 + C 3,
 2 = y′(0) = -C  + C  + 3C ,
     ′′        1   2     3
3 = y (0) = C1 + C 2 + 9C 3.
It is possible to find the solution by high school algebra, but it would be a pain. The only sensible way to solve a system of equations such as this is to use matrix algebra, see § 3.2. For now we note that the solution is C  = - 1∕4
  1   , C  = 1
  2  and C  = 1∕4
  3   . The specific solution to the ODE is
    -1           1
y = ---e-x + ex +-e3x.
     4           4

Next, suppose that we have real roots, but they are repeated. Let us say we have a root r repeated k times. In the spirit of the second order solution, and for the same reasons, we have the solutions

erx,xerx,x2erx,...,xk-1erx.

We take a linear combination of these solutions to find the general solution.

Example 2.3.4: Solve

 (4)    ′′′     ′′   ′
y  - 3y   + 3y - y  = 0.

We note that the characteristic equation is

r4 - 3r3 + 3r2 - r = 0.

By inspection we note that r4 - 3r 3 + 3r2 - r = r(r - 1)3   . Hence the roots given with multiplicity are r = 0,1,1,1  . Thus the general solution is

y = (C 1 + C2x + C3x2)ex+ ◟C◝◜4◞ .
   ◟ ---te---r---m---s---co----m-◝in◜g--fr---om-------r---=---1--◞   fromr= 0

Similarly to the second order case we can handle complex roots. Complex roots always come in pairs r = α ± iβ . Suppose we have two such complex roots, each repeated k times. The corresponding solution is

                      k-1  αx                               k-1  αx
(C0 + C1x + ⋅⋅⋅ + Ck-1x )e  cos βx + (D 0 + D 1x + ⋅⋅⋅ + Dk -1x )e sinβx.

where C 0   , …, Ck -1   , D0   , …, Dk-1   are arbitrary constants.

Example 2.3.5: Solve

 (4)    ′′′     ′′     ′
y  - 4y   + 8y - 8y  + 4y = 0.

The characteristic equation is

 4    3     2
r - 4r  + 8r - 8r + 4 = 0,
        (r2 - 2r + 2)2 = 0,
        (          )
         (r - 1)2 + 1 2 = 0.
Hence the roots are 1 ± i , both with multiplicity 2. Hence the general solution to the ODE is
              x                  x
y = (C 1 + C 2x )e cosx + (C 3 + C 4x)e sin x.

The way we solved the characteristic equation above is really by guessing or by inspection. It is not so easy in general. We could also have asked a computer or an advanced calculator for the roots.

2.3.3 Exercises

Exercise 2.3.1: Find the general solution for y′′′ - y′′ + y′ - y = 0  .

Exercise 2.3.2: Find the general solution for y(4) - 5y′′′ + 6y′′ = 0  .

Exercise 2.3.3: Find the general solution for y′′′ + 2y ′′ + 2y′ = 0  .

Exercise 2.3.4: Suppose that the characteristic equation for a differential equation is (r - 1 )2(r - 2)2 = 0  . a) Find such a differential equation. b) Find its general solution.

Exercise 2.3.5: Suppose that a fourth order equation has a solution y = 2e 4xx cosx . a) Find such an equation. b) Find the initial conditions which the given solution satisfies.

Exercise 2.3.6: Find the general solution for the equation of Exercise 2.3.5.

Exercise 2.3.7: Let f (x) = ex - cos x , g (x) = ex + cos x , and h(x) = cos x . Are f(x)  , g(x)  , and h(x)  linearly independent? If so, show it, if not, find a linear combination that works.

Exercise 2.3.8: Let f (x) = 0  , g(x) = cosx , and h(x) = sinx . Are f(x)  , g(x )  , and h(x)  linearly independent? If so, show it, if not, find a linear combination that works.

Exercise 2.3.9: Are x , x2   , and x4   linearly independent? If so, show it, if not, find a linear combination that works.

Exercise 2.3.10: Are ex  , xex  , and x2ex  linearly independent? If so, show it, if not, find a linear combination that works.

2.4 Mechanical vibrations

Note: 2 lectures, §3.4 in EP

Let us look at some applications of linear second order constant coefficient equations.

2.4.1 Some examples

PIC

Our first example is a mass on a spring. Suppose we have a mass m > 0  (in kilograms) connected by a spring with spring constant k > 0  (in Newtons per meter) to a fixed wall. There may be some external force F(t)  (in Newtons) acting on the mass. Finally, there is some friction measured by c ≥ 0  (in Newton-seconds per meter) as the mass slides along the floor (or perhaps there is a damper connected).

Let x be the displacement of the mass (x = 0  is the rest position), with x growing to the right (away from the wall). The force exerted by the spring is proportional to the compression of the spring by Hooke’s law. Therefore, it is kx in the negative direction. Similarly the amount of force exerted by friction is proportional to the velocity of the mass. By Newton’s second law we know that force equals mass times acceleration and hence    ′′          ′
mx   = F(t) - cx - kx or

   ′′     ′
mx   + cx + kx = F(t).

This is a linear second order constant coefficient ODE. We set up some terminology about this equation. We say the motion is

(i)
forced, if F ↙ 0  (if F is not identically zero),
(ii)
unforced or free, if F ≡ 0  (if F is identically zero),
(iii)
damped, if c > 0  , and
(iv)
undamped, if c = 0  .

This system is appears in lots of applications even if it does not at first seems like it. Many real world scenarios can be simplified to a mass on a spring. For example, a bungee jump setup is essentially a mass and spring system (you are the mass). It would be good if someone did the math before you jump off the bridge, right? Let us give 2 other examples.

PIC

Here is an example for electrical engineers. Suppose that you have the pictured RLC circuit. There is a resistor with a resistance of R ohms, an inductor with an inductance of L henries, and a capacitor with a capacitance of C farads. There is also an electric source (such as a battery) giving a voltage of E (t)  volts at time t (measured in seconds). Let Q (t)  be the charge in columbs on the capacitor and I(t)  be the current in the circuit. The relation between the two is   ′
Q  = I . By elementary principles we have that    ′
LI  + RI + Q∕C = E . If we differentiate we get

   ′′       ′    1-       ′
LI  (t) + RI (t) + C I(t) = E (t).

This is an nonhomogeneous second order constant coefficient linear equation. Further, as L, R , and C are all positive, this system behaves just like the mass and spring system. The position of the mass is replaced by the current. Mass is replaced by the inductance, damping is replaced by resistance and the spring constant is replaced by one over the capacitance. The change in voltage becomes the forcing function. Hence for constant voltage this is an unforced motion.

PIC

Our next example is going to behave like a mass and spring system only approximately. Suppose we have a mass m on a pendulum of length L . We wish to find an equation for the angle θ(t)  . Let g be the force of gravity. Elementary physics mandates that the equation is of the form

 ′′   g
θ  + --sin θ = 0.
     L

This equation can be derived using Newton’s second law; force equals mass times acceleration. The acceleration is Lθ′′ and mass is m . So mL θ′′ has to be equal to the tangential component of the force given by the gravity. This is mg sinθ in the opposite direction. The m curiously cancels from the equation.

Now we make our approximation. For small θ we have that approximately sinθ ≈ θ . This can be seen by looking at the graph. In Figure 2.1 we can see that for approximately - 0.5 < θ < 0.5  (in radians) the graphs of sinθ and θ are almost the same.


PIC

Figure 2.1: The graphs of sin θ and θ (in radians).


Therefore, when the swings are small, θ is always small and we can model the behavior by the simpler linear equation

     g
θ′′ +--θ = 0.
    L

Note that the errors that we get from the approximation build up so over a very long time, the behavior might change more substantially. Also we will see that in a mass spring system, the amplitude is independent of the period, this is not true for a pendulum. But for reasonably short periods of time and small swings (for example if the length of the pendulum is very large), the behavior is reasonably close.

In real world problems it is very often necessary to make these types of simplifications. Therefore, it is good to understand both the mathematics and the physics of the situation to see if the simplification is valid in the context of the questions we are trying to answer.

2.4.2 Free undamped motion

In this section we will only consider free or unforced motion, as we cannot yet solve nonhomogeneous equations. Let us start with undamped motion where c = 0  . We have the equation

mx ′′ + kx = 0.

If we divide by m and let      √ ---
ω0 =   k∕m  , then we can write the equation as

x′′ + ω 20x = 0.

The general solution to this equation is

x(t) = A cosω  t + B sin ω t.
             0         0

By a trigonometric identity, we have that for two different constants C and γ , we have

A cosω 0t + B sin ω0t = C co s(ω 0t - γ).

It is not hard to compute that     √ --------
C =   A2 + B2   and tanγ = B∕A  . Therefore, we can write x(t) = C cos(ω 0t - γ)  , and let C and γ be our arbitrary constants.

Exercise 2.4.1: Justify this identity and verify the equations for C and γ . Hint: Start with cos(α - β) = (cosα)(cosβ ) + (sin α)(sin β)  and multiply by C . Then think what should α and β be.

While it is generally easier to use the first form with A and B to solve for the initial conditions, the second form is much more natural. The constants C and γ have very nice interpretation. We look at the form of the solution

x(t) = C cos(ω 0t - γ).

We can see that the amplitude is C , ω
  0   is the (angular) frequency, and γ is the so-called phase shift. The phase shift just shifts the graph left or right. We call ω 0   the natural (angular) frequency. This entire setup is usually called simple harmonic motion.

Let us pause to explain the word angular before the word frequency. The units of ω0   are radians per unit time, not cycles per unit time as is the usual measure of frequency. Because we know one cycle is 2π radians, the usual frequency is given by ω0
2π  . It is simply a matter of where we put the constant 2π , and that is a matter of taste.

The period of the motion is one over the frequency (in cycles per unit time) and hence 2ωπ0    . That is the amount of time it takes to complete one full oscillation.

Example 2.4.1: Suppose that m = 2 kg  and k = 8N∕m   . The whole mass and spring setup is sitting on a truck that was traveling at 1 m/s. The truck crashes and hence stops. The mass was held in place 0.5 meters forward from the rest position. During the crash the mass gets loose. That is, the mass is now moving forward at 1 m/s, while the other end of spring is held in place. The mass therefore starts oscillating. What is the frequency of the resulting oscillation and what is the amplitude. The units are the mks units (meters-kilograms-seconds).

The setup means that the mass was at half a meter in the positive direction during the crash and relative to the wall the spring is mounted to, the mass was moving forward (in the positive direction) at 1 m/s. This gives us the initial conditions.

So the equation with initial conditions is

2x′′ + 8x = 0,   x (0 ) = 0.5,   x ′(0) = 1.

We can directly compute         ---  √ --
ω 0 = √ k∕m =   4 = 2  . Hence the angular frequency is 2. The usual frequency in Hertz (cycles per second) is 2     1
 ∕2π = ∕π ≈ 0.3 18  .

The general solution is

x(t) = A cos2t + B sin 2t.

Letting x (0) = 0.5  means A = 0.5  . Then x′(t) = - 2(0.5) sin 2t + 2B cos2t . Letting x′(0) = 1  we get B = 0.5  . Therefore, the amplitude is C = √A--2 +-B2-= √ 0.5 ≈ 0.707  . The solution is

x(t) = 0.5 cos2t + 0.5 sin 2t.

A plot of x(t)  is shown in Figure 2.2.


PIC

Figure 2.2: Simple undamped oscillation.


For the free undamped motion, if the solution is of the form

x(t) = A cosω 0t + Bsinω 0t,

this corresponds to the initial conditions x (0) = A and x′(0) = ω 0B .

Therefore, it is easy to figure out A and B first, and compute the amplitude and the phase shift using A and B . In the example, we have already found C . Let us compute the phase shift. We know that tanγ = B∕A = 1  . We take the arctangent of 1 and get approximately 0.785. As you may recall, we still need to check if this γ is in the right quadrant. Since both A and B are positive, then γ should be in the first quadrant, and 0.785 radians really is in the first quadrant.

Note: Many calculators and computer software do not only have the atan function for arctangent, but also what is sometimes called atan2. This function takes two arguments, B and A , and returns a γ in the correct quadrant for you.

2.4.3 Free damped motion

Let us now focus on damped motion. Let us rewrite the equation

mx ′′ + cx′ + kx = 0,

as

 ′′      ′    2
x + 2px  + ω 0x = 0,

where

      ∘ ---
ω  =    k-,    p =  c--.
  0     m           2m

The characteristic equation is

r2 + 2pr + ω 20 = 0.

Using the quadratic formula we get that the roots are

         ∘ --------
r = -p ±   p 2 - ω 2.
                  0

The form of the solution depends on whether we get complex or real roots. We get real roots if and only if the following number is nonnegative.

         (   )2         2
p2 - ω 2= -c-   - k-=  c---4km-.
      0   2m      m      4m 2

The sign of p2 - ω2
      0   is the same as the sign of c2 - 4km . Thus we get real roots if and only if c2 - 4km is nonnegative.

Overdamping

When  2
c  - 4km > 0  , we say the system is overdamped. In this case, there are two distinct real roots r1   and r2   . Notice that both roots are negative. As ∘ --------
  p2 - ω2
        0   is always less than p , then       ∘ --------
- p ±   p2 - ω 2
              0   is negative.

PIC
Figure 2.3: Overdamped motion for several different initial conditions.

The solution is

x(t) = C1er1t + C2er2t.

Since r ,r
 1  2   are negative, x (t) → 0  as t → ∞ . Thus the mass will tend towards the rest position as time goes to infinity. For a few sample plots for different initial conditions see Figure 2.3.

Do note that no oscillation happens. In fact, the graph will cross the x axis at most once. To see why, we try to solve 0 = C 1er1t + C2er2t  . Therefore, C1er1t = - C2er2t  and using laws of exponents we obtain

-C-1    (r2-r1)t
 C   = e     .
  2

This equation has at most one solution t ≥ 0  . For some initial conditions the graph will never cross the x axis, as is evident from the sample graphs.

Example 2.4.2: Suppose the mass is released from rest. That is x(0) = x0   and  ′
x (0) = 0  . Then

        x    (           )
x(t) =---0--  r1er2t - r2er1t.
      r1 - r2

It is not hard to see that this satisfies the initial conditions.

Critical damping

When c2 - 4km = 0  , we say the system is critically damped. In this case, there is one root of multiplicity 2 and this root is - p . Therefore, our solution is

x(t) = C1e-pt + C 2te-pt.

The behavior of a critically damped system is very similar to an overdamped system. After all a critically damped system is in some sense a limit of overdamped systems. Since these equations are really only an approximation to the real world, in reality we are never critically damped, it is a place you can only reach in theory. You are always a little bit underdamped or a little bit overdamped. It is better not to dwell on critical damping.

Underdamping

PIC
Figure 2.4: Underdamped motion with the envelope curves shown.

When  2
c  - 4km < 0  , we say the system is underdamped. In this case, the roots are complex.

         ∘ --------
r = -p ±   p 2 - ω 2
              ∘ --0-----
         √ ---   2    2
  = -p ±   -1   ω0 - p
  = -p ± iω1,

where       ∘ --------
ω 1 =   ω20 - p2   . Our solution is

x(t) = e-pt (A cos ω1t + B sinω 1t),

or

         -pt
x(t) = Ce   cos(ω 1t - γ).

An example plot is given in Figure 2.4. Note that we still have that x(t) → 0  as t → ∞ .

In the figure we also show the envelope curves Ce-pt  and - Ce-pt  . The solution is the oscillating line between the two envelope curves. The envelope curves give the maximum amplitude of the oscillation at any given point in time. For example if you are bungee jumping, you are really interested in computing the envelope curve so that you do not hit the concrete with your head.

The phase shift γ just shifts the graph left or right but within the envelope curves (the envelope curves do not change if γ changes).

Finally note that the angular pseudo-frequency (we do not call it a frequency since the solution is not really a periodic function) ω1   becomes lower when the damping c (and hence p ) becomes larger. This makes sense. When we change the damping just a little bit, we do not expect the behavior of the solution to change dramatically. If we keep making c larger, then at some point the solution should start looking like the solution for critical damping or overdamping, where no oscillation happens.

On the other hand when c becomes smaller, ω 1   approaches ω 0   (ω 1   is always smaller than ω0   ), and the solution looks more and more like the steady periodic motion of the undamped case. The envelope curves become flatter and flatter as p goes to 0.

2.4.4 Exercises

Exercise 2.4.2: Consider a mass and spring system with a mass m  = 2  , spring constant k = 3  , and damping constant c = 1  . a) Set up and find the general solution of the system. b) Is the system underdamped, overdamped or critically damped? c) If the system is not critically damped, find a c which makes the system critically damped.

Exercise 2.4.3: Do Exercise 2.4.2 for m = 3  , k = 12  , and c = 12  .

Exercise 2.4.4: Using the mks units (meters-kilograms-seconds), suppose you have a spring with spring constant 4 N/m. You want to use it to weight items. Assume no friction. You place the mass on the spring and put it in motion. a) You count and find that the frequency is 0.8 Hz (cycles per second). What is the mass? b) Find a formula for the mass m given the frequency ω in Hz.

Exercise 2.4.5: Suppose we add possible friction to Exercise 2.4.4. Further, suppose you do not know the spring constant, but you have two reference weights 1 kg and 2 kg to calibrate your setup. You put each in motion on your spring and measure the frequency. For the 1 kg weight you measured 1.1 Hz, for the 2 kg weight you measured 0.8 Hz. a) Find k (spring constant) and c (damping constant). b) Find a formula for the mass in terms of the frequency in Hz. Note that there may be more than one possible mass for a given frequency. c) For an unknown object you measured 0.2 Hz, what is the mass of the object? Suppose that you know that the mass of the unknown object is more than a kilogram.

Exercise 2.4.6: Suppose you wish to measure the friction a mass of 0.1 kg experiences as it slides along a floor (you wish to find c ). You have a spring with spring constant k = 5N∕m   . You take the spring, you attach it to the mass and fix it to a wall. Then you pull on the spring and let the mass go. You find that the mass oscillates with frequency 1 Hz. What is the friction?

2.5 Nonhomogeneous equations

Note: 2 lectures, §3.5 in EP

2.5.1 Solving nonhomogeneous equations

We have solved linear constant coefficient homogeneous equations. What about nonhomogeneous linear ODEs? For example, the equations for forced mechanical vibrations. That is, suppose we have an equation such as

 ′′     ′
y  + 5y + 6y = 2x + 1.
(2.6)

We will generally write Ly = 2x + 1  instead when the operator is not important. We solve (2.6) in the following manner. We find the general solution yc  to the associated homogeneous equation

 ′′    ′
y  + 5y + 6y = 0.
(2.7)

We call yc  the complementary solution. We also find a single particular solution yp  to (2.6) in some way and then

y = yc + yp

is the general solution to (2.6) (we will see why in a moment).

Note that yp  can be any solution. Suppose you find a different particular solution y~p  . Write the difference as w = y - y~
     p   p  . Then plug w into the left hand side of the equation to get

w ′′ + 5w ′ + 6w = (y′p′+ 5y′p + 6yp) - (y~′p′+ 5~y′p + 6~yp) = (2x + 1) - (2x + 1) = 0.

In other words, w is a complementary solution. Using the operator notation the calculation becomes simpler. As L is a linear operator and so we could just write

Lw =  L(yp - ~yp) = Lyp - L ~yp = (2x + 1) - (2x + 1) = 0.

So w = y  - ~y
     p    p  is a solution to (2.7). Any two solutions of (2.6) differ by a solution to the homogeneous equation (2.7). The solution y = yc + yp  includes all solutions to (2.6), since yc  is the general solution to the associated homogeneous equation.

Theorem 2.5.1. Let Ly = f (x )  be a linear ODE (not necessarily constant coefficient). Let yc  be the general solution to the associated homogeneous equation Ly = 0  and let yp  be any particular solution to Ly = f(x)  . Then the general solution to Ly = f (x )  is

y = yc + yp.

The moral of the story is that we can find the particular solution in any old way. If we find a different particular solution (by a different method, or simply by guessing), then we still get the right general solution to the whole problem. The formula may look different and the constants you will have to choose given the initial conditions may be different, but it is the same solution.

2.5.2 Undetermined coefficients

The trick is to somehow, in a smart way, guess one particular solution to (2.6). Note that 2x + 1  is a polynomial, and the left hand side of the equation will be a polynomial if we let y be a polynomial of the same degree. Let us try

y = Ax + B.

We plug in to obtain

y′′ + 5y′ + 6y = (Ax + B)′′ + 5(Ax + B)′ + 6(Ax + B) = 0 + 5A + 6Ax + 6B = 6Ax + (5A + 6B ).

So 6Ax + (5A + 6B ) = 2x + 1  . Therefore, A = 1∕3   and B = -1∕9   . That means yp = 13x - 19 = 3x9-1   . Solving the complementary problem (Exercise!) we get

        -2x      -3x
yc = C 1e  + C2e   .

Hence the general solution to (2.6) is

       -2x     -3x   3x --1
y = C1e   + C2e   +    9   .

Now suppose we are further given some initial conditions. For example, y(0) = 0  and y′(0) = 1∕3   . First find  ′         -2x       -3x  1
y  = -2C 1e   - 3C2e   +  ∕3   . Then

                    1      1                        1
0 = y(0) = C1 + C2 --,     --= y′(0) = -2C 1 - 3C 2 +-.
                    9      3                        3

We solve to get C1 = 1∕3   and C2 = -2∕9   . The particular solution we want is

                                  -2x     -3x
y (x) = 1e-2x - 2e-3x + 3x---1 = 3e-----2e---+-3x---1.
       3       9         9               9

Exercise 2.5.1: Check that y really solves the equation (2.6) and the given initial conditions.

Note: A common mistake is to solve for constants using the initial conditions with yc  and only adding the particular solution yp  after that. That will not work. You need to first compute y = yc + yp  and only then solve for the constants using the initial conditions.

A right hand side consisting of exponentials, sines, and cosines can be handled similarly. For example,

y′′ + 2y′ + 2y = cos2x.

Let us simply find some yp  . We notice that we may have to also guess sin 2x since derivatives of cosine are sines. We guess

yp = A cos2x + B sin 2x.

We plug yp  into the equation and we get

-4A cos 2x - 4B sin2x - 4A sin2x + 4B cos2x + 2A cos2x + 2B sin2x = cos 2x.

The left hand side must equal to right hand side. We group terms and we get that - 4A + 4B + 2A = 1  and - 4B - 4A + 2B = 0  . So - 2A + 4B = 1  and 2A + B = 0  and hence A = -1∕10   and B = 1∕5   . So

y  = A cos2x + B sin 2x = --cos2x-+-2-sin-2x.
 p                              1 0

Similarly, if the right hand side contains exponentials we guess exponentials. For example, if the equation is (where L is a linear constant coefficient operator)

Ly = e3x,

we will guess y = Ae3x  . We note also that using the product rule for differentiation gives us a way to combine these guesses. If we can guess a form for y such that Ly has all the terms needed to for the right hand side, that is a good place to start. For example,

            2 -x
Ly = (1 + 3x )e   cosπx.

We will guess

y = (A + Bx + Cx2)e-xcos πx + (D + Ex + Fx 2)e-xsinπx.

We will plug in and then hopefully get equations that we can solve for A,B, C,D, E,F . As you can see this can make for a very long and tedious calculation very quickly. C’est la vie!

There is one hiccup in all this. It could be that our guess actually solves the associated homogeneous equation. That is, suppose we have

y′′ - 9y = e3x.

We would love to guess y = Ae 3x  , but if we plug this into the left hand side of the equation we get

y′′ - 9y = 9Ae 3x - 9Ae3x = 0 ⇔ e3x.

There is no way we can choose A to make the left hand side be  3x
e  . The trick in this case is to multiply our guess by x until we get rid of duplication with the complementary solution. That is first we compute yc  (solution to Ly = 0  )

       -3x      3x
yc = C 1e   + C2e

and we note that the e3x  term is a duplicate with our desired guess. We modify our guess to y = Axe 3x  and notice there is no duplication anymore. Let us try. Note that y′ = Ae 3x + 3Axe3x  and y′′ = 6Ae 3x + 9Axe 3x  . So

 ′′          3x       3x       3x      3x
y  - 9y = 6Ae  + 9Axe   - 9Axe   = 6Ae  .

So     3x
6Ae  is supposed to equal  3x
e  . Hence, 6A = 1  and so A = 1∕6   . Thus we can now write the general solution as

y = y + y  = C e-3x + C e3x + 1-xe3x.
     c   p     1       2     6

Now what about the case when multiplying by x does not get rid of duplication. For example,

y′′ - 6y′ + 9y = e3x.

Note that yc = C1e3x + C 2xe3x  . So guessing y = Axe 3x  would not get us anywhere. In this case we want to guess        23x
y = Ax e  . Basically, we want to multiply our guess by x until all duplication is gone. But no more! Multiplying too many times will also make the process not work.

Finally what if the right hand side is several terms, such as

Ly = e2x + cos x.

In this case we find u that solves Lu = e2x  and v that solves Lv = cosx (do each term separately). Then note that if y = u + v , then Ly =  e2x + cosx . This is because L is linear; we have                            2x
Ly = L (u + v) = Lu + Lv = e  + cosx .

2.5.3 Variation of parameters

The method of undetermined coefficients will work for many basic problems that crop up. But it does not work all the time. It only works when the right hand side of the equation Ly = f(x)  has only finitely many linearly independent derivatives, so that we can write a guess that consists of them all. Some equations are a bit tougher. Consider

y′′ + y = tanx.

Note that each new derivative of tan x looks completely different and cannot be written as a linear combination of the previous derivatives. We get    2
sec x ,      2
2 sec x tan x , etc….

This equation calls for a different method. We present the method of variation of parameters, which will handle any equation of the form Ly = f(x)  , provided we can solve certain integrals. For simplicity, we will restrict ourselves to second order equations, but the method will work for higher order equations just as well (but the computations will be more tedious).

Let us try to solve the example.

Ly = y′′ + y = tan x.

First we find the complementary solution Ly =  0  . We get yc = C 1y1 + C 2y2   , where y1 = co sx and y2 = sin x . Now to try to find a solution to the nonhomogeneous equation we try

yp = y = u1y1 + u2y2,

where u 1   and u2   are functions and not constants. We are trying to satisfy Ly = tan x . That gives us one condition on the functions u
 1   and u
 2   . Compute (note the product rule!)

 ′    ′      ′        ′      ′
y = (u1y1 + u2y2) + (u 1y1 + u2y2).

We can still impose one more condition at our will to simplify computations (we have two unknown functions, so we are allowed two conditions). We require that (u ′y1 + u′y2) = 0
  1     2  . This makes computing the second derivative easier.

y′ = u y′+ u y′,
     1 1   2 2
y′′ = (u′1y′1 + u′2y′2) + (u 1y′1′+ u2y′2′).
Since y1   and y2   are solutions to y′′ + y = 0  , we know that y′1′= - y1   and y′2′= -y2   . (Note: If the equation was instead y′′ + ay′ + by = 0  we would have y′′= - ay′- byi
 i       i  .) So
 ′′     ′ ′   ′ ′
y  = (u1y1 + u2y2) - (u1y1 + u2y2).

Now note that

y′′ = (u′1y′1 + u′2y′2) - y,

and hence

y′′ + y = Ly = u′1y′1 + u′2y′2.

For y to satisfy Ly = f(x)  we must have f (x ) = u′y′+ u ′y′
        1 1    22   .

So what we need to solve are the two equations (conditions) we imposed on u1   and u2

|--------------------|
| u′1y1 + u′2y2 = 0,   |
|  ′ ′   ′ ′         |
--u1y1 +-u2y2-=-f(x).-

We can now solve for u′
 1   and u′
 2   in terms of f (x)  , y1   and y2   . You will always get these formulas for any Ly = f(x)  . There is a general formula for the solution you can just plug into, but it is better to just repeat what we do below. In our case the two equations become

 u ′cosx + u′sinx = 0,
   1′        2′
-u 1sin x + u2cosx = tanx.
Hence
  u′1(cos x)(sinx ) + u′2sin2x = 0,
  ′                ′   2
-u1(sin x)(cosx) + u 2cos x = (tan x)(cosx) = sin x.
And thus
u ′2(sin2x + cos2x) = sin x,
u ′= sinx,
  2
  ′  --sin2x
u 1 = c osx  = - (tan x)(sinx).
Now we need to integrate  ′
u1   and  ′
u2   to get u1   and u2   .
     ∫         ∫                         ||         ||
u1 =    u′1 dx =   - (tan x)(sinx) dx = 1-ln ||(sin-x) --1||+ sinx,
     ∫         ∫                     2   |(sin x) + 1|
         ′
u2 =    u2 dx =   sinx dx = - cosx.
So our particular solution is
                            |         |
                  1-        |||(sinx)---1|||
yp = u 1y1 + u2y2 = 2(cosx)ln |(sinx) + 1| + (cosx)(sin x) - (cosx)(sinx) =
                                                                1         ||(sinx) - 1||
                                                             =  -(cosx)ln |||---------|||.
                                                                2         (sinx) + 1
The general solution to y′′ + y = tanx is, therefore,
                                 |          |
                       1-        |||(sin-x) --1-|||
y = C1 cosx + C2sinx + 2 (co sx)ln|(sin x) + 1 |.

2.5.4 Exercises

Exercise 2.5.2: Find a particular solution of  ′′   ′        2x
y  - y - 6y = e  .

Exercise 2.5.3: Find a particular solution of y′′ - 4y′ + 4y = e2x  .

Exercise 2.5.4: Solve the initial value problem  ′′
y  + 9y = cos3x + sin 3x for y(0) = 2  , y′(0) = 1  .

Exercise 2.5.5: Setup the form of the particular solution but do not solve for the coefficients for y(4) - 2y′′′ + y′′ = ex  .

Exercise 2.5.6: Setup the form of the particular solution but do not solve for the coefficients for y(4) - 2y′′′ + y′′ = ex + x + sin x .

Exercise 2.5.7: a) Using variation of parameters find a particular solution of  ′′    ′       x
y - 2y + y = e  . b) Find a particular solution using undetermined coefficients. c) Are the two solutions you found the same? What is going on?

Exercise 2.5.8: Find a particular solution of y′′ - 2y′ + y = sinx2   . It is OK to leave the answer as a definite integral.

2.6 Forced oscillations and resonance

Note: 2 lectures, §3.6 in EP

PIC

Let us return back to the mass on a spring example. We will now consider the case of forced oscillations. That is, we will consider the equation

   ′′    ′
mx   + cx + kx = F (t)

for some nonzero F(t)  . The setup is again: m is mass, c is friction, k is the spring constant and F(t)  is an external force acting on the mass.

What we are interested in is some periodic forcing, such as noncentered rotating parts, or perhaps even loud sounds or other sources of periodic force. Once we will learn about Fourier series we will see that we will essentially cover every type of periodic function by considering only F (t) = F0co sωt (or sine instead of cosine, the calculations will be essentially the same).

2.6.1 Undamped forced motion and resonance

First let us consider undamped (c = 0  ) motion for simplicity. We have the equation

   ′′
mx   + kx = F0co sωt.

This equation has the complementary solution (solution to the associated homogeneous equation)

xc = C 1cosω 0t + C2 sin ω0t,

where ω  =  √k∕m-
  0  is the natural frequency (angular). It is the frequency at which the system “wants to oscillate” without external interference.

Let us suppose that ω0 ⇔ ω . Try the solution xp = Aco sωt and solve for A . Note that we need not have sine in our trial solution as on the left hand side we will only get cosines anyway. If you include a sine it is fine; you will find that its coefficient will be zero (I could not find a rhyme).

We solve using the method of undetermined coefficients. We find that

         F
xp = ----2-0---- cosωt.
     m (ω0 - ω2)

We leave it as an exercise to do the algebra required.

The general solution is

|------------------------------------------------|
|                                 F0             |
| x = C 1cosω 0t + C2 sin ω0t +---2----2- cosωt.  |
-----------------------------m-(ω0---ω-)---------

or written another way

x = C cos(ω t - γ) +----F0-----cosωt.
           0        m(ω 20 - ω 2)

Hence it is a superposition of two cosine waves at different frequencies.

Example 2.6.1: Take

    ′′                                   ′
0.5x  + 8x = 10 cosπt,     x(0 ) = 0,    x (0) = 0.

Let us compute. First we read off the parameters: ω = π ,      √ 8---
ω0 =   ∕0.5 = 4  , F 0 = 10  , m = 0.5  . The general solution is

                           20
x = C 1cos 4t + C2 sin 4t +----2 cosπt.
                        16 - π

Solve for C1   and C2   using the initial conditions. It is easy to see that C1 = --202
     16-π    and C2 = 0  . Hence

       20
x =  -----2-(cos πt - cos 4t).
     16 - π

PIC
Figure 2.5: Graph of -20-(cosπt - c os4t)
16-π2  .

Notice the “beating” behavior in Figure 2.5. First use the trigonometric identity

     (      )   (      )
      A---B-     A-+-B-
2 sin    2    sin   2    =  cosB - cosA

to get that

           (     (     )    (      ))
    --20---       4 --π      4-+-π
x = 16 - π 2 2sin  2   t sin   2  t  .

Notice that x is a high frequency wave modulated by a low frequency wave.

Now suppose that ω0 = ω . Obviously, we cannot try the solution A cosωt and then use the method of undetermined coefficients. We notice that co sωt solves the associated homogeneous equation. Therefore, we need to try xp = At cosωt + Btsinωt . This time we do need the sine term since the second derivative of t cosωt does contain sines. We write the equation

x′′ + ω 2x = F0-cosωt.
            m

Plugging into the left hand side we get

                          F
2B ω cosωt - 2Aω sinωt =  -0-cosωt.
                          m

Hence A = 0  and      F
B = 2m0ω  . Our particular solution is  F
2m0ω tsin ωt and our general solution is

                           F0
x = C1 cosωt + C2 sin ωt + ----tsinωt.
                          2mω

PIC
Figure 2.6: Graph of 1tsin πt
π .

The important term is the last one (the particular solution we found). We can see that this term grows without bound as t → ∞ . In fact it oscillates between F2m0ωt  and -F2m0ωt-  . The first two terms only oscillate between   ∘ --2----2
±   C 1 + C 2   , which becomes smaller and smaller in proportion to the oscillations of the last term as t gets larger. In Figure 2.6 we see the graph with C 1 = C2 = 0  , F 0 = 2  , m = 1  , ω =  π .

By forcing the system in just the right frequency we produce very wild oscillations. This kind of behavior is called resonance or sometimes pure resonance. Sometimes resonance is desired. For example, remember when as a kid you could start swinging by just moving back and forth on the swing seat in the correct “frequency”? You were trying to achieve resonance. The force of each one of your moves was small, but after a while it produced large swings.

On the other hand resonance can be destructive. In an earthquake some buildings collapse while others may be relatively undamaged. This is due to different buildings having different resonance frequencies. So figuring out the resonance frequency can be very important.

A common (but wrong) example of destructive force of resonance is the Tacoma Narrows bridge failure. It turns out there was an altogether different phenomenon at play there* .

2.6.2 Damped forced motion and practical resonance

In real life things are not as simple as they were above. There is, of course, some damping. Our equation becomes

  ′′    ′
mx  + cx + kx = F 0cosωt,
(2.8)

for some c > 0  . We have solved the homogeneous problem before. We let

                  ∘ ---
     -c-            -k
p =  2m     ω 0 =   m .

We replace equation (2.8) with

x′′ + 2px′ + ω 20x = F0-cosωt.
                  m

We find the roots of the characteristic equation of the associated homogeneous problem are              ∘ --------
                2    2
r1,r2 = - p ±  p  - ω0   . The form of the general solution of the associated homogeneous equation depends on the sign of p 2 - ω 20   , or equivalently on the sign of c2 - 4km , as we have seen before. That is

     (||C  er1t + C er2t              if c2 > 4km,
     |||{  1       2
xc = |||C 1e-pt + C2te-pt           if c2 = 4km,
     ||(e-pt(C co sω t + C sinω  t)  if c2 < 4km ,
            1     1     2     1

where       ∘ --------
ω 1 =   ω20 - p2   . In any case, we can see that xc(t) → 0  as t → ∞ . Furthermore, there can be no conflicts when trying to solve for the undetermined coefficients by trying xp = A cosωt + B sin ωt . Let us plug in and solve for A and B . We get (the tedious details are left to reader)

(                  )        (                  )        F
(ω 20 - ω 2)B - 2ωpA  sin ωt + (ω 20 - ω 2)A + 2ωpB  cosωt = --0co sωt.
                                                         m

We get that

            2    2
A = ------(ω0 --ω-)F0----- ,
    m (2ωp )2 + m (ω 20 - ω 2)2
            2ωpF
B = --------------02------ .
    m (2ωp )2 + m (ω 0 - ω 2)2
We also compute      √--2---2-
C =   A  + B   to be
    ----------F-0----------
C =   ∘ ------2----2----2-2.
    m   (2ωp ) + (ω0 - ω )

Thus our particular solution is

            2    2
xp = -----(ω0---ω-)F0------cos ωt + -------2-ωpF-0--------sinωt
     m(2ωp )2 + m (ω20 - ω2)2        m(2ωp )2 + m (ω20 - ω 2)2

Or in the other notation we have amplitude C and phase shift γ where (if ω  ⇔ ω
      0   )

tan γ = B-= --2ωp---.
       A   ω 20 - ω 2

Hence we have

|------------------------------------------|
|      ----------F-0----------             |
| xp =   ∘ -----------2-------cos(ωt - γ). |
|      m   (2ωp )2 + (ω0 - ω 2)2            |
-------------------------------------------

If ω  = ω0   we see that A = 0  ,           F0
B = C  = 2mωp  , and γ = π∕2   .

The exact formula is not as important as the idea. You should not memorize the above formula, you should remember the ideas involved. For different forcing function F , you will get a different formula for x
 p  . So there is no point in memorizing this specific formula. You can always recompute it later or look it up if you really need it.

For reasons we will explain in a moment, we will call xc  the transient solution and denote it by xtr  . We will call the xp  we found above the steady periodic solution and denote it by xsp  . The general solution to our problem is

x = x + x  = x  + x  .
     c   p    tr   sp

PIC
Figure 2.7: Solutions with different initial conditions for parameters k = 1  , m = 1  , F0 = 1  , c = 0.7  , and ω = 1.1  .

We note that xc = xtr  goes to zero as t → ∞ , as all the terms involve an exponential with a negative exponent. Hence for large t , the effect of xtr  is negligible and we will essentially only see xsp  . Hence the name transient. Notice that xsp  involves no arbitrary constants, and the initial conditions will only affect xtr  . This means that the effect of the initial conditions will be negligible after some period of time. Because of this behavior, we might as well focus on the steady periodic solution and ignore the transient solution. See Figure 2.7 for a graph of different initial conditions.

Notice that the speed at which xtr  goes to zero depends on p (and hence c ). The bigger p is (the bigger c is), the “faster” xtr  becomes negligible. So the smaller the damping, the longer the “transient region.” This agrees with the observation that when c = 0  , the initial conditions affect the behavior for all time (i.e. an infinite “transient region”).

Let us describe what we mean by resonance when damping is present. Since there were no conflicts when solving with undetermined coefficient, there is no term that goes to infinity. What we will look at however is the maximum value of the amplitude of the steady periodic solution. Let C be the amplitude of xsp  . If we plot C as a function of ω (with all other parameters fixed) we can find its maximum. We call the ω that achieves this maximum the practical resonance frequency. We call the maximal amplitude C(ω )  the practical resonance amplitude. Thus when damping is present we talk of practical resonance rather than pure resonance. A sample plot for three different values of c is given in Figure 2.8. As you can see the practical resonance amplitude grows as damping gets smaller, and any practical resonance can disappear when damping is large.


PIC

Figure 2.8: Graph of C (ω )  showing practical resonance with parameters k = 1  , m  = 1  , F 0 = 1  . The top line is with c = 0.4  , the middle line with c = 0.8  , and the bottom line with c = 1.6  .


To find the maximum we need to find the derivative C ′(ω )  . Computation shows

                 2    2    2
  ′     ---4ω-(2p-+-ω----ω-0)F0--
C (ω ) = m ((2 ωp)2 + (ω 2- ω 2)2)3∕2 .
                      0

This is zero either when ω = 0  or when 2p 2 + ω 2 - ω 20 = 0  . In other words, C ′(ω ) = 0  when

|------------------------------|
|      ∘--2-----2              |
| ω =   ω 0 - 2p   or  ω = 0.  |
-------------------------------

It can be shown that if   2    2
ω 0 - 2p   is positive then ∘ -2-------
  ω0 - 2p2   is the practical resonance frequency (that is the point where C (ω )  is maximal, note that in this case C ′(ω ) > 0  for small ω ). If ω =  0  is the maximum, then essentially there is no practical resonance since we assume that ω >  0  in our system. In this case the amplitude gets larger as the forcing frequency gets smaller.

If practical resonance occurs, the frequency is smaller than ω0   . As damping c (and hence p ) becomes smaller, the closer the practical resonance frequency goes to ω 0   . So when damping is very small, ω
  0   is a good estimate of the resonance frequency. This behavior agrees with the observation that when c = 0  , then ω 0   is the resonance frequency.

The behavior will be more complicated if the forcing function is not an exact cosine wave, but for example a square wave. It will be good to come back to this section once you have learned about the Fourier series.

2.6.3 Exercises

Exercise 2.6.1: Derive a formula for xsp  if the equation is mx ′′ + cx′ + kx = F 0sinωt . Assume c > 0  .

Exercise 2.6.2: Derive a formula for xsp  if the equation is    ′′    ′
mx   + cx + kx = F0 cosωt + F1co s3ωt . Assume c > 0  .

Exercise 2.6.3: Take    ′′    ′
mx  + cx + kx = F 0cos ωt . Fix m > 0  and k > 0  . Now think of the function C (ω)  . For what values of c (solve in terms of m , k , and F 0   ) will there be no practical resonance (that is, for what values of c is there no maximum of C (ω)  for ω > 0  ).

Exercise 2.6.4: Take mx ′′ + cx′ + kx = F 0cos ωt . Fix c > 0  and k > 0  . Now think of the function C (ω)  . For what values of m (solve in terms of c , k , and F
  0   ) will there be no practical resonance (that is, for what values of m is there no maximum of C (ω )  for ω > 0  ).

Exercise 2.6.5: Suppose a water tower in an earthquake acts as a mass-spring system. Assume that the container on top is full and the water does not move around. The container then acts as a mass and the support acts as the spring, where the induced vibrations are horizontal. Suppose that the container with water has a mass of m =  10,000 kg. It takes a force of 1000 newtons to displace the container 1 meter. For simplicity assume no friction.

Suppose that an earthquake induces an external force F (t) = mA ω2 cosωt .

a) What is the natural frequency of the water tower.

b) If ω is not the natural frequency, find a formula for the amplitude of the resulting oscillations of the water container.

c) Suppose A = 1  and an earthquake with frequency 0.5 cycles per second comes. What is the amplitude of the oscillations. Suppose that if the water tower moves more than 1.5 meter, the tower collapses. Will the tower collapse?