MAT1332 Notes
MAT1332 Notes
MAT1332 Notes
1 Review of integrals
1.1 Power rule
xn+1
Z
xn dx = + c if n 6= −1
n+1
Example 1.
Z
t3 dt =
Example 2.
Z
y −3 dy =
Logarithms: Z
1
dx = ln |x| + c
x
Trigonometric functions:
Z
sin xdx = − cos x + c
Z
cos xdx = sin x + c
Example 3. Z
1
dy = arctan y + c
1 + y2
Hint:
arctan (tan x) = x
1
1.3 Substitution
d
f (g(x)) = f 0 (g(x))g 0 (x)
dx Z
f (g(x)) = f 0 (g(x))g 0 (x)dx
substitute u = g(x)
du
= g 0 (x)
dx
du
dx = 0
g (x)
Z
du
then f (g(x)) = f 0 (u)g 0 (x) 0
g (x)
Z
= f 0 (u)du
3x2 sin x3 dx
R
Example 4.
2
1.4 Integration by Parts
Z Z
0
uv = uv − u0 v
R
Example 5. x · cos xdx
Example 6. Z
1 1
( 2
+ )dx
x x
R R
Integrals preserve constant products: af (x)dx = a f (x)dx
Example 7.
Z
6x−1 dx =
2
3xex dx
R
Example 8.
2 2
Try moving the constant outside: 3xex dx = 3 xex dx, which is not very helpful.
R R
3
Try substitution:
Z
(5x4 − 2x3 + 3)dx =
R (t+3)2
Exercise: t dt
x3 ex dx
R
Exercise: R
Exercise: R ln xdx
Exercise: R x ln xdx
Exercise: x sin x cos xdx
ex cos xdx
R
Exercise:
4
2 Integrals
Z b n−1
X
Definition 2.1. The integral is defined as f (t)dt = lim f (ti )∆t where the values t0 , ..., tn break the
a n→∞
i=1
b−a
interval from a to b into n pieces, each of width ∆t = n .
1 1 1 8
Area u (1)3 + (1.33)3 + (1.67)3 = = 2.667
3 3 3 3
5
3 Definite and Indefinite Integrals
dF
Theorem
R 3.1. (The Fundamental Theorem of Calculus) Suppose dt = f (t). The indefinite integral is
f (t)dt = F (t) + c.
The definite integral is
Z b
f (t)dt = [F (t) + c]evaluated at b − [F (t) + c]evaluated at a
a
= (F (b) + c) − (F (a) + c) = F (b) − F (a).
Example 11. Z 2
x3 dx
1
Example 12. Z π
sin xdx
0
Exercise: Show that cos x and sin x have the same area for one whole period.
6
Example 13. A rock is hurled down from a building 100 m high with initial speed of 5 m/s. How far
will it fall during the first second?
Exercise: How far will it fall in 4 seconds? How far in 5 seconds? (Be careful)
Example 14. A fish grows at rate dL −0.5t where t is time in years and L is length in centimetres.
dt = 3e
How much does it grow between the ages of 3 and 6?
7
Exercise: How much does it grow before age 3?
Example 15. The rate at which you learn math is dC 2 −t where C is a measure of comprehension
dt = 50t e
and t is time in weeks. How much will you learn in 1 week, 6 weeks, 13 weeks?
General solution:
In one week:
8
In 6 weeks:
In 13 weeks:
9
4 Applications of integrals
Definition 4.1. A definite integral is an area under the curve between the limits.
Example 16. Find the area under the line f (x) = 2x between 0 and 3.
Example 17. Find the area under the curve f (x) = sin x between π and 2π.
10
Example 18. Find the total shaded area for one period of sin x.
R1
Example 19. Find 2 4x3 dx.
11
The answer will be negative if the limits are in the wrong order; that is, the area is positive if the curve
is above the x-axis and the limits go from left to right.
In particular
Z a Z b
f (t)dt = − f (t)dt
b a
R1
Example 20. 0 (5 − 2t − t2 )(1 + t)dt. We can try three methods: Substitution, multiplying out and
integration by parts.
Try Substitution:
12
Method 2: Change limits for new variable
13
Either of these methods are fine, but you have to do one of them. Do not put the original limits in the
answer for the new variable.
Exercise: Try multiplying out and integration by parts.
1
Rb
In general, the average value of f = b−a a f (x)dx.
The area under the average (between a and b) is equal
to the area under the curve (between a and b).
14
Example 22. In its first decade, the number of AIDS cases in the U.S. followed the formula dA
dt = 523.8t
2
where t is the time in years. How many people, on average, were infected each day during this decade?
15
5 Volumes of Revolution
If we rotate an area under a function around the x-axis, it forms a 3-dimensional solid, called a volume of revolution.
Δx
Example 23. Find the volume of the solid of revolution generated by rotating the region under the
√
graph of y = x from x=0 to x=1 about the x-axis.
16
Example 24. Find the volume of the solid of revolution generated by rotating the region under y = ex
from x=-1 to x=2 about the x-axis.
Example 25. Find the volume of the solid of revolution generated by rotating the first loop of y = sin x
about the x-axis.
17
Exercise: The region between y = −x2 + 6 and y = 2 is rotated around the x-axis. Find the volume.
Exercise: Find the volume of the solid generated by rotating the positive part of 2x − x2 around the
x-axis.
Answer: 16π
15 = 3.35
18
6 Partial Fractions
First introductory example
R x
We don’t know how to integrate the fraction x+2 dx, but we can write the fraction in a simpler way and
use known rules to find the integral as follows:
Z
(x + 2) − 2
Z Z
x 2
dx = dx = 1− dx = x − 2 ln |x + 2| + C.
x+2 x+2 x+2
General Idea
Rational functions are fractions of polynomials, i.e., if P (x) and Q(x) are polynomials, then P (x)/Q(x) is
called a rational function. We already know how to integrate some of them, namely the following building
blocks (you need to know these!)
Z
1
dx = ln |x + a| + C,
x+a
Z
1
2
dx = arctan(x) + C = tan−1 (x) + C,
x +1
Z
x 1
dx = ln(x2 + 1) + C.
x2 + 1 2
(You don’t have to memorize the last one; you could use substitution to solve it.)
If we can split a rational function into sums of these building blocks, then we can integrate easily. The
goal of this section is to find a technique to integrate (find antiderivatives of) all rational functions. We only
consider cases where deg(Q) ≤ 2, i.e., the highest power of x in the denominator is no more than 2. The
idea is to decompose a rational function into a sum of simpler rational functions, namely the three examples
above, which we know how to integrate.
19
4. If Q(x) = ax2 + bx + c has no real roots, then complete the square to get
" 2 #
b 2 c
b
Q(x) = a x − + − = a[(x − A)2 + B].
2a a 2a
Then use the natural logarithm and the arctan to integrate the two terms (potentially substitute first).
Example 27.
2x3 + 3x2 + 2x + 4
Z
dx
x2 + 1
Example 28. Z
2x + 1
dx
x2 +x−2
Example 29. Z
x+5
dx
x2 − 4x + 4
20
Example 30. Z
3x + 2
dx
x2 − 2x + 5
Example 31.
x2 − 2
Z
dx
x2 − 3x + 2
21
7 Improper Integrals
Rb
Proper integrals have the form a Rf (x)dx, b < ∞.
∞
Improper integrals have the form a f (x)dx.
Why would we use this? Because infinity is a useful abstraction of “very big” or“very far.”
Example 32. The rate of sales of a new product is dS 400
dt = (t+2)2 where t is the time in weeks and S is
amount in dollars. If the product were on sale forever, how much would it make?
But we didn’t really substitute ∞ into an equation. Instead, we take the limit so this is what we really
do have:
But of course we never really wait forever. What if we waited a really long time, like two years (104
weeks)?
22
R∞ ln t
Example 33. 1 t dt
Try substitution:
23
If an integral is infinite, we say it diverges.
If an integral is finite, we say it converges.
R∞
Example 34. Does 0 e−2t dt converge or diverge?
R∞
Example 35. Does √ x dx converge or diverge?
0 x+2
24
R∞ 1
Example 36. 0 2e2x
dx
25
26
8 Infinite Integrands
R2
We want to find 0 √1x dx. Why is this a problem? Because √1
x
is not defined at 0.
But let’s try to do what we did with improper integrals:
Z 2 Z 2
1 1
√ dx = lim √ dx
0 x →0+ x
Z 2 1
= lim x− 2 dx
→0+
1 2
h i
= lim 2x 2
→0+
√ √
= lim (2 2 − 2 )
→0+
√
=2 2−0
√
= 2 2 = 2.828 where 0+ means the limit from the right.
Therefore, even though the function goes to ∞ at 0, the area is well-defined. (It’s like the improper integral,
only turned sideways.)
R3
Example 38. 0 (−4x−2 − 3x−1 + 1)dx
R1 1
Example 39. 0 1−x dx
27
R3 1
Example 40. −1 − x2 dx
28
9 Differential Equations
Your town is suffering an epidemic. Your chances of catching the disease are proportional to the probability
you meet a carrier of the disease. That is: (probability that you are in a place at a given time) × (probability
that a carrier is also in given place at given time).
• Word problem
• Sharpen up equations
• Initial conditions
• One-variable problem
• Separation of variables
• Solve
• Sketch solution
• Biological interpretation
S - susceptible individuals
I - infected individuals
dS
∝ −SI
dt
dI
∝ SI
dt
S 0 = −βSI
I 0 = βSI
S0 + I 0 = 0
S + I = N (constant)
∴S =N −I
I 0 = β(N − I)I which is a single autonomous differential equation.
Steps:
1. Put state variable on one side and time variable (including dt) on the other.
2. Integrate both sides.
3. Set integrals equal to each other.
4. Combine two integrating constants into one.
29
5. Solve for the state variable (may rewrite the constant in a more convenient form.)
6. Solve for the constant using the intial condition.
Example 41. Let’s fix some parameters: β = 0.02, N = 1000 and the initial condition is I(0) = 3.
Solve for I(t).
30
1000
I
997
3 S
t
Exercise: Check the solution satisfies both I 0 = 0.02(1000 − I)I and I(0) = 3.
Example 42. Suppose dx 2
dt = x + x .
1
a) Set y = x and find a differential equation for y.
b) Solve for x if x(0)=1.
Solution: a)
b)
31
dx x
Example 43. dt = 2x−1 x(0) = 1
x3 −3x
Exercise: Solve x0 = t with x(1) = 2
32
10 Equilibria
What is a derivative? It is a rate of change. The system is at equilibrium if there is no change. That is, the
derivative is zero.
Example 44. dxdt = x + x
2
1 et
We know that x = Ae−t −1
= A−et
x + x2 = 0
x(1 + x) = 0
x = 0, x = −1
A = 0 ⇒ x = −1 always ∴ equilibrium.
A = ∞ ⇒ x = 0 always ∴ equilibrium.
Example 46. x0 = x + x2
33
This is called a phase-line diagram.
dx
Example 47. dt =2−x
Equilibrium : 2 − x = 0 ⇒ x = 2.
34
11 Stability
Definition 11.1. An equilibrium is stable if solutions that begin near the equilibrium approach the equilib-
rium. An equilibrium is unstable if solutions that begin near the equilibrium move away from the equilibrium.
dx
Example 48. dt = x + x2
x = −1 is stable
x = 0 is unstable.
Example 49. dx dt = 3 − x
Equilibrium: 3 − x = 0 ⇒ x = 3
It looks like x = 3 is stable. How can we know for sure?
35
dx
Example 50. dt = 2x2 − 9x + 4. Determine equilibria and their stability.
dy
Stability Theorem Suppose y ∗ is an equilibrium of dt = f (y). Then
y ∗ is stable if f 0 (y ∗ ) < 0
y ∗ is unstable if f 0 (y ∗ ) > 0
dx
Example 51. dt = 2x2 − 9x + 4. Determine all equilibria and their stability.
dx
Example 52. dt = sin x, x > 0. Determine all equilibria and their stability.
Equilibia:
36
Example 53. SIS epidemic. In this disease people get sick as before, but they also recover after a while.
S 0 = αI − βSI
I 0 = βSI − αI
S0 + I 0 = 0 → S + I = N
I 0 = β(N − I)I − αI
In this case we can’t solve as we did before, but we can still discover pertinent information.
Equilibria:
37
Two cases:
(i)βN − α < 0
(ii)βN − α > 0
f (I) = β(N − I)I − αI
= βN I − βI 2 − αI
f 0 (I) = βN − 2βI − α
βN −α
Case(ii) Two equilibria: I=0 and I = β
38
Therefore, if βN − α < 0, ie recovery rate is high or transmission probability is low, then the disease dies
out.
If βN − α > 0, ie recovery rate is low or transmission probability is high, then the disease becomes
established in the population. It doesn’t infect everyone, but a certain proportion of people are always
infected at any given time. Such a disease is called endemic.
39
12 Life-Sciences Examples
12.1 The Logistic Equation
Many populations grow quickly at first but slow their growth when they run out of space. For example,
rabbits on an island.
Unlimited growth can be written as dN
dt = rN ⇒ N = Ae .
rt
dN
Slight limitation on growth dt = rN − bN 2
= rN (1 − rb N )
N r
= rN (1 − K ) K= b (we’ll see why later)
Separation of variables:
dN
N
= rdt
N (1 − K)
1 A B
N
= + N
N (1 − K)
N 1− K
N
1 = A(1 − ) + BN
K
N =0 1=A
1
N =K 1 = BK B=
K
Z ! Z
1 1
+ N
dN = rdt
N K(1 − K )
Z Z
1 1
+ dN = rdt
N K −N
ln N − ln (K − N ) = rt + c
N
ln = rt + c
K −N
N
= Dert
K −N
N = (K − N )Dert
N (1 + Dert ) = KDert
KDert
N=
1 + Dert
40
KD
N (0) = N0 ⇒N0 =
1+D
N0 (1 + D) = KD
N0 + N0 D = KD
N0 = (K − N0 )D
N0
D=
K − N0
KN0 ert
K−N0
N= N0 ert
1 + K−N 0
KN0 ert
=
K − N0 + N0 ert
Kert
= K rt
N0 − 1 + e
K
=
K
N0 − 1 e−rt + 1
0 K
41
12.2 Newton’s Law of Cooling
Newton says that the rate at which heat is lost from an object is proportional to the difference between the
temperature of that object and the ambient temperature.
How can we turn this into a differential equation?
Let H=heat
A=ambient temperature
dH = α (A − H)
dt
|{z}
↑ ↑ -
Rate at is proportional to difference between temperature
which heat and ambient temperature
changes
f (H) = α(A − H)
f 0 (H) = −α
∴ H = A is stable.
i.e. eventually objects will warm up to, or cool down to the ambient temperature in the room.
S 0 = αI − βSI
I 0 = βSI − αI − µI
42
This suggests that eventually I = 0. Is this good?
What else? Answer (for now): Numerics
Eventually the disease dies out but it kills a portion of the population along the way.
S 0 = λ + αI − βSI
I 0 = βSI − αI − µI
S 0 = λ + αI − βSI − γS
I 0 = βSI − αI − µI − γI
Adding together, if µ = 0, we have
S 0 + I 0 = λ − γ(S + I)
N 0 = λ − γN
λ
N→
γ
43
Example 56. Foxes and Rabbits
In the absence of foxes, rabbits grow without bound. In the absence of rabbits, foxes die as there is nothing
to eat.
No eating:
x0 = λx rabbits grow
0
y = −δy foxes die
44
13 Complex Numbers
13.0.1 Introductory consideration
We can easily solve the equation x2 −4 = 0. The answer is x = ±2; in particular,√x is a rational number, even
an integer. The equation x2 − 2 = 0 is a bit more tricky. The solution x = ± 2 is not a rational number.
Instead, we have defined the square root of a positive number as the real number that gives the original
number back when multiplied by itself. But what should we do with the equation x2 + 1 = 0? The answer
cannot be a real number. (Why?) Can we do the same as above and define a number whose square equals
−1? Indeed, this is what mathematicians did in the eighteenth century (it was a daring act and caused a
lot of controversy), and they √
called that number ‘i’ for imaginary. (We will see that complex numbers are
hardly more imaginary than 2.)
13.1 Definition
A complex number z is a number of the form
z = a + bi
with real numbers a, b and the symbol i that satisfies i2 = −1. We call a = Re(z) the real part of z and
b = Im(z) the imaginary part of z. The real number a can be considered the complex number a + 0i. A
complex number of the form z = bi is called purely imaginary.
13.2.1 Examples
1. (3 + 5i) + (2 − 7i) = 5 − 2i
2. (0.5+1.7i)−(0.8−2.6i) =
3. (−3+2i)×(4−5i) =
4. (2−0.5i)×(3+4i) =
5. (9+2i)+5 =
6. −3i+(2+3i) =
7. 2×(3−5i) =
8. 3i×(−1+4i) =
Before we look at inverses and division of complex numbers, we introduce the complex conjugate of a complex
number.
45
13.3 The complex conjugate
The complex conjugate of z = a + bi is z̄ = a − bi, i.e., we simply change the sign of the imaginary part.
Since the multiplication
z z̄ = (a + bi)(a − bi) = a2 + b2
always produces a non-negative real number, we can take the square root. We define the modulus or absolute
value of z = a + bi as √ p
|z| = z z̄ = a2 + b2 .
From the identity z z̄ = |z|2 , we find the inverse of z to be
1
= z −1 = z̄/|z|2 .
z
Example 57. Start with z = 3 + 4i and √ w = 2 − i. The complex conjugates are z̄ = 3 − 4i and w̄ = 2 + i.
The absolute values are |z| = 5 and |w| = 5. The inverses are
z −1 =
w−1 =
z
=
w
w
=
z
Another way to think about this: make the denominator real (similar to the way you’d rationalize
the denominator) by multiplying top and bottom by the conjugate of the denominator (i.e., “real-ize” the
denominator). Thus,
1 1
=
z 3 + 4i
1 3 − 4i
= ·
3 + 4i 3 − 4i
3 − 4i
= 2
3 − (4i)2
3 − 4i
= 2
3 + 42
3 − 4i
=
25
1
Similarly for w:
46
Example 58. Start with z = 1 − 4i and √ w = 0.5 + 3i.
p The complex conjugates are z̄ = 1 + 4i and
w̄ = 0.5 − 3i. The absolute values are |z| = 17 and |w| = 37/4. The inverses are
z −1 =
w−1 =
Division gives
z
=
w
w
=
z
z w
Alternatively, we can “real-ize” the denominator as before. Thus w and z are
47
4
3.5
point (1,2.5)
complex number
3
1+2.5i
2.5
point (−2,2)
complex number
−2+2i
y
1.5
1
point (3,1)
0.5
complex number
3+i
0
−4 −2 0 2 4
x
With this correspondence, the addition of complex numbers becomes the addition of vectors as it is
known from the physics of forces.
6
z+w=3+5i
5
z=1+3i
4
y
2
w=2+2i
0
0 1 2 3 4
x
To interpret multiplication, we take a slightly different point of view. Instead of giving the coordinates
of the vector as the endpoint (a, b), we consider its length r ≥ 0 and the angle φ it makes with the x-axis
(counterclockwise) as (r cos φ, r sin φ). This representation is called polar coordinates.
1.5
0.5
sinφ
0 φ
cosφ
−0.5
−1
−1.5
−2
−2 −1 0 1 2
Then multiplication of two numbers is simply multiplication of the lengths and addition of the angles.
48
4
3.5
zw=rsei(φ+ψ)
3
2.5
y
1.5
w=seiψ
1 φ+ψ z=reiφ
0.5
0
φ ψ
0 0.5 1 1.5 2 2.5 3
x
We write
z = r(cos φ + i sin φ) and w = s(cos ψ + i sin ψ).
Then we multiply, using the trigonometric identities
It might look strange at first, but the same rules as for the real exponential function apply. In fact, if we
denote
then
49
since cos2 φ + sin2 φ = 1. Now integrate:
f 0 (φ)
Z Z
dφ = idφ
f (φ)
ln f (φ) = iφ
f (φ) = eiφ
Example 59.
√
a. The complex number z = 1+i has modulus |z| = 2 and angle φ = π/4. Hence z =
√
b. The complex number w = 3 + i has modulus |w| = 2 and angle φ = π/6.
Hence w = .
c. Their product is zw =
√
d. In general, if z = a + bi then r = |z| = a2 + b2 . The argument φ is not uniquely defined. If we restrict
it between −π and π then we get
φ = arctan(b/a) if a>0
φ = arctan(b/a) + π if a < 0, b > 0
φ = arctan(b/a) − π if a < 0, b < 0
50
14 Linear Algebra
x0 = 2x + y
y 0 = 3x + 4y
x0 = 6x − 5y + 4z − 5
y 0 = 4x − 4y + 3z − 2
z 0 = 6x − 7y + 5z − 3
51
∴ no solution.
−x + 3y − z = −4 R1
3x − 8y + 5z = 14 R2
2x − 6y + 2z = 8 R3
52
14.1 Shorthand notation: Matrices
A matrix is a rectangular array of numbers. We have m rows and n columns, yielding an m x n matrix:
a11 a12 . . . a1n
a21 a22 . . . a2n
A= .
.. ..
.. . .
am1 am2 . . . amn
5x + 6y = 13
x + 2y = 2
x+y+z =6
2x + y − z = −6
3x + 2y − 5z = −35
53
Example 65. Solve
x − y − 2z = 3
−2x − y + z = 4
3x − 3z = −1
54
15 Matrices
Two matrices A and B are equal if and only if all their entries are equal.
A+B =
55
Important: The number of columns of the first matrix must match the number of rows of the second matrix.
Example 70.
NP =
PN =
∴ N P 6= P N ∴ order is important.
Example 71.
1 2 3 10 19 −8
AB = 4 5 6 3 −1 −15
7 8 9 2 −2 0
10 + 6 + 6 19 − 2 − 6 −8 − 30
= 40 + 15 + 12 76 − 5 − 12 −32 − 75
70 + 24 + 18 133 − 8 − 18 −56 − 120
22 11 −38
= 67 59 −107
112 107 −176
15.5 Determinants
a11 a12
If A = then the determinant of A is det(A) = a11 a22 − a12 a21 .
a21 a22
1 2
Example 72. det =
3 4
56
a11 a12a13
If A = a21 a22a23 then det A = a11 a22 a33 +a12 a23 a31 +a13 a21 a32 −a13 a22 a31 −a11 a23 a32 −a12 a21 a33 .
a31 a32a33
(Look at the pattern,
don’t memorise the formula.)
1 2 3
Example 74. Find det 4 5 6.
7 8 9
8 2 0
Example 75. Find det 0 3 5.
−4 1 0
57
16 Inverse of a matrix
Suppose A is an n × n square matrix. If there exists an n × n matrix B such that AB = BA = I, then B is
called the inverse of A and is denoted A−1 .
2 6
Example 77. Find the inverse of .
1 3
a11 a12
Theorem 16.2. If A = and a11 a22 − a12 a21 6= 0 then A is invertible and
a21 a22
−1 1 a22 −a12
A = .
a11 a22 − a12 a21 −a21 a11
58
Note: This only works for 2 x 2 matrices. The denominator is the determinant.
2 5
Exercise: Check this for A = .
1 3
1 −1 −1
Example 78. Find the inverse of 2 −1 1
−1 1 −1
1 2
Example 80. Find the transpose of B = 3 4
5 6
59
16.2 Solving linear equations
2x + 5y = 4
x + 3y = −1
x − y − z = −1
2x − y + z = 2
−x + y − z = 1
60
17 Eigenvalues and Eigenvectors
If A is a square matrix and ~x is a vector, then A~x is also a vector. Could it be possible that A~x is a scalar
multiple of ~x, say λ~x?
If so A~x = λ~x
A~x − λ~x = ~0 (the zero vector)
We can’t factor out ~x because (A − λ)~x makes no sense. (How do you subtract a number from a matrix?)
But I comes to the rescue! Recall, I~x = ~x.
∴ λ~x = λI~x if we want.
A~x − λ~x = ~0
A~x − λI~x = ~0
(A − λI)~x = ~0 this is fine since λI is a square matrix.
λ=4: (A − 4I)~x = ~0
1 2 4 0 x1 0
− =
3 2 0 4 x2 0
−3 2 x1 0
=
3 −2 x2 0
−3x1 + 2x2 = 0
But these two equations are fundamentally the same.
3x1 − 2x2 = 0
61
We are left with one equation and two variables: 3x1 − 2x2 = 0
∴ let x2 = r
2
x1 = r
2 3
x1
= 3 r, r ∈ R, r 6= 0.
x2 1
λ = −1 : (A − (−1)I)~x = ~0
1 − (−1) 2 x1 0
=
3 2 − (−1) x2 0
2 2 x1 0
=
3 3 x2 0
2x1 + 2x2 = 0
⇒ x1 + x2 = 0
3x1 + 3x2 = 0
let x2 = s, x1 = −s
x1 −1
= s, s ∈ R, s 6= 0.
x2 1
Note: It’s crucial to specify that r 6= 0 and s 6= 0, because the cases r = 0 and s = 0 correspond to the
zero vector, which cannot be an eigenvector.
• Control measures aim to reduce λmax below 0. Similar λ’s, different ~x’s
1 4
Example 84. Find the eigenvalues and eigenvectors of B =
1 −2
Eigenvalues:
62
Eigenvectors:
−1 1 8
Example 85. Find the eigenvalues and eigenvectors of C = 5 3 −1
0 0 9
Eigenvalues:
63
Eigenvectors:
64
Exercise. Find the eigenvalues and eigenvectors of
0 −8 6 2 3 5
D = 2 0 4 E = 4 6 10
0 0 −3 0 0 0
65
18 Finding general solutions of linear systems
0
x x
To find the general solution of 0 = J , let’s start with a solution of the following form:
y y
x λt v1
=e
y v2
0
x λt v1
= λe
y0 v2
0
x x
0 =J
y y
λt v1 λt v1
⇒ λe = Je
v2 v2
v v
⇒λ 1 =J 1 .
v2 v2
v
This implies λ is an eigenvalue of J with corresponding eigenvector 1
v2
x v w
The general form for 2 x 2 matrices is: = c1 eλ1 t 1 + c2 eλ2 t 1 .
y v2 w2
Example 86. Solve the following system with initial conditions x(0) = 5, y(0) = 1.
x0 = −6x + 9y
y 0 = 3x
66
Exercise: Show that this solution satisfies both the ODEs and the initial condition.
Exercise: Solve
x0 = −8y + 10z
y 0 = −2x + 8z
z 0 = −2z
67
18.1 Complex Eigenvalues
Let’s run through the same sort of analysis that we did before and see what happens when we have complex
eigenvalues. Consider
x0 = Ax
where x is a vector and A is a real valued matrix.
We look for solutions of the form
x = F eλt
We find the eigenvalues by setting
det(A − λI) = 0
and the eigenvectors by solving
(A − λI)F = 0
Since A is real, any complex eigenvalues must occur in conjugate pairs. For example, if there is an eigenvalue
λ1 = α + iβ
λ2 = α − iβ
Suppose that the eigenvector F (1) that corresponds to the eigenvalue λ1 is of the form
F (1) = a + ib
x = (a + ib)e(α+iβ)t
and so
x = (a + ib)eαt (cos(βt) + i sin(βt))
= a cos(βt)eαt − b sin(βt)eαt + ia sin(βt)eαt + ib cos(βt)eαt
We can get two solutions by taking real and imaginary parts. It might not be obvious but det(A − λI) = 0
is always a polynomial of degree n (where A is an n × n matrix). To solve an arbitrary polynomial, we need
complex numbers because we can then find exactly n roots over the complex field.
Example 87. Solve
x0 = −y, y0 = x
68
We find an eigenvector for λ2 = −i:
But suppose we want two real solutions? (Since A is real, this seems reasonable.)
Two independent solutions are
69
Thus two independent real solutions are
x0 = −x − y x(0) = 3
0
y = 4x − y y(0) = 4
70
But Re(x~1 ) and Im(x~1 ) are themselves solutions.
Therefore we have two solutions which is enough (no need to do λ = −1 − 2i). A general solution is thus
71
19 Multivariable Calculus
Real-valued functions
Almost all biological processes depend on more than one variable.
Example 89. The ambient temperature you need to survive is:
(0.9M − 12)(gHb + 0.95)
Te = 36 −
27.8gHb
Where Te is the temperature in degrees celsius
M is metabolic heat
gHb is thermal conduction, describing how quickly heat is lost.
gHb = 0.45 mol m−2 s−1 without clothing
= 0.14 for a wool suit
= 0.04 for a sleeping bag
M = 50 wm−2 sleeping
= 95 writing at a desk
= 180 walking at 2.5 mph
= 350 walking at 3.5 mph with a 40 lb pack
To meet the required temperature, we can either change M (moving when we get cold) or gHb (putting
on more clothing) or both.
Definition 19.1. A real-valued function f assigns a real number to an n-dimensional input. We write
f : Rn → R and f has the form f (x1 , x2 , . . . , xn ) = w.
Example 90. f (x, y) = x + y. Evaluate f at the points (−1, 1) and (2, −5).
f (−1, 1) =
f (2, −5) =
xy
Example 91. Find the domain and range of the function f (x, y, z) = z2
.
Domain:
72
Range:
p
Example 92. Find the domain and range of f (x, y) = y 2 − x. Sketch the domain in R2 .
Another way to visualize functions is with level curves. We see these in weather maps all the time.
Definition 19.2. Suppose f : R2 → R. The level curves of f comprise the set of (x, y) points where
f (x, y) = c.
Level curves are a “snapshot” of the function, taken at constant values c. It’s a way of seeing 3 dimensions
but only drawing 2.
Example 94. f (x, y) = x2 + y 2 Plot the level curves for c = 0, 2, 4, 6.
73
Example 95. f (x, y) = ln (x − y). Find the domain and range. Sketch the domain and level curves
corresponding to c = −2, −1, 0, 1, 2.
74
Example 96. Topography
75
20 Limits
Suppose
lim f (x, y) = L1 and lim g(x, y) = L2
(x,y)→(a,b) (x,y)→(a,b)
Then
lim [f (x, y) + g(x, y)] = lim f (x, y) + lim g(x, y)
(x,y)→(a,b) (x,y)→(a,b) (x,y)→(a,b)
Example 97.
lim x2 + y 2 =
(x,y)→(0,0)
lim x2 + y 2 =
(x,y)→(4,−3)
4y + 2x
lim =
(x,y)→(2,0) x2 + 2xy − 3
x2 −y 2
Example 98. Is f (x, y) = x2 +y 2
continuous at (0,0)?
76
4xy
Example 99. Show that lim(x,y)→(0,0) xy+y 3
does not exist.
77
21 Partial Derivatives
For functions with two or more variables, we don’t just have one derivative, but rather a derivative for each
variable. Partial derivatives keep all other variables fixed and look at the rate of change of only the variable
of interest
Example 100.
f (x, y) = x2 + 3xy + y 4 + 6
∂f
= 2x + 3y
∂x
∂f
= 3x + 4y 3
∂y
∂g ∂g
Example 101. Use the chain rule and product rule for g(x, y) = x2 exy to find ∂x and ∂y .
cos(xy) ∂h ∂h
Example 102. h(x, y) = y 2 +1
. Find ∂x and ∂y .
df
Geometric Interpretation: for one-variable functions, dx is the slope of the tangent line at x. The equation
of the tangent line is (y − y0 ) = f 0 (x0 )(x − x0 ).
78
It’s similar for two variables, but now instead of a tangent line, we have a tangent plane. If z = f (x, y),
then the tangent plane is
∂f ∂f
(z − z0 ) = (x0 , y0 )(x − x0 ) + (x0 , y0 )(y − y0 )
∂x ∂y
Note: The tangent plane might not exist if the limit does not exist. But then the tangent line might not
exist either.
Example 104. Find the equation of the tangent plane to the surface z = 4x2 + y 2 at the point (1,2,8).
Example 105. Find the equation for the tangent planes to z = x2 + sin(xy) when
a) (x, y)=(1,0) b) (x, y)=(0,1) c)(x, y)=(-1,π)
Solution:
a)
79
b)
c)
21.1 Linearisation
We can approximate difficult functions by their tangent plane at the point of interest. If we’re close to this
point then the tangent plane is close to the function.
80
Definition 21.1. Suppose f (x, y) is differentiable at (x0 , y0 ). The linearization of f (x, y) at (x0 , y0 ) is
∂f ∂f
L(x, y) = f (x0 , y0 ) + (x0 , y0 )(x − x0 ) + (x0 , y0 )(y − y0 )
∂x ∂y
The approximation f (x, y) ≈ L(x, y) is the standard linear approximation of f (x, y) at (x0 , y0 ).
81
a)
b)
82
22 Vector-Valued Functions
Thus far we’ve looked at real-valued functions f : Rn → R. We now consider functions whose output is
m-dimensional; that is, f : Rn → Rm .
Example 108. f (x, y, z) = (x + y 2 z, xyz), f : R3 → R2 Evaluate f at (1, 2, 0), (6, 2, −1) and (3, −4, 5)
and calculate all derivatives.
f (1, 2, 0) =
f (6, 2, −1) =
f (3, −4, 5) =
The matrix
∂f ∂f
∂x ∂y
J(x0 , y0 ) =
∂g ∂g
∂x ∂y
defined at (x0 , y0 ) is called the Jacobian matrix.
Example 109. Find the Jacobian for h(x, y) = (x2 y − y 3 , 2x3 y 2 + y) at (1, 2).
Example 110. Find the linear approximation of K(x, y) = (ye−x , sin(x) + cos(y)) at (0, 0). How close
is this to the actual value at (0.1, −0.1)?
83
∂f1 ∂f1
∂x1 ... ∂xn
In general, if f : Rn → Rm , f (x1 , x2 , ..., xn ) = (f1 , f2 , ..., fm ) then J = ... .. .
.
∂fm ∂fm
∂x1 ... ∂xn
84
23 Phase Plane Analysis
Example 111. Solve the following system with (x0 , y0 ) = (1, 0).
x0 = −x
y0 = x
Method 1. Solve x equation first, then the y equation. We can do this because the equation is independent of y:
dx
= −x
dt
dx
= −dt
x
ln |x| = −t + c
x = Ae−t
x(0) = A = 1
x = e−t
85
Method 2: Divide the second equation by the first.
dy
y0 dt dy
= = = −1
x0 dx
dt
dx
∴ y = −x + c
0 = −1 + c ⇒ c = 1
y =1−x
Now plot x-y coordinates where t is implicit. Which way do trajectories travel? Since (x(0), y(0)) = (1, 0),
that’s where they start. Or we have:
(a) y 0 > 0 indicates that y is increasing (b) x0 < 0 indicates that x is decreasing
Drawing solutions in the x-y plane, with time as an implicit variable is known as the Phase Plane.
Example 112.
y 0 = −x
x0 = y
(x(0), y(0)) = (3, −4)
86
Direction?
87
Therefore we know everything from the phase plane, except how fast the solutions travel.
88
24 Nullclines
Nullclines are solutions to either x0 = 0 or y 0 = 0
Example 113. y 0 = −x and x0 = y
y-nullcline: y 0 = 0 ⇒ x = 0
x-nullcline: x0 = 0 ⇒ y = 0
When the two equations meet, we have an equilibrium.
On the y-nullcline, y does not change (although x might, and usually does.)
On the x-nullcline, x does not change (although y might, and usually does.)
Check with the previous example:
S 0 = bI − aSI
I 0 = aSI − bI
89
Answer: Not necessarily what you think.
Nullclines:
S0 = 0 ⇒ (b − aS)I = 0
0
I =0⇒ −(b − aS)I = 0
b − aS = 0
b
S=
a
Or
I=0
S=N
b b
Case (i): a <N Case (ii): a >N
Equilibria: (N, 0) and ( ab , N − ab ) Equilibria: (N, 0) only. (In the positive plane)
Directions?
If S < ab , then
90
b
S 0 = (b − as)I = a( − S)I
a
b b
∴ if S < , − S > 0 so S 0 > 0
a a
⇒ S is increasing.
b
I 0 = (aS − b)I = a(S − )I
a
b b
∴ if S < , S − < 0, so I 0 < 0
a a
⇒ I is decreasing.
Biological interpretation: Stability depends on ab . If the recovery rate b is high compared to the infection
rate a, then infected individuals recover quickly and the population moves to a population of susceptibles,
clearing infection.
If the infection rate a is high compared to the recovery rate b, then infection stabilizes at an endemic
91
equilibrium.
dy
What if we can’t solve the dx equation?
y 0 = (15 − 3x)y
x0 = (−6 + 2y)x
Biological explanation: The prey population increases on its own, while the predator population decreases
on its own. The interaction is given by:
Quadrant 1:
y 0 = (15 − 3x)y > 0 since x < 5
x0 = (−6 + 2y)x < 0 since y < 3
If we have small number of predators and few prey, then prey increases because there are few predators and
predators decrease because there is little food.
Quadrant 2:
y 0 = (15 − 3x)y < 0 since x > 5
x0 = (−6 + 2y)x < 0 since y < 3
If we have lots of predators and few prey, then prey decreases because they’re eaten and predators decrease
because there is little food.
Quadrant 3:
y 0 = (15 − 3x)y < 0 since x > 5
x0 = (−6 + 2y)x > 0 since y > 3
If we have lots of predators and lots of prey, then prey decreases because they’re eaten and predators increase
because they have lots of food.
Quadrant 4:
y 0 = (15 − 3x)y > 0 since x < 5
x0 = (−6 + 2y)x > 0 since y > 3
If we have few predators and lots of prey, then prey increases because there are few predators and predators
increase because there is lots of food.
92
Therefore the dynamics will oscillate.
This was actually observed in Canada for lynx and hares by the Hudson’s Bay Company over a hundred year
period. Lynx feed only on hares and nothing keeps the hare population in check other than predation by lynx.
93
25 Stability in Linear Systems
Consider the linear system:
x0 = ax + by
y 0 = cx + dy
" #
∂f ∂f
∂x ∂y a b
The only steady state is (0, 0) The Jacobian is given by J = ∂g ∂g =
∂x ∂y
c d
a−λ b
det(J − λI) = det
c d−λ
= (λ − a)(λ − d) − bc
= λ2 − (a + d)λ + ad − bc
p
(a + d) ± (a + d)2 − 4(ad − bc)
λ=
2
1 p
= [a + d ± a + d2 − 2ad + 4bc]
2
2
1 p
= [a + d ± (a − d)2 + 4bc]
2
If ∆ = (a − d)2 + 4bc < 0 then we are taking the root of a negative.
There are two cases: ∆ < 0, ∆ > 0.
x0 = −4x
y 0 = −5y
Solution:
−4 0
J=
0 −5
λ1 = −4, λ2 = −5
94
y x
t t
Check:
x0 = 4x
y 0 = 2y
Solution:
4 0
J=
0 2
λ1 = 4, λ2 = 2 → unstable equilibrium.
Check:
95
This equilibrium is an unstable source.
x0 = x
y 0 = −3y
Solution:
1 0
J=
0 −3
λ1 = 1, λ2 = −3 → unstable equilibrium.
Check:
96
This equilibrium is a saddle.
x0 = −2x − 3y
y0 = x
Solution:
−2 −3
J=
1 0
det(J − λI) = λ(2 + λ) + 3 = λ2 + 2λ + 3
√
λ = −1 ± 2i
dy −x
We cannot solve dx = 2x+3y directly. So we will use nullclines.
0
x-nullcline: x = 0 : −2x − 3y = 0 → y = − 32 x
y-nullcline: y 0 = 0 : x = 0 → x = 0
97
Quadrant 1 : x0 < 0, y 0 > 0
Quadrant 2 : x0 < 0, y 0 < 0
Quadrant 3 : x0 > 0, y 0 < 0
Quadrant 4 : x0 > 0, y 0 > 0
98
Example 122. Find the stability of the following system: x0 = 3x − y, y 0 = x + 2y.
3 −1
J=
1 2
det(J − λI) = (λ − 3)(λ − 2) + 1 = λ2 − 5λ + 7
√
5 ± −3
λ=
2
5
Re(λ) = > 0 ∴ unstable.
2
99
0 −1
J=
1 0
det(J − λI) = λ2 + 1
λ2 + 1 = 0 → Re(λ) = 0 → W e have neither asymptotic stability nor instability.
dy x
=
dx −y
Z Z
− ydy = xdx
y2 x2
− = +k
2 2
x2 + y 2 = c
100
26 Stability in nonlinear systems
Recall that the Jacobian came from the linearization of the system. Therefore, for nonlinear systems, the
stability of an equilibrium is the same as for the linearization, therefore we still look at the eigenvalues of J.
If λ1 , λ2 are both real and negative - stable equilibrium
101
One exception: A centre in a linear system may become a spiral - stable or unstable.
Example 124. Find all equilibria for the following system and determine their stability:
x0 = xy 2 + x − 3y 2 − 3 (1)
0 4 4
y = x y + y − 2x − 2 (2)
Example 125. Find all equilibria for the following system and determine their stability:
x0 = xy − 2x − 5y + 10 (3)
0
y = xy − 4x + y − 4 (4)
102
Example 126. Find all equilibria for the following system and determine their stability:
x0 = xy 2 − x − 3y 2 + 3 (5)
0
y = xy − 7x − 4y + 28 (6)
103
Be careful: solutions must be consistent. Neighbouring trajectories cannot have opposite directions.
Trajectories cannot cross or suddenly change direction, except at an equilibrium.
Example 127. Find all equilibria for the following system and determine their stability:
x0 = xy − 7x − 3y + 21 (7)
0 2 2 2 2
y = x y − 4x − y + 4 (8)
104
105
Exercise: Find all equilibria for the following system and determine their stability:
x0 = y 2 − 4
y 0 = x2 − 1.
106