Lecture 10

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

10 Complex numbers.

Solving second order linear ODE with con-


stant coefficients
This lecture opens the second part of our course. From now on the main object of the study will be the
linear ODE. And even not simply linear, but linear ODE with constant coefficients. In these lectures
I will use t to denote the independent variable (it is often useful to think about it as a time variable)
and y = y(t) for the dependent variable, the unknown function which we will need to determine.
But before embarking on dealing with ODE, let me briefly review the necessary material about
the complex numbers, which will be of great help to us during the rest of the course.

10.1 Complex numbers


Complex numbers are defined as
z = x + i y,
where x and y are real numbers, and i is the imaginary unit that has the characteristic property
i2 = −1 (engineers usually use for the same purpose the letter “j” but we will stick to the mathematical
notation). In other words, a complex number is defined if there is a pair of real numbers (x, y). x is
called the real part of the complex number, x = Re z, and y is called the imaginary part of z, y = Im z.
We have hence z = Re z + i Im z. The set of complex numbers is denoted as C. Note that R ⊂ C,
since any real number x ∈ R can be written as x = x + i · 0 (for a slight confusion: this sentence is
not exactly true, but these subtleties will not concern us here).
Two complex numbers z1 and z2 are the same if Re z1 = Re z2 and Im z1 = Im z2 :

z1 = z2 ⇔ Re z1 = Re z2 and Im z1 = Im z2 .

Since any complex number is actually a pair of real numbers, it is convenient to represent complex
numbers as points on the plane or vectors on the plane, with the beginning at the origin (see Fig. 1).
According to the general terminology in this case R2 is called the complex plane, x-axis is called the
real axis and y-axis is called the imaginary axis.
y

Im z z

θ
x
0 Re z

Figure 1: Geometric interpretation of complex numbers. θ is the angle between vector z and x-axis;
ρ is the length of the same vector: ρ = |z|.
MATH266: Intro to ODE by Artem Novozhilov, e-mail: [email protected]. Spring 2024

1
I said that a complex number is the same as a pair of two real numbers. This is not exactly so,
because we additionally need the rules for the arithmetic operations. The four arithmetic operations
are defined for complex numbers similarly to the usual arithmetic operations for real numbers; in these
definitions below we use i as a number that is subject to the same arithmetic rules as usual numbers
modulo the key property that i2 = −1.
Let z1 = x1 + iy1 and z2 = x2 + iy2 . Then

z1 + z2 = x1 + iy1 + x2 + iy2 = (x1 + x2 ) + i(y1 + y2 ),


z1 − z2 = x1 + iy1 − x2 − iy2 = (x1 − x2 ) + i(y1 − y2 ),
z1 · z2 = (x1 + iy1 )(x2 + iy2 ) = (x1 x2 − y1 y2 ) + i(x1 y2 + x2 y1 ).

Before defining the division of two complex numbers we define the complex conjugate. For any complex
number z = x + iy its complex conjugate (or simply conjugate) is the number z := x − iy. Using the
definition for the product of two complex numbers, we have

zz = x2 + y 2 ≥ 0 and zz = 0 ⇔ z = 0.

If you look at Fig. 1, you will see that actually x2 + y 2 gives the square of the length of the vector z,
hence we can define the modulus of a complex number z as the length of the corresponding vector on
the plane:
|z|2 = x2 + y 2 = zz.
Now, if we need to divide z2 by z1 6= 0 + i · 0, we can do the following
z2 z2 z 1 z1 z 1 x1 x2 + y 1 y 2 x1 y 2 − x2 y 1
= = = +i .
z1 z1 z 1 |z1 |2 x21 + y12 x21 + y12

Thus defined the four arithmetic operations possess all the usual properties (commutativity, dis-
tributivity, associativity) that we so get used to while dealing with the usual real numbers. In mathe-
matical terms, it means that the set of complex numbers C forms a field. Here are a few exercises to
practice working with the complex numbers:

• Show that  
z1 z1
z1 ± z2 = z 1 ± z 2 ; z1 z2 = z 1 z 2 ; = .
z2 z2

• Find all complex numbers that solve the equation

z = z2.

Trigonometric form of the complex number. In Fig. 1 you can see that the point z can be
defined as either z = x + iy, where x = Re z and y = Im z are its Cartesian coordinates, or using the
polar coordinates θ (polar angle) and ρ (distance from the origin). We have

ρ cos θ = x, ρ sin θ = y,

from where p
ρ = |z| = x2 + y 2 ,

2
and
x y
cos θ = p , sin θ = p .
x2 + y2 x2 + y2
Hence any complex number can be written as

z = x + iy = ρ(cos θ + i sin θ).

ρ = |z| is the modulus of the complex number and θ (defined up to 2πk additive constant, k ∈ Z) is
the argument of z:
ρ = |z|, θ = arg z.
Argument of a complex number is not defined uniquely, and it is convenient also to have the principal
value of the polar angle, which is denoted Arg z and satisfies 0 ≤ Arg z < 2π (or, sometimes, −π <
Arg z ≤ π).
Convince yourself that
π √ π
|i| = 1, Arg i = , |1 + i| = 2, Arg(1 + i) = .
2 4
The expression
z = ρ(cos θ + i sin θ)
is the trigonometric form of the complex number z. Using this form it is possible (do it!) to show that
if we are given two complex numbers z1 and z2 then their product has the modulus equal to |z1 ||z2 |
and argument θ1 + θ2 .

Euler’s formula. For any complex z it is true that

eiz = cos z + i sin z.

The last equality is called Euler’s formula (we already mentioned this name in Lecture 9), but to
fully appreciate it we would need to discuss what the function of the complex argument is, and this
is beyond the scope of the course. Instead, we will talk about a particular case, which is true for any
x ∈ R:
eix = cos x + i sin x.
To get an idea where this remarkable identity is coming from, recall that functions ex , cos x, sin x have
Taylor’s series around zero absolutely convergent for any x ∈ R:

x2 x3 X xk
ex = 1 + x + + + ... = ,
2! 3! k!
k=0

x2 x4 X x2k
cos x = 1 − + − ... = (−1)k ,
2! 4! (2k)!
k=0

x3 x5 X x2k−1
sin x = x − + − ... = (−1)k−1 .
3! 5! (2k − 1)!
k=1

Now plug ix instead of x into the series for the exponent function, use the property that ı2 = −1, i3 =
−i, i4 = 1, . . ., rearrange the series and obtain Euler’s formula.

3
Using Euler’s formula we can write any complex number in the exponential form as

z = x + iy = ρ(cos θ + i sin θ) = ρeiθ .

Using Euler’s formula we also can express usual cos and sin functions through the exponent:

eix + e−ix eix − e−ix


cos x = , sin x = .
2 2i
The exponential form of the complex number lets us obtain a number of results. For instance,

z n = (ρeiθ )n = ρn einθ = ρn (cos nθ + i sin nθ),

which is called de Moivre’s formula (after Abraham de Moivre, 1667–1754, French mathematician) if
ρ = 1:
(cos θ + i sin θ)n = (cos nθ + i sin nθ).

Example 1. What is (1 + i)6 ? We can, of course, multiply the factor (1 + i) six times (or use the
binomial theorem). However, a better approach would be to consider
√ iπ √ 3π
1+i= 2e 4 =⇒ (1 + i)6 = ( 2)6 ei 2 = −8i.

For an arbitrary z = x + iy we have

ex+iy = ex eiy = ex (cos y + i sin y).

Hence we have
Re ez = ex cos y, Im ez = ex sin y.
Conversely, the sine and cosine functions can be expressed through the complex exponentials. For
example, for sine we have
sin x = Im eix ,
or, sometimes more convenient,
eix − e−ix
sin x = .
2i
You should write the corresponding formulas for cosine.

Example 2. Find the formula for cos3 x. We can use

eix + e−ix
cos x = ,
2
therefore
1 1
cos3 x = (eix + e−ix )3 = (e3ix + 3eix + 3e−ix + e−3ix ),
8 8
which can be rewritten as
1 3
cos3 x = cos 3x + cos x.
4 4
You should do the same calculations for sin3 x.

4
The complex numbers appeared while solving polynomial equations. Consider a polynomial Pn (z)
of complex variable z with complex coefficients:

Pn (z) = z n + c1 z n−1 + c2 z n−2 + . . . + cn−1 z + cn ,

where cj ∈ C. Any number ẑ ∈ C such that Pn (ẑ) = 0 is called a root of Pn (z). The most important
fact here is called the fundamental theorem of algebra:
Theorem 3. Any nonconstant complex polynomial of degree n has exactly n complex roots if the roots
are counted according to their multiplicities.
We will discuss what “multiplicity” of a root means later, for now let me illustrate this theorem
with an example.
The theorem implies, e.g., that the quadratic equation

x2 + 1 = 0,

which is usually said not to possess real roots (indeed, there are no such x ∈ R that x2 + 1 = 0), has
perfectly fine two complex roots:
x̂1,2 = ±i.
Example 4. Find the roots of
x3 + 1 = 0.
Clearly, one obvious (and real) root is x̂1 = −1, but the fundamental theorem of algebra says that
there should be two more (potentially complex) roots. To find them let me rewrite constant −1 in the
exponential form:
−1 = 1 · eiπ = ei(π+2πk) , k = 0, ±1, ±2, ±3, . . .
I look for a solution in the form x = ρeiθ , and hence

(ρeiθ )3 = ρ3 e3iθ = ei(π+2πk) ,

which implies that


ρ3 = 1 =⇒ ρ = 1,
and
π 2πk
θ= + , k = 0, ±1, ±2, . . . ,
3 3
so technically I found infinitely many roots! Note, however, that the argument of complex number is
not defined uniquely, only up to 2πk constant, and if I consider the cases k = 0, 1, 2, 3 I get
π 5π 7π π
θ0 = , θ1 = π, θ2 = , θ3 = = + 2π ,
3 3 3 3
but the last argument is the same as π/3 hence my formula gives only 3 distinct roots, as was expected
(check some other values of k). Finally I conclude that my roots are
√ √
i π3 1 3 iπ i 5π 1 3
x̂0 = e = + i , x̂1 = e = −1, x̂2 = e 3 = − i .
2 2 2 2
You can check that these are indeed the roots by plugging them into the equation and simplifying.
Q: Can you now solve x4 + 1 = 0?

5
10.2 Solving homogeneous second order linear ordinary differential equation with
constant coefficients
I start with the general definition.
Definition 5. Linear ordinary differential equation of the n-th order is

y (n) + an−1 (t)y (n−1) + . . . + a2 (t)y ′′ + a1 (t)y ′ + a0 y = f (t), (1)

where
an−1 (t), an−2 (t), . . . , a1 (t), a0 (t), f (t)
are given functions.
The general solution to (1) depends on n arbitrary constants, and if we need to identify a unique
particular solution, we will need n initial conditions of the form

y(t0 ) = y0 , y ′ (t0 ) = y1 , . . . , y (n−1) (t0 ) = yn−1 .

Equation (1) is called homogeneous if f (t) ≡ 0, otherwise it is non-homogeneous (or inhomogeneous).


If all ai (t), i = 0, . . . , n − 1 are constants, then equation (1) is called linear ODE with constant
coefficients. This is one of the few classes of ODE for which an exhaustive theory exists. Now we
switch from the general definitions to the most important particular case.
We study here ODE of the form (and I do not want to write again the full title of this equation)

y ′′ + a1 y ′ + a0 y = 0,

or, choosing other letters for a1 , a0 ,

y ′′ + py ′ + qy = 0, p, q ∈ R. (2)

Before solving (2), consider the first order homogeneous linear ODE with constant coefficient:

y ′ − λy = 0, λ ∈ R.

(I choose “−” for the consistence with the following discussion). We know that its solution is given
by
y(t) = Ceλt .
It turns out that exponents play an extremely important role in solving general linear equations with
constant coefficients of an arbitrary order. To see this let me rewrite equation (2) in the form

(D 2 + pD + q)y = 0,

where I denote by D the derivative with respect to t. The expression D 2 + pD + q is a quadratic


polynomial with respect to variable D and hence can be factored as D 2 + pD + q = (D − λ1 )(D − λ2 ),
where λ1,2 are the roots. Each factor corresponds to the first order ODE y ′ − λ1,2 y = 0, and hence it
is reasonable to predict that my equation will have exponential solutions.
For the moment let me assume that the general solution to (2) has the form (this of course must
be justified)
y(t) = C1 y1 (t) + C2 y2 (t),

6
where y1 (t) and y2 (t) are such that one is not a multiple of another one (the exact mathematical term
is that y1 (t) and y2 (t) are linearly independent), and look for a solution in the form y(t) = eλt , where
λ is some constant to be determined. By plugging this expression into our equation:

λ2 eλt + pλeλt + qeλt = 0 =⇒ λ2 + pλ + q = 0

we find the equation for the unknown λ. This equation is called the characteristic equation.

How to solve quadratic equations. The characteristic equation for (2) is a quadratic equation.
I remind you that it usually has two roots that can be found as

−p ± ∆
λ1,2 = , ∆ = p2 − 4q,
2
where ∆ is called the discriminant. In general, if ∆ > 0, then we have two real roots λ1 ∈ R 6= λ2 ∈ R.
If ∆ = 0 then there is one real root λ ∈ R of multiplicity 2, finally, if ∆ < 0 then we obtain two
complex solutions λ1 ∈ C 6= λ2 ∈ C such that λ1 = λ2 , where the bar means complex conjugate
(this is only true for the quadratic equations with real coefficients p ∈ R, q ∈ R). Very often Vieta’s
formulas are useful, that say that

λ1 + λ2 = −p, λ1 λ2 = q.

(Q: Can you prove these formulas?) And final note here is that if the quadratic equation λ2 +pλ+q = 0
has roots λ1 and λ2 (note that I include the case λ1 = λ2 ) then λ2 + pλ + q = (λ − λ1 )(λ − λ2 ).

Now consider some examples.

Example 6. Solve
y ′′ − 4y ′ − 12y = 0.
The characteristic equation is
λ2 − 4λ − 12 = 0,
which has the roots λ1 = 6, λ = −2, hence the general solution is

y(t) = C1 e6t + C2 e−2t .

Note that the function y(t) = 0 is a solution to our equation (as well as to any other linear
homogeneous equation). This solution is called the trivial solution and can be obtained from the
general solution for C1 = C2 = 0. Similar to the equilibria for the autonomous equations we can talk
about the stability of the trivial solution. More specifically, we say that this solution is stable if any
solution that starts close to it stays close to it for all the future times; asymptotically stable is any
solution that starts close to it tends to it as t → ∞; and finally unstable if there is a solution that
starts close to the trivial one and moves away from it with time.
Since λ1 = 6 > 0 in this example then e6t → ∞ when t → ∞, hence the trivial solution in this
particular case is unstable.
Q : Can you think of a sufficient condition that guarantees the asymptotic stability of the trivial
solution?

7
Example 7. Solve
y ′′ + 2y ′ + 8y = 0.
The characteristic equation is
λ2 + 2λ + 8 = 0,
and has the roots √
λ1,2 = −1 ± i 7,
where i is the imaginary unit with the characteristic property i2 = −1.
Hence the general solution is
√ √
y(t) = C1 e(−1+i 7)t
+ C2 e(−1−i 7)t
.

This solution is perfectly fine, and actually C1 and C2 are arbitrary complex constants here. However,
since our original equation has the real coefficients then it would be important to try to obtain real
valued solutions. For this Euler’s formula is very important: For any x ∈ R

eix = cos x + i sin x.

The second ingredient to figure out the real valued solutions is to note that if z(t) ∈ C for a fixed t is
a complex valued function of the real argument t that solves our equation, then its real and imaginary
parts are also solutions (in this case real valued). Recall that if z(t) = u(t) + iv(t), then u(t) is
called the real part of z(t) and denoted u(t) = Re z(t), and v(t) is called the imaginary part of z(t),
v(t) = Im z(t). To see that u(t) and v(t) are the solutions, plug z(t) = u(t) + iv(t) into the equation
and remember that differentiating complex valued functions satisfies the same rules as differentiating
real valued functions. √ √ √ √
So, one of our solutions is z(t) = e(−1+i 7)t = e−t ei 7t = e−t (cos 7t + i sin 7t). We therefore
have √ √
Re z(t) = e−t cos 7t = y1 (t), Im z(t) = e−t sin 7t = y2 (t).
Now both y1 (t) and y2 (t) are real valued and not multiple of one another, therefore, we can present
the general solution to our equation as
√ √ √ √
y(t) = C1 e−t cos 7t + C2 e−t sin 7t = e−t (C1 cos 7t + C2 sin 7t).

I hope it is clear that the trivial solution in this example is asymptotically stable.
In general, if two roots of the characteristic equation are complex conjugate:

λ1,2 = α ± iβ,

then the general real-valued solution can be written as

y(t) = eαt (C1 cos βt + C2 sin βt).

Q: What are the necessary and sufficient conditions for α and β so that the trivial solution would
be asymptotically stable?

8
Example 8. Solve
y ′′ + 4y ′ + 4y = 0.
The characteristic equation is
λ2 + 4λ + 4 = 0
and has the root λ = −2 multiplicity two. This means that we have y1 (t) = e−2t but missing the
second linearly independent solution. To determine it, let us look for a solution to our equation in the
form y2 (t) = u(t)y1 (t) = u(t)e−2t where u(t) is an unknown function. We get

y2′ (t) = u′ (t)e−2t − 2u(t)e−2t , y2′′ (t) = u′′ (t)e−2t − 4u′ (t)e−2t + 4u(t)e−2t .

After plugging this into the equation and canceling we obtain

u′′ (t) − 4u′ (t) + 4u(t) + 4u′ (t) − 8u(t) + 4u(t) = u′′ (t) = 0 =⇒ u(t) = At + B,

where A, B are arbitrary constants. This means that any function of the form (At + B)e−2t is also a
solution to our ODE. To guarantee the linear independence, we can choose y2 (t) = te−2t . Therefore,
the general solution is
y(t) = C1 e−2t + C2 te−2t = e−2t (C1 + C2 t).
Despite that fact that in this example one of the solutions has the form te−2t , it is still asymptotically
stable since, using, e.g., l’Hôpital’s law (fill in the missed details),

lim te−2t = 0.
t→∞

In general, if the characteristic equation has the root of multiplicity two, λ = λ1 , then the general
solution to the ODE is
y(t) = eλ1 t (C1 + C2 t).

You might also like