2 Finding the complementary function

To find the complementary function we must make use of the following property.

If y 1 ( x ) and y 2 ( x ) are any two (linearly independent) solutions of a linear, homogeneous second order differential equation then the general solution y cf ( x ) , is

y cf ( x ) = A y 1 ( x ) + B y 2 ( x )

where A , B are constants.

We see that the second order linear ordinary differential equation has two arbitrary constants in its general solution . The functions y 1 ( x ) and y 2 ( x ) are linearly independent if one is not a multiple of the other.

Example 5

Verify that y 1 = e 4 x and y 2 = e 2 x both satisfy the constant coefficient linear homogeneous equation:

d 2 y d x 2 6 d y d x + 8 y = 0

Write down the general solution of this equation.

Solution

When y 1 = e 4 x , differentiation yields:

d y 1 d x = 4 e 4 x  and d 2 y 1 d x 2 = 16 e 4 x

Substitution into the left-hand side of the ODE gives 16 e 4 x 6 ( 4 e 4 x ) + 8 e 4 x , which equals 0, so that y 1 = e 4 x is indeed a solution.

Similarly if y 2 = e 2 x , then

d y 2 d x = 2 e 2 x and d 2 y 2 d x 2 = 4 e 2 x .

Substitution into the left-hand side of the ODE gives 4 e 2 x 6 ( 2 e 2 x ) + 8 e 2 x , which equals 0, so that y 2 = e 2 x is also a solution of equation the ODE. Now e 2 x and e 4 x are linearly independent functions, so, from the property stated above we have:

y cf ( x ) = A e 4 x + B e 2 x is the general solution of the ODE.

Example 6

Find values of k so that y = e k x is a solution of:

d 2 y d x 2 d y d x 6 y = 0

Hence state the general solution.

Solution

As suggested we try a solution of the form y = e k x . Differentiating we find

d y d x = k e k x and d 2 y d x 2 = k 2 e k x .

Substitution into the given equation yields:

k 2 e k x k e k x 6 e k x = 0  that is ( k 2 k 6 ) e k x = 0

The only way this equation can be satisfied for all values of x is if

k 2 k 6 = 0

that is, ( k 3 ) ( k + 2 ) = 0 so that k = 3 or k = 2 . That is to say, if y = e k x is to be a solution of the differential equation, k must be either 3 or 2 . We therefore have found two solutions:

y 1 ( x ) = e 3 x and y 2 ( x ) = e 2 x

These are linearly independent and therefore the general solution is

y cf ( x ) = A e 3 x + B e 2 x

The equation k 2 k 6 = 0 for determining k is called the auxiliary equation .

Task!

By substituting y = e k x , find values of k so that y is a solution of

d 2 y d x 2 3 d y d x + 2 y = 0

Hence, write down two solutions, and the general solution of this equation.

First find the auxiliary equation:

k 2 3 k + 2 = 0 Now solve the auxiliary equation and write down the general solution:

The auxiliary equation can be factorised as ( k 1 ) ( k 2 ) = 0 and so the required values of k are 1 and 2. The two solutions are y = e x and y = e 2 x . The general solution is

y cf ( x ) = A e x + B e 2 x

Example 7

Find the auxiliary equation of the differential equation:

a d 2 y d x 2 + b d y d x + c y = 0

Solution

We try a solution of the form y = e k x so that

d y d x = k e k x and d 2 y d x 2 = k 2 e k x .

Substitution into the given differential equation yields:

a k 2 e k x + b k e k x + c e k x = 0 that is ( a k 2 + b k + c ) e k x = 0

Since this equation is to be satisfied for all values of x , then

a k 2 + b k + c = 0

is the required auxiliary equation.

Key Point 5

The auxiliary equation of a d 2 y d x 2 + b d y d x + c y = 0 is a k 2 + b k + c = 0   where   y = e k x

Task!

Write down, but do not solve, the auxiliary equations of the following:

  1. d 2 y d x 2 + d y d x + y = 0 ,
  2. 2 d 2 y d x 2 + 7 d y d x 3 y = 0
  3. 4 d 2 y d x 2 + 7 y = 0 ,
  4. d 2 y d x 2 + d y d x = 0
  1. k 2 + k + 1 = 0
  2. 2 k 2 + 7 k 3 = 0
  3. 4 k 2 + 7 = 0
  4. k 2 + k = 0

Solving the auxiliary equation gives the values of k which we need to find the complementary function. Clearly the nature of the roots will depend upon the values of a , b and c .

Case 1 If b 2 > 4 a c the roots will be real and distinct. The two values of k thus obtained, k 1 and k 2 , will allow us to write down two independent solutions: y 1 ( x ) = e k 1 x and y 2 ( x ) = e k 2 x ,  and so the general solution of the differential equation will be:

y ( x ) = A e k 1 x + B e k 2 x

Key Point 6

If the auxiliary equation has real, distinct roots k 1 and k 2 , the complementary function will be:

y cf ( x ) = A e k 1 x + B e k 2 x

Case 2 On the other hand, if b 2 = 4 a c the two roots of the auxiliary equation will be equal and this method will therefore only yield one independent solution. In this case, special treatment is required.

Case 3 If b 2 < 4 a c the two roots of the auxiliary equation will be complex, that is, k 1 and k 2 will be complex numbers. The procedure for dealing with such cases will become apparent in the following examples.

Example 8

Find the general solution of: d 2 y d x 2 + 3 d y d x 10 y = 0

Solution

By letting y = e k x , so that d y d x = k e k x and d 2 y d x 2 = k 2 e k x

the auxiliary equation is found to be: k 2 + 3 k 10 = 0 and so ( k 2 ) ( k + 5 ) = 0

so that k = 2 and k = 5 . Thus there exist two solutions: y 1 = e 2 x and y 2 = e 5 x .

We can write the general solution as: y = A e 2 x + B e 5 x

Example 9

Find the general solution of: d 2 y d x 2 + 4 y = 0

Solution

As before, let y = e k x so that d y d x = k e k x and d 2 y d x 2 = k 2 e k x .

The auxiliary equation is easily found to be:  k 2 + 4 = 0  that is, k 2 = 4 so that k = ± 2 i , that is, we have complex roots. The two independent solutions of the equation are thus

y 1 ( x ) = e 2 i x y 2 ( x ) = e 2 i x

so that the general solution can be written in the form y ( x ) = A e 2 i x + B e 2 i x .

However, in cases such as this, it is usual to rewrite the solution in the following way.

Recall that Euler’s relations give: e 2 i x = cos 2 x + i sin 2 x and e 2 i x = cos 2 x i sin 2 x

so that y ( x ) = A ( cos 2 x + i sin 2 x ) + B ( cos 2 x i sin 2 x ) .

If we now relabel the constants such that A + B = C and A i B i = D we can write the general solution in the form:

y ( x ) = C cos 2 x + D sin 2 x

Note: In Example 8 we have expressed the solution as y = whereas in Example 9 we have expressed it as y ( x ) = . Either will do.

Example 10

Given a y + b y + c y = 0 , write down the auxiliary equation. If the roots of the auxiliary equation are complex (one root will always be the complex conjugate of the other) and are denoted by k 1 = α + β i and k 2 = α β i show that the general solution is:

y ( x ) = e α x ( A cos β x + B sin β x )

Solution

Substitution of y = e k x into the differential equation yields ( a k 2 + b k + c ) e k x = 0 and so the auxiliary equation is:

a k 2 + b k + c = 0

If k 1 = α + β i , k 2 = α β i then the general solution is

y = C e ( α + β i ) x + D e ( α β i ) x

where C and D are arbitrary constants.

Using the laws of indices this is rewritten as:

y = C e α x e β i x + D e α x e β i x = e α x ( C e β i x + D e β i x )

Then, using Euler’s relations, we obtain:

y = e α x ( C cos β x + C i sin β x + D cos β x D i sin β x ) = e α x { ( C + D ) cos β x + ( C i D i ) sin β x }

Writing A = C + D and B = C i D i , we find the required solution:

y = e α x ( A cos β x + B sin β x )

Key Point 7

If the auxiliary equation has complex roots, α + β i and α β i , then the complementary function is:

y cf = e α x ( A cos β x + B sin β x )
Task!

Find the general solution of y + 2 y + 4 y = 0.

Write down the auxiliary equation:

k 2 + 2 k + 4 = 0 Find the complex roots of the auxiliary equation:

k = 1 ± 3 i Using Key Point 7 with α = 1 and β = 3 write down the general solution:

y = e x ( A cos 3 x + B sin 3 x )

Key Point 8

If the auxiliary equation has two equal roots, k , the complementary function is:

y cf = ( A + B x ) e k x
Example 11

The auxiliary equation of a y + b y + c y = 0 is a k 2 + b k + c = 0. Suppose this equation has equal roots k = k 1 and k = k 1 . Verify that y = x e k 1 x is a solution of the differential equation.

Solution

We have: y = x e k 1 x y = e k 1 x ( 1 + k 1 x ) y = e k 1 x ( k 1 2 x + 2 k 1 )

Substitution into the left-hand side of the differential equation yields:

e k 1 x { a ( k 1 2 x + 2 k 1 ) + b ( 1 + k 1 x ) + c x } = e k 1 x { ( a k 1 2 + b k 1 + c ) x + 2 a k 1 + b }

But a k 1 2 + b k 1 + c = 0 since k 1 satisfies the auxiliary equation. Also,

k 1 = b ± b 2 4 a c 2 a

but since the roots are equal, then b 2 4 a c = 0 hence k 1 = b 2 a . So 2 a k 1 + b = 0 . Hence e k 1 x { ( a k 1 2 + b k 1 + c ) x + 2 a k 1 + b } = e k 1 x { ( 0 ) x + 0 } = 0 . We conclude that y = x e k 1 x is a solution of a y + b y + c y = 0 when the roots of the auxiliary equation are equal. This illustrates Key Point 8.

Example 12

Obtain the general solution of the equation: d 2 y d x 2 + 8 d y d x + 16 y = 0 .

Solution

As before, a trial solution of the form y = e k x yields an auxiliary equation k 2 + 8 k + 16 = 0 . This equation factorizes so that ( k + 4 ) ( k + 4 ) = 0 and we obtain equal roots, that is, k = 4 (twice). If we proceed as before, writing y 1 ( x ) = e 4 x y 2 ( x ) = e 4 x , it is clear that the two solutions are not independent. We need to find a second independent solution. Using the result summarised in Key Point 8, we conclude that the second independent solution is y 2 = x e 4 x . The general solution is then:

y ( x ) = ( A + B x ) e 4 x

Exercises
  1. Obtain the general solutions, that is, the complementary functions, of the following equations:
    1. d 2 y d x 2 3 d y d x + 2 y = 0
    2. d 2 y d x 2 + 7 d y d x + 6 y = 0
    3. d 2 x d t 2 + 5 d x d t + 6 x = 0
    4. d 2 y d t 2 + 2 d y d t + y = 0  
    5. d 2 y d x 2 4 d y d x + 4 y = 0
    6. d 2 y d t 2 + d y d t + 8 y = 0
    7. d 2 y d x 2 2 d y d x + y = 0   
    8. d 2 y d t 2 + d y d t + 5 y = 0  
    9. d 2 y d x 2 + d y d x 2 y = 0
    10. d 2 y d x 2 + 9 y = 0
    11. d 2 y d x 2 2 d y d x = 0   
    12. d 2 x d t 2 16 x = 0
  2. Find the auxiliary equation for the differential equation L d 2 i d t 2 + R d i d t + 1 C i = 0

    Hence write down the complementary function.

  3. Find the complementary function of the equation d 2 y d x 2 + d y d x + y = 0
    1. y = A e x + B e 2 x
    2. y = A e x + B e 6 x
    3. x = A e 2 t + B e 3 t
    4. y = A e t + B t e t
    5. y = A e 2 x + B x e 2 x
    6. y = e 0.5 t ( A cos 2.78 t + B sin 2.78 t )
    7. y = A e x + B x e x
    8. x = e 0.5 t ( A cos 2.18 t + B sin 2.18 t )
    9. y = A e 2 x + B e x
    10. y = A cos 3 x + B sin 3 x
    11. y = A + B e 2 x
    12. x = A e 4 t + B e 4 t
  1. L k 2 + R k + 1 C = 0 i ( t ) = A e k 1 t + B e k 2 t k 1 , k 2 = 1 2 L ( R ± R 2 C 4 L C )
  2. e x 2 A cos 3 2 x + B sin 3 2 x