Skip to main content

Section 2.2 Complex Roots and Euler’s Formula

Subsection Complex Numbers and Basic Identities

The next case to consider for constant coefficient second order equations is the one where \(b^2 - 4ac < 0\text{.}\) This results in two roots \(r_1\) and \(r_2\text{,}\) but they are complex roots. In order to solve differential equations with \(b^2 - 4ac < 0\text{,}\) we need to be able to manipulate and use 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. For more bachground information on complex numbers, see Section A.2.
To start with, we define \(i = \sqrt{-1}\text{.}\) Since this is the square root of a negative number, this \(i\) is not a real number. A complex number is written in the form \(z = x+iy\) where \(x\) and \(y\) are real numbers. For a complex number \(x+iy\) we call \(x\) the real part and \(y\) the imaginary part of the number. Often the following notation is used,
\begin{equation*} \operatorname{Re}(x+iy) = x \qquad \text{and} \qquad \operatorname{Im}(x+iy) = y. \end{equation*}
The real numbers are contained in the complex numbers as those complex numbers with the imaginary part being zero.
When trying to do arithmetic with complex numbers, we treat \(i\) as though it is a variable, and do computations just as we would with polynomials. The important fact that we will use to simplify is the fact that since \(i = \sqrt{-1}\text{,}\) we have that \(i^2 = -1\text{.}\) So whenever we see \(i^2\text{,}\) we replace it by \(-1\text{.}\) For example,
\begin{equation*} (2+3i)(4i) - 5i = (2\times 4)i + (3 \times 4) i^2 - 5i = 8i + 12 (-1) - 5i = -12 + 3i . \end{equation*}
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{.}\)

Checkpoint 2.2.1.

Make sure you understand (that you can justify) the following identities:
(a)
\(i^2 = -1\text{,}\) \(i^3 = -i\text{,}\) \(i^4 = 1\)
(c)
\((3-7i)(-2-9i) = \cdots = -69-13i\)
(d)
\((3-2i)(3+2i) = 3^2 - {(2i)}^2 = 3^2 + 2^2 = 13\)
(e)
\(\frac{1}{3-2i} = \frac{1}{3-2i} \frac{3+2i}{3+2i} = \frac{3+2i}{13} = \frac{3}{13}+\frac{2}{13}i\)
The important part to keep in mind with complex numbers is that dividing by complex numbers is not as simple as one would hope. The process does not just involve inverting the real and imaginary parts and putting an \(i\) in there, instead, the complex number in the denominator needs to be converted into a real number by multiplying the top and bottom by the complex conjugate, and then everything can be distributed and simplified. We use \(\bar{z}\) to denote the complex conjugate of a complex number \(z\text{,}\) and for \(z = a+bi\) the conjugate is defined as \(\bar{z} = a - bi\text{.}\) Thus, if we multiply a complex number \(z = a+bi\) by its complex conjugate,
\begin{equation*} z\bar{z} = (a+bi)(a-bi) = a^2 + b^2, \end{equation*}
we always get a real number. That’s why division works the way that it does.
In order to solve differential equations where the characteristic equation has complex roots, we need to deal with the exponential \(e^{a+bi}\) of complex numbers. 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}\text{,}\) we use the so-called 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{.}\)

Checkpoint 2.2.3.

Using Euler’s formula, check the identities:
\begin{equation*} \cos \theta = \frac{e^{i \theta} + e^{-i \theta}}{2} \qquad \text{and} \qquad \sin \theta = \frac{e^{i \theta} - e^{-i \theta}}{2i}. \end{equation*}

Checkpoint 2.2.4.

Double angle identities: Start with \(e^{i(2\theta)} = {\bigl(e^{i \theta} \bigr)}^2\text{.}\) Use Euler on each side and deduce:
\begin{equation*} \cos (2\theta) = \cos^2 \theta - \sin^2 \theta \qquad \text{and} \qquad \sin (2\theta) = 2 \sin \theta \cos \theta . \end{equation*}

Subsection 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
\begin{equation*} r_1, r_2 = \frac{-b}{2a} \pm i\frac{\sqrt{4ac - b^2}}{2a} . \end{equation*}
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
\begin{equation*} y = C_1 e^{(\alpha+i\beta)x} + C_2 e^{(\alpha-i\beta)x} . \end{equation*}
However, the exponential is now complex-valued, and so (real) linear combinations of these solutions will be complex valued. If we are using these equations to model physical problems, the answer should be real-valued, as the position of a mass-on-a-spring can not be a complex number. To do this, we need to determine two real-valued, linearly independent solutions to this differential equation.
To do this, we use the following result.

Proof.

This is based on the fact that the differential equation is linear. We can compute derivatives of \(y\)
\begin{align*} y(x)\amp= u(x) + iv(x) \\ y'(x) \amp= u'(x) + iv'(x) \\ y''(x) \amp= u''(x) + iv''(x) \text{.} \end{align*}
Then, we can plug this into the differential equation
\begin{align*} 0 \amp= y'' + p(x)y' + q(x) y \\ \amp= u''(x) + iv''(x) + p(x)(u'(x) + iv'(x)) + q(x) (u(x) + iv(x)) \\ 0\amp= u''(x) + p(x)u'(x) + q(x)u(x) + i(v''(x) + p(x)v'(x) + q(x)v(x)) \text{.} \end{align*}
Since the equation at the end of this chain is equal to zero, it must be zero as a complex number, which means that both the real and imaginary parts must be zero. This means that
\begin{align*} u''(x) + p(x)u'(x) + q(x)u(x) \amp= 0 \\ v''(x) + p(x)v'(x) + q(x)v(x) \amp= 0 \text{,} \end{align*}
so that both \(u\) and \(v\) solve the original differential equation.
To use this to solve the problem at hand, we have our solution
\begin{equation*} y_1(x) = e^{(\alpha + i\beta) x} \end{equation*}
and we need to split this into its real and imaginary parts. Since
\begin{equation*} y_1 = e^{\alpha x} \cos (\beta x) + i e^{\alpha x} \sin (\beta x), \end{equation*}
the real and imaginary parts of this function are
\begin{align*} u(x) \amp= e^{\alpha x} \cos (\beta x) \\ v(x) \amp= e^{\alpha x} \sin (\beta x) \end{align*}
which, by the previous theorem, we know are also solutions. These are two solutions to our original differential equation that are also real-valued!
On the other hand, assume that we take the other complex solution, which will be
\begin{equation*} y_2(x) = e^{(\alpha - i\beta) x}\text{.} \end{equation*}
If we split this into real and imaginary parts, we will get
\begin{equation*} y_2 = e^{\alpha x} \cos (\beta x) - i e^{\alpha x} \sin (\beta x)\text{,} \end{equation*}
so that the real and imaginary parts of this solution are
\begin{align*} u_2(x) \amp = e^{\alpha x} \cos (\beta x) \\ v_2(x) \amp = -e^{\alpha x} \sin (\beta x)\text{.} \end{align*}
These are exactly the same as the previous real and imaginary parts, up to the minus sign on \(v_2\text{.}\) Since we are going to incorporate these with constants \(C_1\) and \(C_2\) eventually, they will give rise to the same general solution. So, we only need one of these two complex solutions to generate our two linearly independent real-valued solutions, and either of the two complex solutions give the same pair of real-valued solutions.

Checkpoint 2.2.6.

For \(\beta \neq 0\text{,}\) check that \(e^{\alpha x} \cos (\beta x)\) and \(e^{\alpha x} \sin (\beta x)\) are linearly independent.
Answer.
With that fact, we have the following theorem.

Example 2.2.8.

Find the general solution of \(y'' + k^2 y = 0\text{,}\) for a constant \(k > 0\text{.}\)
Solution.
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
\begin{equation*} y = C_1 \cos (kx) + C_2 \sin (kx) . \end{equation*}

Example 2.2.9.

Find the solution of \(y'' - 6 y' + 13 y = 0\text{,}\) \(y(0) = 0\text{,}\) \(y'(0) = 10\text{.}\)
Solution.
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
\begin{equation*} y = C_1 e^{3x} \cos (2x) + C_2 e^{3x} \sin (2x) . \end{equation*}
To find the solution satisfying the initial conditions, we first plug in zero to get
\begin{equation*} 0 = y(0) = C_1 e^{0} \cos 0 + C_2 e^{0} \sin 0 = C_1 . \end{equation*}
Hence, \(C_1 = 0\) and \(y = C_2 e^{3x} \sin (2x)\text{.}\) We differentiate,
\begin{equation*} y' = 3C_2 e^{3x} \sin (2x) + 2C_2 e^{3x} \cos (2x) . \end{equation*}
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
\begin{equation*} y = 5 e^{3x} \sin (2x) . \end{equation*}
In this previous example, we can get a fairly good idea of how to sketch out the graph of this function. Since \(\sin(2x)\) oscillates between \(-1\) and \(1\text{,}\) the graph of \(y = 5e^{3x}\sin(2x)\) will oscillate between the graphs of \(5e^{3x}\) and \(-5e^{3x}\text{.}\) These curves that surround the graph of the solution are called envelope curves for the solution. In Figure 2.2.10, this phenomenon is illustrated for the function \(y = 2e^x\sin(5x)\text{.}\)
ALT TEXT HERE
IMAGE DESCRIPTION HERE
Figure 2.2.10. Plot of the function \(y=2e^x \sin(5x)\) with envelope curves.
This is simple when there is only one term in the function we want to draw. When both sine and cosine terms appear, this can get more tricky, but we can still work it out. In the more general case, the solution will look something like
\begin{equation*} y = Ae^{\alpha x}\cos(\beta x) + B e^{\alpha x} \sin(\beta x). \end{equation*}
We can first factor out an \(e^{\alpha x}\text{,}\) and then we want to write \(A \cos(\beta x) + B \sin(\beta x)\) as a single trigonometric function. The identity we want to use here is the trigonometric identity
\begin{equation*} \cos(\beta x - \delta) = \cos(\delta) \cos(\beta x) + \sin(\delta) \sin(\beta x). \end{equation*}
If there is an angle \(\delta\) so that \(A = \cos(\delta)\) and \(B = \sin(\delta)\text{,}\) then we could write
\begin{equation*} A \cos(\beta x) + B \sin(\beta x) = \cos(\beta x - \delta) \end{equation*}
and we would be done. However, this does not always happen; the main issue being that \(\cos^2(\delta) + \sin^2(\delta) = 1\) for all \(\delta\text{,}\) but it is not necessarily the case that \(A^2 + B^2 = 1\text{.}\) But we can force this last condition. If we define \(R = \sqrt{A^2 + B^2}\text{,}\) then we can rewrite this expression as
\begin{align*} A \cos(\beta x) + B \sin(\beta x) \amp= R \left( \frac{A}{\sqrt{A^2 + B^2}} \cos(\beta x) + \frac{B}{\sqrt{A^2 + B^2}}\sin(\beta x)\right) \\ \amp= R \left( \cos(\delta) \cos(\beta x) + \sin(\delta) \sin(\beta x) \right) \\ \amp= R \cos(\beta x - \delta) \end{align*}
where \(\delta\) is the angle so that
\begin{equation*} \cos(\delta) = \frac{A}{R} \qquad \sin(\delta) = \frac{B}{R} \end{equation*}
and such an angle will always exist. Therefore, we can represent the original solution
\begin{equation*} y = Ae^{\alpha x}\cos(\beta x) + B e^{\alpha x} \sin(\beta x) \end{equation*}
as
\begin{equation*} y = Re^{\alpha x}\cos(\beta x - \delta) \end{equation*}
where
\begin{equation*} R = \sqrt{A^2 + B^2} \qquad \cos(\delta) = \frac{A}{R} \qquad \sin(\delta) = \frac{B}{R}. \end{equation*}
Therefore, the envelope curves for this solution will be
\begin{equation*} y = \pm Re^{\alpha x}. \end{equation*}
Note that in order to determine these envelope curves, you do not need to determine the \(\delta\) value in the representation of the solution. All you need is the value of \(R\text{,}\) which can be computed as \(\sqrt{A^2 + B^2}\) where \(A\) and \(B\) are the coefficients of the sine and cosine terms in the solution.

Example 2.2.11.

Find the solution to the initial value problem
\begin{equation*} y'' + 2y' + 5y = 0 \qquad y(0) = 1,\ y'(0) = 5. \end{equation*}
Determine a value \(T\) where the solution \(y(x)\) satisfies \(|y(x)| < 0.1\) for all \(x > T\text{.}\)
Solution.
We solve the initial value problem by normal techniques from this section. The characteristic equation is \(r^2 + 2r + 5 = 0\text{,}\) which has roots \(r = -1 \pm 2i\text{.}\) Therefore, the general solution of the differential equation is
\begin{equation*} y = C_1e^{-x}\cos(2x) + C_2 e^{-x}\sin(2x). \end{equation*}
Plugging in \(0\) gives that \(y(0) = 1 = C_1\text{,}\) and the derivative of this general solution is
\begin{equation*} y' = -C_1e^{-x}\cos(2x) -2C_1e^{-x}\sin(2x) - C_2e^{-x}\sin(2x) + 2C_2e^{-x}\cos(2x). \end{equation*}
Plugging in \(0\) here gives
\begin{equation*} y'(0) = -C_1 + 2C_2. \end{equation*}
Since \(C_1 = 1\text{,}\) this gives that \(C_2 = 3\text{.}\) So, our solution is
\begin{equation*} y(x) = e^{-x}\cos(2x) + 3e^{-x}\sin(2x). \end{equation*}
Through the work above, we can find \(R = \sqrt{1 + 9} = \sqrt{10}\text{.}\) Therefore, the envelope curves for the solution are
\begin{equation*} \pm \sqrt{10}e^{-x}. \end{equation*}
In order to find this threshold \(T\) where the solution will stay within \(0.1\) of zero, we need to figure out when this envelope curves get to the \(0.1\) threshold. Once the envelope curves get to that level, we know that the full solution must be trapped there as well. We can solve
\begin{equation*} 0.1 = \sqrt{10}e^{-T} \qquad T = - \ln\left(\frac{0.1}{\sqrt{10}}\right) \approx 3.454. \end{equation*}
So, for all values of \(x\) larger than 3.454, the solution will be within \(0.1\) of zero. This is illustrated in Figure 2.2.12. Note that we did not find the best value \(T\) here, as it probably could be made smaller using the actual solution. The issue here is that because the solution is oscillating, it may end up staying inside the \(0.1\) cutoff before that value of time, but this is the lowest value of \(T\) that we can prove and validate using envelope curves.
ALT TEXT HERE
IMAGE DESCRIPTION HERE
Figure 2.2.12. Plot of the function \(e^{-x}\cos(2x) + 3e^{-x}\sin(2x)\) with envelope curves illustrating the bounds on the function for large values of \(x\text{.}\)

Exercises Exercises

1.

Write \(3 \cos(2x) + 3\sin(2x)\) in the form \(R \cos(\beta x - \delta)\text{.}\)
Answer.
\(3\sqrt{2}\cos\left(2x - \frac{\pi}{4}\right)\)

2.

Write \(2 \cos(3x) + \sin(3x)\) in the form \(R \cos(\beta x - \delta)\text{.}\)
Answer.
\(\sqrt{5}\cos(3x - \tan^{-1}(1/2))\)

3.

Write \(3 \cos(x) - 4\sin(x)\) in the form \(R \cos(\beta x - \delta)\text{.}\)
Answer.
\(5\cos(x - \tan^{-1}(-4/3))\)

4.

Show that \(e^{2x}\cos(x)\) and \(e^{2x}\sin(x)\) are linearly independent.
Answer.
Ratio is non-constant.

5.

Find the general solution of \(2y'' + 50y = 0\text{.}\)
Answer.
\(C_1\cos(5t) + C_2\sin(5t)\)

6.

Find the general solution of \(y'' - 6 y' + 13 y = 0\text{.}\)
Answer.
\(C_1e^{3t}\cos(2t) + C_2e^{3t}\sin(2t)\)

7.

Find the solution to \(y'' - 2y' + 5y = 0\) with \(y(0) = 3\) and \(y'(0) = 2\text{.}\)
Answer.
\(y = 3e^t\cos(2t) - \frac{1}{2}e^t\sin(2t)\)

8.

Find the general solution of \(y'' + 2y' - 3y = 0\text{.}\)
Answer.
\(C_1e^{-3t} + C_2e^t\)

9.

Find the solution to \(2y''+y'+y=0\text{,}\) \(y(0) = 1\text{,}\) \(y'(0)=-2\text{.}\)
Answer.
\(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)\)

10.

Find the solution to \(z''(t) = -2z'(t)-2z(t)\text{,}\) \(z(0) = 2\text{,}\) \(z'(0)= -2\text{.}\)
Answer.
\(z(t) = 2e^{-t} \cos(t)\)

11.

Let us revisit the Cauchy-Euler equations of Exercise Group 24–25. 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{.}\)
Answer.
\(y = x^{\frac{a-b}{2a}}\left( C_1\cos\left( \frac{\sqrt{4ac-(b-a)^2}}{2a} \ln(|x|) \right) + C_2\sin\left( \frac{\sqrt{4ac-(b-a)^2}}{2a} \ln(|x|) \right) \right)\)

12.

Construct an equation such that \(y = C_1 e^{-2x} \cos(3x) + C_2 e^{-2x} \sin(3x)\) is the general solution.
Answer.
\(y'' + 4y' + 13y = 0\)

13.

Find a second order, constant coefficient differential equation with general solution given by \(y(t) = C_1e^{x} \cos(2x) + C_2e^{2x}\sin(x)\) or explain why there is no such thing.
Answer.
There is no such equation. The two roots will always be complex conjugates, which means the exponential parts will match, and the trigonometric functions will have the same argument.

14.

Find a second order, constant coefficient differential equation with general solution given by \(y(t) = C_1e^{x} \cos(2x) + C_2e^{x}\sin(2x)\) or explain why there is no such thing.
Answer.
\(y'' -2y' + 5y = 0\)

15.

Find the solution to the initial value problem
\begin{equation*} y'' + 4y' + 5y = 0 \qquad y(0) = 3,\ y'(0) = -1. \end{equation*}
Determine a value \(T\) so that \(|y(x)| < 0.02\) for all \(x > T\text{.}\)
Answer.
\(y = 3e^{-2t}\cos(t) + 5e^{-2t}\sin(t)\text{,}\) \(T \approx 2.838\)

16.

Find the solution to the initial value problem
\begin{equation*} y'' + 6y' + 13y = 0 \qquad y(0) = 4,\ y'(0) = 7. \end{equation*}
Determine a value \(T\) so that \(|y(x)| < 0.01\) for all \(x > T\text{.}\)
Answer.
\(y = 4e^{-3t}\cos(2t) + \frac{19}{2}e^{-3t}\sin(2t)\text{,}\) \(T \approx 2.313\text{.}\)