MA108 ODE: Second Order Linear ODE’s
Lecture 9
                 Niranjan Balachandran
                      IIT Bombay
     Niranjan Balachandran, IITB   MA108
Example: Umdamped Simple Harmonic Vibrations
  Consider a cart of mass M attached to a wall by means of a spring.
  At the equilibrium postion x = 0, the spring exerts no force. If the
  center of the cart is at a distance x from the spring, the spring
  exerts a force
                                 Fs = −kx
  where k > 0 is a constant. By Newton’s second law of motion,
                              d 2x
                                  M= −kx.
                              dt 2
  Set                              r
                                      k
                              a=        .
                                     M
  Then the characteristic equation of the above differential equation
  is                         m2 + a2 = 0,
  i.e., m = ±ıa. Hence, the general solution of the above DE is
                       x = c1 sin at + c2 cos at
  where c1 , c1 ∈ R.
                Niranjan Balachandran, IITB   MA108
Example continued
  Suppose the cart is pulled aside to the initial position x = x0 with
  initial velocity v = dx
                       dt = 0 at t = 0. Then
                              c2 = x0 and c1 = 0.
  Hence,
                                   x = x0 cos at.
  where x0 is the amplitude of the simple harmonic vibration and T
  is the time required for one complete cycle. Then
                                      aT = 2π,
  i.e.,                                         r
                                  2π                  M
                              T =    = 2π               .
                                   a                  K
                Niranjan Balachandran, IITB   MA108
Example: Damped Vibrations
  Suppose, in the previous example, the cart of mass M experiences
  a damping force Fd , due to the viscosity of the medium through
  which it moves, such a sair or water. Assume that
                                         dx
                               Fd = −c ,
                                         dt
  where c is a positive constant that measures the resistance of the
  medium. Then                 d 2x
                             M 2 = Fs + Fd
                               dt
  i.e.,
                        d 2x     c dx     k
                              +        + x = 0.
                        dt 2    M dt      M
  Set                                       r
                                c             k
                        2b =        and a =     .
                               M              M
  Then the characteristic equation of the above DE is
                           m2 + 2bm + a2 = 0.
                                          √
  The roots m1 , m2 are given by −b ± b 2 − a2 .
                Niranjan Balachandran, IITB   MA108
Example continued
  Case I: b > a. Then m1 and m2 are distinct negative real numbers.
  The general soultion of the DE is
                         x = c1 e m1 t + c2 e m2 t .
  The initial conditions are
                                         dx
                        x(0) = 0 and        (0) = 0.
                                         dt
  Since               dx
                          = m1 c1 e m1 t + m2 c2 e m2 t ,
                      dt
  it follows that
                                 c1 + c2 = x0
                                 m1 c1 + m2 c2 = 0.
  Solving the above two equations for c1 and c2 ,
                        m2 x0                 m1 x0
                  c1 =          and c2 =               .
                       m2 − m1              m1 − m2
  Hence
                           x0
                                  m1 e m2 t − m2 e m1 t                                                        
                 x(t) =
                        m1 − m2
                  Niranjan Balachandran, IITB   MA108
Example continued
  Case II: b = a. Then m1 = m2 = −b = −a.
  Hence
                               x(t) = c1 e −at + c2 te −at
  is the general solution to the given DE. The initial conditions are
                                                    dx
                             x(0) = x0 and             (0) = 0.
                                                    dt
  It follows that
                                                  x0 = c1 ,
                                      0 = −ac1 + c2 .
  Hence,
                                x(t) = x0 e −at (1 + at).
                    Niranjan Balachandran, IITB     MA108
Example continued
  Case III: b < a. Then m1 , m2 are complex conjugates of each other
  and are given by                 p
                            −b ± b 2 − a2 .
            √
  Set α = a2 − b 2 . Then m1 , m2 are given by −b ± ıα. The
  general solution of the given DE is
                   x(t) = e −bt (c1 cos αt + c2 sin αt).
  Recall the initial conditions
                                         dx
                        x(0) = x0 and       (0) = 0.
                                         dt
  It follows that x0 = c1 and
  dx
       = −be −bt (c1 cos αt + c2 sin αt) + e −bt (c2 α cos αt − c1 α sin αt)
   dt
  so that at t = 0, we get
                                   bc1     bx0
                             c2 =       =      .
                                     α      α
  Hence
                                              bx0
                   x(t) = e −bt (x0 cos αt +       sin αt).
                                               α
                 Niranjan Balachandran, IITB   MA108
Example continued
  Recall that
                                                      bx0
                 x(t) = e −bt (x0 cos αt +                sin αt).
                                                       α
  Let tan θ = αb . Then
                                √
                        x0 e −bt b 2 + α2
                 x(t) =                   cos(αt − θ).
                                α
  This function oscillates with an amplitude which decreases
  exponentially. The graph passes the equilibrium position x = 0 at
  regular intervals. Let T be the time required for one complete
  cycle. Then
                                αT = 2π,
  i.e.,
                         2π    2π         2π
                 T =        =√       =q                              .
                         α     2
                              a −b 2    k
                                           −                  c2
                                                        M    4M 2
                Niranjan Balachandran, IITB   MA108
Cauchy-Euler Equations
  The equation
                             x 2 y 00 + axy 0 + by = 0
  where a, b ∈ R is called a Cauchy-Euler equation. Assume x > 0.
  Suppose y = x m is a solution to this DE. Then,
              x 2 m(m − 1)x m−2 + axmx m−1 + bx m = 0.
  We get:
                           m(m − 1) + am + b = 0.
  i.e.,
                            m2 + (a − 1)m + b = 0.
  This is called the auxiliary equation of the given Cauchy-Euler
  equation. The roots are
                                       p
                             (1 − a) ± (a − 1)2 − 4b
                  m1 , m2 =                            .
                                         2
                 Niranjan Balachandran, IITB   MA108
Cauchy-Euler Equations
  Case I: Distinct real roots.
  Are x m1 and x m2 linearly independent? Yes. Hence the general
  solution is given by
                                   y = c1 x m1 + c2 x m2 ,
  for c1 , c2 ∈ R.
                     Niranjan Balachandran, IITB   MA108
Cauchy-Euler Equations
  Case II: Equal real roots.
  i.e.,
                                                 1−a
                                m1 = m2 =            .
                                                  2
  Hence
                                                    1−a
                                 y = f (x) = x       2
  is a solution. To get a solution g linearly independent from f , set
                                 g (x) = v (x)f (x).
  Now,
                                   g 0 = v 0 f + vf 0 ,
  and
                           g 00 = v 00 f + 2v 0 f 0 + f 00 v .
  Thus,
          x 2 (v 00 f + 2v 0 f 0 + f 00 v ) + ax(v 0 f + vf 0 ) + bvf = 0;
                 Niranjan Balachandran, IITB   MA108
Cauchy-Euler Equations
           x 2 (v 00 f + 2v 0 f 0 + f 00 v ) + ax(v 0 f + vf 0 ) + bvf = 0;
  i.e.,
          v (x 2 f 00 + axf 0 + bf ) + x 2 (v 00 f + 2v 0 f 0 ) + axv 0 f = 0.
  Thus,
                          x 2 v 00 f + v 0 x(2f 0 x + af ) = 0.
                         1−a
  Now, for f (x) = x      2    , we have:
                                            1 − a − 1 (a+1)     1−a
                 2f 0 x + af = 2x ·              x 2        + ax 2
                                              2
                                    1−a          1−a        1−a
                  = (1 − a)x         2    + ax    2    =x    2    = f (x).
  Hence, we get:
                                  x 2 v 00 f + v 0 xf = 0.
  i.e.,
                                          v 00   1
                                             0
                                               =− .
                                          v      x
                   Niranjan Balachandran, IITB    MA108
Cauchy-Euler Equations
  Hence,                                                   
                                                           1
                          ln |v 0 | = − ln x = ln             .
                                                           x
  Take,
                                                 1
                                        v0 =       .
                                                 x
  Set
                                     v (x) = ln x.
  Hence,
                                                        1−a
                                g (x) = (ln x)x          2    .
  Thus the general solution is given by
                                       1−a              1−a
                           y = c1 x     2      + c2 x    2    ln x,
  c1 , c2 ∈ R.
                 Niranjan Balachandran, IITB      MA108
Cauchy-Euler Equations
  Case III: Complex roots.
  Roots are m1 = µ + ıν, m2 = µ − ıν.
                                  ıν
  x m1 = x µ x ıν = x µ e ln x          = x µ e ıν ln x = x µ (cos(ν ln x) + ı sin(ν ln x)),
  Similarily,
            x m2 = x µ e −ıν ln x = x µ (cos(ν ln x) − ı sin(ν ln x)),
  It follows that
                       x m1 + x m2
                                    = x µ cos(ν ln x),
                            2
                        x m1 − x m2
                                     = x µ sin(ν ln x)
                             2ı
  These are linearly independent solutions of the given DE and hence
  the general solution is given by
                 y = x µ (c1 cos(ν ln x) + c2 sin(ν ln x)),
  c1 , c2 ∈ R.
                    Niranjan Balachandran, IITB   MA108
Non-homogeneous Second Order Linear ODE’s
  Consider the non-homogeneous DE
                         y 00 + p(t)y 0 + q(t)y = r (t)
  where p(t), q(t), r (t) are continuous functions on an interval I .
  The associated homogeneous DE is
                           y 00 + p(t)y 0 + q(t)y = 0.
  Can we relate the solutions of the above two DE’s?
                 Niranjan Balachandran, IITB   MA108
Non-homogeneous Second Order Linear ODE’s
  Theorem
  Let f (t) be any solution of
                          y 00 + p(t)y 0 + q(t)y = r (t)
  and y1 (t), y2 (t) be a basis of the solution space of the
  corresponding homogeneous DE. Then the set of solutions of the
  non-homogeneous DE is
                 {c1 y1 (t) + c2 y2 (t) + f (t) | c1 , c2 ∈ R}.
  Proof: Let φ(t) be any solution of
                    L(y ) = y 00 + p(t)y 0 + q(t)y = r (t).
  Then,
          L(φ(t) − f (t))
                  Niranjan Balachandran, IITB   MA108
Non-homogeneous Second Order Linear ODE’s
  Theorem
  Let f (t) be any solution of
                          y 00 + p(t)y 0 + q(t)y = r (t)
  and y1 (t), y2 (t) be a basis of the solution space of the
  corresponding homogeneous DE. Then the set of solutions of the
  non-homogeneous DE is
                  {c1 y1 (t) + c2 y2 (t) + f (t) | c1 , c2 ∈ R}.
  Proof: Let φ(t) be any solution of
                    L(y ) = y 00 + p(t)y 0 + q(t)y = r (t).
  Then,
          L(φ(t) − f (t)) = L(φ(t)) − L(f (t)) = r (t) − r (t) = 0.
                  Niranjan Balachandran, IITB   MA108
Non-homogeneous Second Order Linear ODE’s
  Hence, φ(t) − f (t) is a solution of the homogeneous DE. Thus,
                     φ(t) − f (t) = c1 y1 (t) + c2 y2 (t),
  for c1 , c2 ∈ R. Hence,
                     φ(t) = c1 y1 (t) + c2 y2 (t) + f (t).
  Summary: In order to find the general solution of a
  non-homogeneous DE, we need to
       get one particular solution of the non-homogeneous DE
       get the general solution of the corresponding homogeneous
       DE.
                 Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  Suppose the non-homogeneous ODE has constant coefficients. In
  this case, we know how to write down the general solution of the
  corresponding homogeneous ODE. So we need to find one solution
  of the non-homogeneous DE. One way to do this is called the
  method of undetermined coefficients. Thus, we have:
                            y 00 + py 0 + qy = r (t),
  with p, q ∈ R, and r (t) - a continuous function on I . The method
  of undetermined coefficients does not work for any r (t), but only
  when we know more about r (t). We’ll use this method only if r (t)
  involves e at , sin at, cos at or polynomials in t.
                Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  Example: Find a particular solution of the DE:
                             y 00 − 3y 0 − 4y = 3e 2t .
  We’ll search for a solution of the form ae 2t , where a is a constant.
  So put y = ae 2t . We get:
                    (ae 2t )00 − 3(ae 2t )0 − 4ae 2t = 3e 2t .
  Thus,
                       4ae 2t − 6ae 2t − 4ae 2t = 3e 2t .
  Thus,
                                           1
                                   a=− .
                                           2
  Hence − 21 e 2t is a particular solution of the DE.
  How do you get the general solution? Analyse roots of
  m2 − 3m − 4 = 0. So general solution is
                                                1
                         y = c1 e 4t + c2 e −t − e 2t .
                                                2
                 Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  If
                    r (t) = r1 (t) + r2 (t) + . . . + rn (t),
  where ri (t) are e at or sin at or cos at or polynomials in t, consider
  the n subproblems
                             y 00 + py 0 + qy = ri (t).
  If yi (t) is a particular solution of this problem, then,
                    y (t) = y1 (t) + y2 (t) + . . . + yn (t)
  is a particular solution of
                             y 00 + py 0 + qy = r (t).
                 Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  Example: Find a particular solution of
                           y 00 − 3y 0 − 4y = 2 sin t.
  Make a guess as to functions of which form we’ll search for as a
  solution. a sin t? No. a sin t + b cos t? Yes. So set
                           y (t) = a sin t + b cos t.
  Thus,
             y 0 = a cos t − b sin t; y 00 = −a sin t − b cos t.
  Substituting, we get:
             (−5a + 3b − 2) sin t + (−3a − 5b) cos t = 0.
  Thus,
                        −5a + 3b = 2; 3a + 5b = 0
                      5                   3
  (Why?). Thus, a = − 17 , b=            17 ,   and a particular solution is
                                      5          3
                       y (t) = −         sin t +    cos t.
                                      17         17
                Niranjan Balachandran, IITB     MA108
Method of Undetermined Coefficients
  Example: Find a particular solution of
                          y 00 − 3y 0 − 4y = 4t 2 − 1.
  Set
                             y (t) = at 2 + bt + c.
  Substituting, we get:
          −4at 2 + (−6a − 4b)t + (2a − 3b − 4c) = 4t 2 − 1.
  Thus,
           −4a = 4, − 6a − 4b = 0, 2a − 3b − 4c = −1.
  Thus,
                                     3      11
                      a = −1, b = , c = − .
                                     2       8
  Thus, a particular solution is
                                       3  11
                        y (t) = −t 2 + t − .
                                       2  8
                Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  Example: Find a particular solution of
                       y 00 − 3y 0 − 4y = −8e t cos 2t.
  We should search for a solution of the form
                      y (t) = ae t cos 2t + be t sin 2t.
  Then,
            y 0 (t) = (a + 2b)e t cos 2t + (−2a + b)e t sin 2t,
  and
           y 00 = (−3a + 4b)e t cos 2t + (−4a − 3b)e t sin 2t.
  Substituting, we get:
                    −10a − 2b = −8, 2a − 10b = 0.
  Thus, a particular solution is
                            10         2
                   y (t) = e t cos 2t + e t sin 2t.
                            13         13
                Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  Example: Find a particular solution of
                              y 00 + 4y = 3 cos 2t.
  Since r (t) = 3 cos 2t, you would look for solutions of the form
                          y (t) = a cos 2t + b sin 2t.
  Thus,
                      y 0 (t) = −2a sin 2t + 2b cos 2t,
                     y 00 (t) = −4a cos 2t − 4b sin 2t.
  Substituting in the given DE, we get:
      (−4a cos 2t − 4b sin 2t) + 4(a cos 2t + b sin 2t) = 3 cos 2t.
  But the lhs is 0! So can’t solve for a and b.
                Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  Why this ...? The problem was that sin 2t and cos 2t are also
  solutions of the associated homogeneous ODE: y 00 + 4y = 0. So
  lesson learned? When we search for solutions of a particular form,
  we need to make sure that it’s not a solution of the associated
  homogeneous equation.
  We now modify the proposed solution as:
                         y (t) = at cos 2t + bt sin 2t.
  Then,
               y 0 (t) = (b − 2at) sin 2t + (a + 2bt) cos 2t,
        y 00 (t) = −4at cos 2t − 4bt sin 2t − 4a sin 2t + 4b cos 2t.
  Substituting, we get:
                     −4a sin 2t + 4b cos 2t = 3 cos 2t.
  Thus, a = 0, b = 43 , and a particular solution is y (t) = 34 t sin 2t.
                 Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  If the obvious candidate for a solution, say y (t) = f (t), as well as
  this one multiplied by t, y (t) = tf (t), turn out to be solutions of
  the associated homogeneous ODE, then what to do? Modify the
  proposed solution by multiplying it with t 2 ; i.e., set
                                   y (t) = t 2 f (t).
  Can this too be a solution of the homogeneous ODE? No, since
  the solution space is two dimensional.
                 Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  Example: Find a particular solution of
          y 00 − 3y 0 − 4y = 3e 2t + 2 sin t + 4t 2 − 1 − 8e t cos 2t.
  Here,
                    r (t) = r1 (t) + r2 (t) + r3 (t) + r4 (t).
  We need to solve
                              y 00 − 3y 0 − 4y = ri (t),
  get a particular solution yi (t), and then
                   y (t) = y1 (t) + y2 (t) + y3 (t) + y4 (t)
  is a particular solution of the given problem. Thus, a particular
  solution is
           1       5     3           3 11 10          2
  y (t) = − e 2t − sin t+ cos t−t 2 + t− + e t cos 2t+ e t sin 2t.
           2      17     17          2  8 13          13
                  Niranjan Balachandran, IITB   MA108
Method of Undetermined Coefficients
  Example: Find a particular solution of
                                  y 00 + y = x 3 sin x.
  What’s your candidate? Presence of sin x indicates both sin x and
  cos x in the answer. Presence of x 3 indicates a generic cubic
  polynomial. Thus,
   (a1 x 3 + b1 x 2 + c1 x + d1 ) cos x + (a2 x 3 + b2 x 2 + c2 x + d2 ) sin x?
  This wouldn’t do since sin x and cos x are already solutions of the
  homogeneous part. So work with
  x(a1 x 3 + b1 x 2 + c1 x + d1 ) cos x + x(a2 x 3 + b2 x 2 + c2 x + d2 ) sin x.
                  Niranjan Balachandran, IITB   MA108