[Notes on Diffy Qs home] [PDF version] [Buy paperback on Amazon]

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

2.2 Constant coefficient second order linear ODEs

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

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, r2 − 6r + 8 = 0 (divide through by erx), (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 linearly independent we could write e4x = Ce2x for some constant C , implying that e2x = C for all x , 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) = 2C + 4C . 1 2
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
y = − 7e2x + 5e4x.

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

ar2erx + brerx + cerx = 0, 2 ar + br + c = 0.
The equation ar2 + 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 r1 and r2 are the roots of the characteristic equation.

(i)
If r1 and r2 are distinct and real (when b2 − 4ac > 0 ), then (2.3) has the general solution
y = C 1er1x + C 2er2x.

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

For another example of the first case, take the equation y′′ − k2y = 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  2 2 r − 8r + 16 = (r − 4) = 0 . The equation has a double root r1 = r2 = 4 . The general solution is, therefore,

 4x 4x 4x y = (C 1 + C 2x)e = C1e + C 2xe .

Exercise 2.2.2: Check that  4x e and  4x xe are linearly independent.

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

 ′′ ′ 4x 4x 4x 4x 4x y − 8y + 16y = 8e + 16xe − 8(e + 4xe ) + 16xe = 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  rx xe 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 we take the limit as r1 goes to r2 , we are really taking the derivative of erx using r as the variable. Therefore, the 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 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. When b is zero, then (a,0) is just the number a . We do arithmetic with complex numbers just as we would with polynomials. The property we just mentioned becomes  2 i = − 1 . So whenever we see  2 i , we replace it by − 1 . The numbers i and − i are the two 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 also define the exponential ea+ib of a complex number. We do this by 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, these properties still hold for the complex exponential. For example the very important property: ex+y = exey . This means that ea+ib = eaeib . Hence if we can compute eib , we can compute  a+ib e . For  ib e we use the so-called Euler’s formula.

Theorem 2.2.2 (Euler’s formula).

|--i𝜃------------------------------−i𝜃-----------------| --e--=-cos𝜃-+-isin-𝜃-----and------e--=--cos𝜃-− i-sin-𝜃.|

In other words,  ( ) ea+ib = eaco s(b) + isin(b) = eacos(b) + ieasin(b) .

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:

cos(2𝜃) = co s2 𝜃 − sin2𝜃 and sin(2𝜃) = 2 sin 𝜃cos 𝜃.

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

Suppose the equation  ′′ ′ ay + by + cy = 0 has the characteristic equation  2 ar + br + c = 0 that has complex roots. By the quadratic formula, the roots are  √----- −b±-2ba2−4ac . These roots are complex if b2 − 4ac < 0 . In this case the roots are

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

As you can see, we 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 allow C1 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. Let

 (α+iβ)x (α−iβ)x y1 = e and y 2 = e .

Then

y1 = eαxco s(βx) + ieαxsin(βx), y = eαxco s(βx) − ieαxsin(βx). 2

Linear combinations of solutions are also solutions. Hence,

 y1 + y2 αx y3 = -------= e co s(βx ), y −2y y4 = -1---2-= eαxsin(βx), 2i
are also solutions. 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 cos(βx) + C2e sin(βx).

Example 2.2.2: Find the general solution of  ′′ 2 y + k y = 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 = C cos(kx) + C sin(kx). 1 2

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

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

y = C1e3xcos(2x) + C2e3xsin (2x ).

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

 0 0 0 = y(0) = C1e cos 0 + C 2e sin 0 = C1.

Hence C1 = 0 and y = C 2e3x sin(2x) . We differentiate

y′ = 3C 2e3x sin(2x) + 2C2e3xcos(2x).

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

 3x y = 5e 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 the Cauchy-Euler equations of Exercise 2.1.6. Suppose now that (b − a)2 − 4ac < 0 . Find a formula for the general solution of ax2y′′ + bxy′ + cy = 0 . Hint: Note that  r rlnx x = e .

Exercise 2.2.15: Find the solution to y′′ − (2α )y′ + α2y = 0 , y(0) = a , y′(0) = b , where α , a , and b are real numbers.

Exercise 2.2.16: Construct an equation such that  −2x −2x y = C 1e cos(3x) + C 2e sin(3x) is the general solution.

Exercise 2.2.101: Find the general solution to  ′′ ′ y + 4y + 2y = 0 .

Exercise 2.2.102: Find the general solution to y′′ − 6y′ + 9y = 0 .

Exercise 2.2.103: Find the solution to  ′′ ′ 2y + y + y = 0 , y(0) = 1 ,  ′ y (0 ) = −2 .

Exercise 2.2.104: Find the solution to 2y′′ + y′ − 3y = 0 , y(0) = a , y′(0) = b .

Exercise 2.2.105: Find the solution to z′′(t) = − 2z′(t) − 2z(t) , z(0) = 2 , z′(0 ) = −2 .

Exercise 2.2.106: Find the solution to  ′′ ′ y − (α + β)y + αβy = 0 , y(0 ) = a ,  ′ y (0) = b , where α , β , a , and b are real numbers, and α ⇔ β .

Exercise 2.2.107: Construct an equation such that y = C 1e3x + C2e−2x is the general solution.