Section 2.2 Constant coefficient second order linear ODEs
Subsection 2.2.1 Solving constant coefficient equations
Video 2.2.1. Constant Coefficients (Distinct Roots).
We now move to 2nd order ODEs. We shall begin with 2nd order linear ODEs which are much easier to handle than nonlinear ODEs. Some of the theory, like Existence and Uniqueness parallel the 1st order case pretty well. However, we shall see that there are some new complications like Superposition to think about and we are going to have a lot of parallels to linear algebra here.
Consider the problem
This is a second order linear homogeneous equation with constant coefficients. Constant coefficients means that the functions in front of \(y''\text{,}\) \(y'\text{,}\) and \(y\) are constants, they do not depend on \(x\text{.}\)
To guess a solution, think of a function that 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. Yes, we are talking about the exponential.
Let us try 1 a solution of the form \(y = e^{rx}\text{.}\) Then \(y' = r e^{rx}\) and \(y'' = r^2 e^{rx}\text{.}\) Plug in to get
Hence, if \(r=2\) or \(r=4\text{,}\) then \(e^{rx}\) is a solution. So let \(y_1 = e^{2x}\) and \(y_2 = e^{4x}\text{.}\)
Exercise 2.2.1.
Check that \(y_1\) and \(y_2\) are solutions.
The functions \(e^{2x}\) and \(e^{4x}\) are linearly independent. If they were not linearly independent, we could write \(e^{4x} = C e^{2x}\) for some constant \(C\text{,}\) implying that \(e^{2x} = C\) for all \(x\text{,}\) which is clearly not possible. Hence, we can write the general solution as
We need to solve for \(C_1\) and \(C_2\text{.}\) To apply the initial conditions, we first find \(y' = 2 C_1 e^{2x} + 4 C_2 e^{4x}\text{.}\) We plug \(x=0\) into \(y\) and \(y'\) and solve.
Either apply some matrix algebra, or just solve these by high school math. For example, divide the second equation by 2 to obtain \(3 = C_1 + 2 C_2\text{,}\) and subtract the two equations to get \(5 = C_2\text{.}\) Then \(C_1 = -7\) as \(-2 = C_1 + 5\text{.}\) Hence, the solution we are looking for is
Video 2.2.2. The Constant Coefficient Method (all cases).
In this video we generalize ad categorize all the possibilities for a 2nd order homogeneous constant coefficient equation
Let us generalize this example into a method. Suppose that we have an equation
where \(a, b, c\) are constants. Try the solution \(y = e^{rx}\) to obtain
Divide by \(e^{rx}\) to obtain the so-called characteristic equation of the ODE:
Solve for the \(r\) by using the quadratic formula.
So \(e^{r_1 x}\) and \(e^{r_2 x}\) are solutions. There is still a difficulty if \(r_1 = r_2\text{,}\) 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.
-
If \(r_1\) and \(r_2\) are distinct and real (when \(b^2 - 4ac > 0\)), then (2.3) has the general solution
\begin{equation*} y = C_1 e^{r_1 x} + C_2 e^{r_2 x} . \end{equation*} -
If \(r_1 = r_2\) (happens when \(b^2 - 4ac = 0\)), then (2.3) has the general solution
\begin{equation*} y = (C_1 + C_2 x)\, e^{r_1 x} . \end{equation*}
Example 2.2.1.
Solve
The characteristic equation is \(r^2 - k^2 = 0\) or \((r-k)(r+k) = 0\text{.}\) Consequently, \(e^{-k x}\) and \(e^{kx}\) are the two linearly independent solutions, and the general solution is
Since \(\cosh s = \frac{e^s+e^{-s}}{2}\) and \(\sinh s = \frac{e^s-e^{-s}}{2}\text{,}\) we can also write the general solution as
Example 2.2.2.
Find the general solution of
The characteristic equation is \(r^2 - 8 r + 16 = {(r-4)}^2 = 0\text{.}\) The equation has a double root \(r_1 = r_2 = 4\text{.}\) The general solution is, therefore,
That \(e^{4x}\) solves the equation is clear. If \(x e^{4x}\) solves the equation, then we know we are done. Let us compute \(y' = e^{4x} + 4xe^{4x}\) and \(y'' = 8 e^{4x} + 16xe^{4x}\text{.}\) Plug in
In some sense, a doubled root rarely happens. If coefficients are picked randomly, a doubled root is unlikely. There are, however, some natural phenomena (such as resonance as we will see) where a doubled root does happen, so we cannot just dismiss this case.
Let us give a short argument for why the solution \(x e^{r x}\) 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 \(\frac{e^{r_2 x} - e^{r_1 x}}{r_2 - r_1}\) is a solution when the roots are distinct. When we take the limit as \(r_1\) goes to \(r_2\text{,}\) we are really taking the derivative of \(e^{rx}\) using \(r\) as the variable. Therefore, the limit is \(x e^{rx}\text{,}\) and hence this is a solution in the doubled root case.
Subsection 2.2.2 Complex numbers and Euler's formula
A polynomial may have complex roots. The equation \(r^2 + 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)\text{.}\) 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)\text{.}\) We define multiplication by
It turns out that with this multiplication rule, all the standard properties of arithmetic hold. Further, and most importantly \((0,1) \times (0,1) = (-1,0)\text{.}\)
Generally we write \((a,b)\) as \(a+ib\text{,}\) and we treat \(i\) as if it were an unknown. When \(b\) is zero, then \((a,0)\) is just the number \(a\text{.}\) We do arithmetic with complex numbers just as we would with polynomials. The property we just mentioned becomes \(i^2 = -1\text{.}\) So whenever we see \(i^2\text{,}\) we replace it by \(-1\text{.}\) For example,
The numbers \(i\) and \(-i\) are the two roots of \(r^2 + 1 = 0\text{.}\) Engineers often use the letter \(j\) instead of \(i\) for the square root of \(-1\text{.}\) We use the mathematicians' convention and use \(i\text{.}\)
Exercise 2.2.3.
Make sure you understand (that you can justify) the following identities:
\(i^2 = -1\text{,}\) \(i^3 = -i\text{,}\) \(i^4 = 1\text{,}\)
\(\dfrac{1}{i} = -i\text{,}\)
\((3-7i)(-2-9i) = \cdots = -69-13i\text{,}\)
\((3-2i)(3+2i) = 3^2 - {(2i)}^2 = 3^2 + 2^2 = 13\text{,}\)
\(\frac{1}{3-2i} = \frac{1}{3-2i} \frac{3+2i}{3+2i} = \frac{3+2i}{13} = \frac{3}{13}+\frac{2}{13}i\text{.}\)
We also define the exponential \(e^{a+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: \(e^{x+y} = e^x e^y\text{.}\) This means that \(e^{a+ib} = e^a e^{ib}\text{.}\) Hence if we can compute \(e^{ib}\text{,}\) we can compute \(e^{a+ib}\text{.}\) For \(e^{ib}\) we use the so-called Euler's formula.
Theorem 2.2.2. Euler's formula.
In other words, \(e^{a+ib} = e^a \bigl( \cos(b) + i \sin(b) \bigr) = e^a \cos(b) + i e^a \sin(b)\text{.}\)
Exercise 2.2.4.
Using Euler's formula, check the identities:
Exercise 2.2.5.
Double angle identities: Start with \(e^{i(2\theta)} = {\bigl(e^{i \theta} \bigr)}^2\text{.}\) Use Euler on each side and deduce:
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,
Subsection 2.2.3 Complex roots
Suppose the equation \(ay'' + by' + cy = 0\) has the characteristic equation \(a r^2 + b r + c = 0\) that has complex roots. By the quadratic formula, the roots are \(\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\text{.}\) These roots are complex if \(b^2 - 4ac < 0\text{.}\) In this case the roots are
As you can see, we always get a pair of roots of the form \(\alpha \pm i \beta\text{.}\) In this case we can still write the solution as
However, the exponential is now complex-valued. We need to allow \(C_1\) and \(C_2\) 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
Then
Linear combinations of solutions are also solutions. Hence,
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
If the characteristic equation has the roots \(\alpha \pm i \beta\) (when \(b^2 - 4ac < 0\)), then the general solution is
Example 2.2.3.
Find the general solution of \(y'' + k^2 y = 0\text{,}\) for a constant \(k > 0\text{.}\)
The characteristic equation is \(r^2 + k^2 = 0\text{.}\) Therefore, the roots are \(r = \pm ik\text{,}\) and by the theorem, we have the general solution
Example 2.2.4.
Find the solution of \(y'' - 6 y' + 13 y = 0\text{,}\) \(y(0) = 0\text{,}\) \(y'(0) = 10\text{.}\)
The characteristic equation is \(r^2 - 6 r + 13 = 0\text{.}\) By completing the square we get \({(r-3)}^2 + 2^2 = 0\) and hence the roots are \(r = 3 \pm 2i\text{.}\) By the theorem we have the general solution
To find the solution satisfying the initial conditions, we first plug in zero to get
Hence, \(C_1 = 0\) and \(y = C_2 e^{3x} \sin (2x)\text{.}\) We differentiate,
We again plug in the initial condition and obtain \(10 = y'(0) = 2C_2\text{,}\) or \(C_2 = 5\text{.}\) The solution we are seeking is
Subsection 2.2.4 Exercises
Exercise 2.2.6.
Find the general solution of \(2y'' + 2y' -4 y = 0\text{.}\)
Exercise 2.2.7.
Find the general solution of \(y'' + 9y' - 10 y = 0\text{.}\)
Exercise 2.2.8.
Solve \(y'' - 8y' + 16 y = 0\) for \(y(0) = 2\text{,}\) \(y'(0) = 0\text{.}\)
Exercise 2.2.9.
Solve \(y'' + 9y' = 0\) for \(y(0) = 1\text{,}\) \(y'(0) = 1\text{.}\)
Exercise 2.2.10.
Find the general solution of \(2y'' + 50y = 0\text{.}\)
Exercise 2.2.11.
Find the general solution of \(y'' + 6 y' + 13 y = 0\text{.}\)
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\text{.}\) Find a formula for the general solution of \(a x^2 y'' + b x y' + c y = 0\text{.}\) Hint: Note that \(x^r = e^{r \ln x}\text{.}\)
Exercise 2.2.15.
Find the solution to \(y''-(2\alpha) y' + \alpha^2 y=0\text{,}\) \(y(0) = a\text{,}\) \(y'(0)=b\text{,}\) where \(\alpha\text{,}\) \(a\text{,}\) and \(b\) are real numbers.
Exercise 2.2.16.
Construct an equation such that \(y = C_1 e^{-2x} \cos(3x) + C_2 e^{-2x} \sin(3x)\) is the general solution.
Exercise 2.2.101.
Find the general solution to \(y''+4y'+2y=0\text{.}\)
\(y = C_1 e^{(-2+\sqrt{2}) x} + C_2 e^{(-2-\sqrt{2}) x}\)
Exercise 2.2.102.
Find the general solution to \(y''-6y'+9y=0\text{.}\)
\(y = C_1 e^{3x} + C_2 x e^{3x}\)
Exercise 2.2.103.
Find the solution to \(2y''+y'+y=0\text{,}\) \(y(0) = 1\text{,}\) \(y'(0)=-2\text{.}\)
\(y = e^{-x/4} \cos\bigl((\nicefrac{\sqrt{7}}{4})x\bigr) - \sqrt{7} e^{-x/4} \sin\bigl((\nicefrac{\sqrt{7}}{4})x\bigr)\)
Exercise 2.2.104.
Find the solution to \(2y''+y'-3y=0\text{,}\) \(y(0) = a\text{,}\) \(y'(0)=b\text{.}\)
\(y = \frac{2(a-b)}{5} \, e^{-3x/2}+\frac{3 a+2 b}{5} \, e^x\)
Exercise 2.2.105.
Find the solution to \(z''(t) = -2z'(t)-2z(t)\text{,}\) \(z(0) = 2\text{,}\) \(z'(0)= -2\text{.}\)
\(z(t) = 2e^{-t} \cos(t)\)
Exercise 2.2.106.
Find the solution to \(y''-(\alpha+\beta) y' + \alpha \beta y=0\text{,}\) \(y(0) = a\text{,}\) \(y'(0)=b\text{,}\) where \(\alpha\text{,}\) \(\beta\text{,}\) \(a\text{,}\) and \(b\) are real numbers, and \(\alpha \not= \beta\text{.}\)
\(y = \frac{a \beta-b}{\beta-\alpha} e^{\alpha x} + \frac{b-a \alpha}{\beta-\alpha} e^{\beta x}\)
Exercise 2.2.107.
Construct an equation such that \(y = C_1 e^{3x} + C_2 e^{-2x}\) is the general solution.
\(y'' -y'-6y=0\)