Problem Set 8: differential equations, exp(At) and Markov matrices
Seven problems of our own on Lectures 23 and 24: solving a system du/dt = Au from its eigenvalues and eigenvectors, stability from the trace and the determinant, the matrix exponential and the two series it is compared with, a third-order equation written as a system, a two-state and a three-state Markov chain and their steady states, and coefficients in an orthonormal basis and in a Fourier series.
MIT's 18.06 problem sets assign exercises from a textbook that is not openly licensed, so this set is made of our own problems on the same lectures, in MIT's lecture order. No MIT or textbook problem is used: every matrix and every number below is ours, and so are the hints and the solutions. The formulas come from the lessons and from the lecture transcripts they cite.
Work each problem on paper first. Then type or choose your result in the answer box and press Check.
Give a number answer to 3 significant figures and keep 4 in intermediate steps; an answer with only 2 significant figures may or may not be accepted. Where a box needs more digits, its label says so.
A number box wants a decimal number, not a fraction or a root: write 0.25, not 1/4. A number box accepts any value within 0.01 of the exact one, or within 0.005 when the exact value is below 1 in size, so give at least three decimal places when the answer is not a whole number. A matrix cannot be typed: a box asks for one of its entries, an eigenvalue, a coefficient or a component, or you choose from a list. Entries are numbered by row, then column, starting from 1 (so c12 is in the first row, second column).
A formula box takes plain typing, for example 4*exp(-t/2) + sqrt(t) or 100*0.9^k, and accepts every correct way of writing the answer. Type exp( ) for the exponential function and ^ for a power.
Some parts ask you to show something. They have no answer box: write your argument, then open the solution and mark yourself. MIT gives no points for these problems: the points here (100 in all) and their split between the parts are ours. If you are stuck, open the hints one at a time. Each part ends with its full solution. Try before you open it: an answer given after its solution was opened earns no points. Your score is kept in this browser only.
u(t) equals c one e to the power lambda one t x one plus c two e to the power lambda two t x two plus and so on plus c sub n e to the power lambda n t x sub n
e to the power capital A t equals capital I plus capital A t plus ( capital A t) squared over 2 plus ( capital A t) cubed over 6 plus and so on equals capital S e to the power capital lambda t capital S to the power minus 1
the quantity capital I minus capital A t, all to the power minus 1 equals capital I plus capital A t plus ( capital A t) squared plus ( capital A t) cubed plus and so on
A second-order equation y′′+by′+ky=0 becomes a first-order system for u=(y′,y): the equation in the top row, the trivial equation y′=y′ below it. Higher orders work the same way, with ones just below the diagonal (p. 23):
First-order form
dtd(y′y)=(−b1−k0)(y′y)
In words
d over d t y prime; y equals minus b minus k; 1 0 y prime; y
Markov matrices (Lecture 24). A Markov matrix has no negative entries and every column adds to 1. Then λ=1 is an eigenvalue, the others have ∣λ∣≤1 (in all but exceptional cases ∣λ∣<1), and the powers approach the steady statec1x1 (pp. 2–4 of the Lecture 24 transcript):
Approach to the steady state
uk=Aku0=c11kx1+c2λ2kx2+⋯→c1x1
In words
u sub k equals capital A to the power k u nought equals c one 1 to the power k x one plus c two lambda two to the power k x two plus and so on goes to c one x one
Functions on [0,2π] have the inner product∫02πf(x)g(x)dx, in which 1,cosx,sinx,cos2x,sin2x,… are orthogonal (pp. 19–20). In the Fourier series of f, the coefficient of cosx is found by multiplying by cosx and integrating:
f(x) equals a nought plus a one cos x plus b one sine x plus a two cos 2 x plus b two sine 2 x plus and so on, a one equals 1 over pi, times the integral from 0 to 2 pi of f(x) cos x d x
The idea. For a 2×2 matrix the trace and the determinant give the characteristic polynomial.
The characteristic polynomial
The trace is −3−2=−5 and the determinant is (−3)(−2)−(1)(2)=4:
Eigenvalues of A
λ2+5λ+4=(λ+1)(λ+4)=0,λ1=−1,λ2=−4
In words
lambda squared plus 5 lambda plus 4 equals the quantity lambda plus 1, the quantity lambda plus 4, equals 0, lambda one equals minus 1, lambda two equals minus 4
−1+(−4)=−5 is the trace and (−1)(−4)=4 the determinant. Both eigenvalues are negative, so every solution will decay to zero.
(b)6 points
Find eigenvectorsx1 for λ1 and x2 for λ2, with first components equal to 1. Write u(0)=c1x1+c2x2 and find c2. Then give the second component u2(t) of the solution.
Hint
x1 is in the nullspace of A−λ1I: a matrix whose two rows are multiples of each other, so one row is enough.
Hint
c1x1+c2x2=u(0) is two equations for c1 and c2. Then each cixi is multiplied by its own eλit.
Solution
The idea. Eigenvectors from the nullspaces, constants from u(0), and then each piece grows or decays with its own exponential.
The eigenvectors
A+I=(−221−1): the first row says −2x+y=0, so x1=(1,2). A+4I=(1212): x+y=0, so x2=(1,−1).
The constants
c1(1,2)+c2(1,−1)=(3,0) means c1+c2=3 and 2c1−c2=0. Adding, 3c1=3: so c1=1 and c2=2.
The solution
Solution of Problem 1
u(t)=e−t(12)+2e−4t(1−1)=(e−t+2e−4t2e−t−2e−4t)
In words
u(t) equals e to the power minus t 1; 2 plus 2 e to the power minus 4 t 1; minus 1 equals e to the power minus t plus 2 e to the power minus 4 t; 2 e to the power minus t minus 2 e to the power minus 4 t
At t∗, e−3t∗=41, so u2=2e−t∗(1−e−3t∗)=23e−t∗=23⋅4−1/3≈0.9449.
Loading graph…
The two components of the solution of Problem 1, computed from the formula: u1 (solid) falls from 3, u2 (dashed) rises from 0 to its largest value near t=0.46 and then decays with u1.
Check
Before t∗ the term 8e−4t wins and u2 rises; after it, −2e−t wins and u2 falls. So the stationary point is a maximum.
(d)2 points
Show that u1(t)+u2(t)=3e−t, without using the solution, from the columns of A. (This part has no box.)
Hint
Add the two equations du1/dt=… and du2/dt=…. What does each column of A add up to?
Solution
The idea. The column sums of A say how the total changes.
Adding the equations
du1/dt=−3u1+u2 and du2/dt=2u1−2u2. Their sum is d(u1+u2)/dt=−u1−u2, because each column of A adds up to −1. So the total s=u1+u2 solves ds/dt=−s with s(0)=3, which gives s=3e−t.
Check
From part (b): (e−t+2e−4t)+(2e−t−2e−4t)=3e−t. (In Lecture 23's example the columns add to zero, so there the total stays constant: Lecture 23 transcript, p. 1.)
Every solution goes to zero exactly when a is below a certain number. Find it.
Hint
The trace does not depend on a. What must the determinant do?
Solution
The idea. The 2×2 test: trace negative and determinant positive.
The test
The trace is −5<0 for every a. The determinant is 6−a, positive exactly when a<6. So the system is stable for a<6.
Check
At a=6 the determinant is zero, so one eigenvalue is 0 and the other is the trace −5: a steady state, not decay. Above 6 the determinant is negative, the eigenvalues have opposite signs and the positive one blows up.
(b)5 points
For a≥0 the eigenvalues are real. Give the larger one as a formula in a.
Hint
λ2−(trace)λ+detA=0, solved with the quadratic formula. Simplify the term under the root.
Solution
The idea. The characteristic polynomial of a 2×2 matrix comes from its trace and determinant.
The quadratic formula
Eigenvalues of the matrix of Problem 2
λ2+5λ+(6−a)=0,λ=2−5±25−4(6−a)=2−5±1+4a
In words
lambda squared plus 5 lambda plus the quantity 6 minus a, equals 0, lambda equals the quantity minus 5 plus or minus the square root of 25 minus 4 the quantity 6 minus a, end of root, all over 2 equals the quantity minus 5 plus or minus the square root of 1 plus 4 a, end of root, all over 2
At a=0: (−5+1)/2=−2, the larger diagonal entry of the triangular matrix. At a=6: (−5+5)/2=0, as part (a) found.
(c)5 points
Now take a=−6.5. Find the real part of the eigenvalues and the positive imaginary part, and say what the solutions do.
Hint
With a=−6.5 the term under the root is negative: its square root is i times the root of the positive number.
Hint
The size of eλt depends only on the real part of λ.
Solution
The idea. Complex eigenvalues of a real matrix come in a conjugate pair; their real part is half the trace.
The eigenvalues
1+4a=1−26=−25, so λ=(−5±5i)/2=−2.5±2.5i.
The behaviour
Each pure solution contains e−2.5te±2.5it. The factor e±2.5it=cos2.5t±isin2.5t has size 1 and turns; e−2.5t shrinks. So the solutions spiral in to zero.
Check
The trace and determinant test agrees: trace −5<0 and determinant 6+6.5=12.5>0. And (−2.5)2+2.52=12.5, the product of the two conjugate eigenvalues.
(d)3 points
For comparison, take B=(03−30) and du/dt=Bu. Say what the solutions do. Then show that ∥u(t)∥2=u12+u22 never changes (this step has no box).
Hint
Trace 0: the stability test is on its border. Find the eigenvalues.
Hint
Differentiate u12+u22 and use the two equations.
Solution
The idea. Purely imaginary eigenvalues give pure oscillation: real part zero, so neither decay nor growth.
The eigenvalues
λ2+9=0, so λ=±3i. Since ∣e3it∣=1, the solutions neither shrink nor grow: they circle at a fixed size.
The length
du1/dt=−3u2 and du2/dt=3u1, so
The length does not change
dtd(u12+u22)=2u1(−3u2)+2u2(3u1)=0
In words
d over d t the quantity u one squared plus u two squared, equals 2 u one (-3 u two ) plus 2 u two (3 u one ) equals 0
e to the power capital A t equals 1 2; 1 1 e to the power 2 t 0; 0 e to the power 3 t minus 1 2; 1 minus 1 equals minus e to the power 2 t plus 2 e to the power 3 t 2 e to the power 2 t minus 2 e to the power 3 t; minus e to the power 2 t plus e to the power 3 t 2 e to the power 2 t minus e to the power 3 t
SS−1=(−1+2−1+12−22−1)=I. Part (b) checks the result itself.
(b)2 points
Check, from the series, that eAt must equal I at t=0 and that its derivative at t=0 must be A. Then check both on your matrix from part (a). (This part has no box.)
Hint
Differentiate the series term by term: what is left of each term at t=0?
Solution
The idea. The first two terms of the series, I+At, decide the value and the slope at t=0.
From the series
At t=0 every term after I is zero. Differentiating term by term gives A+A2t+21A3t2+⋯, which is A at t=0. (In fact the derivative is AeAt, so u=eAtu(0) solves du/dt=Au.)
On the matrix
At t=0 the four entries are −1+2=1, 2−2=0, −1+1=0 and 2−1=1: the identity. Their derivatives at t=0 are −2+6=4, 4−6=−2, −2+3=1 and 4−3=1: the matrix A.
(c)3 points
Find the (1,1) entry of eAt at t=0.5.
Hint
Put t=0.5 into the (1,1) entry of the matrix you found in part (a).
Solution
The idea. One entry of the product of part (a), at one time.
The number
An entry at t=0.5
−e1+2e1.5≈−2.7183+8.9634=6.2451
In words
minus e to the power 1 plus 2 e to the power 1.5 is approximately minus 2.7183 plus 8.9634 equals 6.2451
The trace of eAt is e2t+e3t, the sum of its eigenvalues. At t=0.5 the diagonal of part (a) gives 6.2451+(2e−e1.5)=6.2451+0.9549=7.2000, and e+e1.5=2.7183+4.4817=7.2000.
(d)4 points
Compare the two series of the lecture for this A and t>0. For which t does the exponential series I+At+(At)2/2+⋯converge? And up to which t does the geometric seriesI+At+(At)2+⋯converge?
Hint
The eigenvalues of At are t times the eigenvalues of A.
Solution
The idea. Factorials make the exponential series converge always; the geometric series needs every eigenvalue of At below 1 in size.
The exponential series
The n-th term is (At)n/n!, and n! grows faster than any power: the series converges for every A and every t (Lecture 23 transcript, p. 18).
The geometric series
The eigenvalues of At are 2t and 3t. Both are below 1 when 3t<1, so the geometric series converges for 0<t<31≈0.3333. (Stopping at 2t<1, that is t<21, forgets the larger eigenvalue.)
Check
At t=31 the matrix I−At has the eigenvalue 1−3⋅31=0: it is singular, so (I−At)−1 does not even exist there.
the determinant of 2 minus lambda 1 minus 2; 1 minus lambda 0; 0 1 minus lambda equals the quantity 2 minus lambda, lambda squared minus 1 times (- lambda ) plus (-2) times 1 equals minus lambda cubed plus 2 lambda squared plus lambda minus 2
λ3−2λ2−λ+2=λ2(λ−2)−(λ−2)=(λ−2)(λ−1)(λ+1). The eigenvalues are 2, 1 and −1; the largest is 2.
Check
Their sum 2+1−1=2 is the trace of C, and their product −2 is detC (put λ=0 in the determinant).
(c)4 points
Two eigenvalues are positive, so most solutions blow up. Take y(0)=1 and y′(0)=−1. For which value of y′′(0) does y(t) go to zero as t→∞?
Hint
y(t) is a combination of eλt for the three eigenvalues of part (b): which amounts must be zero?
Solution
The idea. Only the pure solution with the negative eigenvalue decays; the start must contain nothing of the other two.
The condition
Write y(t)=αe2t+βet+γe−t. For y→0 we need α=β=0, so y=γe−t. Then y(0)=γ=1, and y′(0)=−1 holds already. So y=e−t and y′′(0)=1.
Check
In general the three starting values give α+β+γ=1, 2α+β−γ=−1 and 4α+β+γ=y′′(0). The first and third give 3α=y′′(0)−1, and the first two give 3α+2β=0. Both α and β vanish exactly when y′′(0)=1.
Each year 0.8 of the people in region P stay and 0.2 move to region Q; 0.7 of the people in Q stay and 0.3 move to P. Nobody arrives from outside or leaves. At the start (year 0) region P has 1000 people and region Q is empty. (Like the two-state example of Lecture 24, with our own numbers: Lecture 24 transcript, pp. 10–14.) With uk=(people in P,people in Q) in year k,
The model of Problem 5
uk+1=Auk,A=(0.80.20.30.7),u0=(10000)
In words
u sub k plus 1 equals capital A u sub k, capital A equals 0.8 0.3; 0.2 0.7, u nought equals 1000; 0
The idea. For a Markov matrix, λ=1 is known; the trace gives the other eigenvalue at once.
The eigenvalues
The trace is 1.5, so the other eigenvalue is 1.5−1=0.5. The determinant agrees: 0.56−0.06=0.5=1⋅0.5.
The eigenvectors
A−I=(−0.20.20.3−0.3): −0.2x+0.3y=0, so x1=(3,2), with no negative component, as the lecture says it must be. A−0.5I=(0.30.20.30.2) gives x2=(1,−1).
Check
A(3,2)=(2.4+0.6,0.6+1.4)=(3,2). The vector (1,1) is the eigenvector of AT for λ=1, not of A (Lecture 24 transcript, p. 8).
(b)3 points
Show that the total number of people stays 1000 (this step has no box). How many people live in P in the steady state?
Hint
What does each column of A add up to? The steady state is the multiple of x1 with the right total.
Solution
The idea. Columns adding to 1 conserve the total; the steady state is the eigenvector for λ=1 with that total.
The total
Each column of A adds up to 1: of the people in P, the fractions 0.8 and 0.2 are found again in P and Q, and of the people in Q, 0.3+0.7=1. So the total in year k+1 equals the total in year k, and it stays 1000.
The steady state
The multiple of (3,2) with total 1000 is 200⋅(3,2)=(600,400): 600 people in P.
Check
A(600,400)=(480+120,120+280)=(600,400): nothing changes from year to year.
(c)5 points
Give the number of people in P in year k as a formula in k.
Hint
Write u0=c1x1+c2x2; then uk=c1x1+c2λ2kx2, with λ2 from part (a).
Solution
The idea. Expand u0 in eigenvectors; each part is multiplied by its own eigenvalue every year.
The constants
c1(3,2)+c2(1,−1)=(1000,0): 3c1+c2=1000 and 2c1−c2=0. Adding, 5c1=1000, so c1=200 and c2=400.
the determinant of capital A equals 0.4 the quantity 0.42 minus 0.02, all minus 0.2 the quantity 0.21 minus 0.03, all plus 0.2 the quantity 0.06 minus 0.18, equals 0.16 minus 0.036 minus 0.024 equals 0.1
λ2−0.7λ+0.1=(λ−0.5)(λ−0.2)=0: the other eigenvalues are 0.5 and 0.2, both below 1 in size.
Check
A−0.5I has rows (−0.1,0.2,0.2), (0.3,0.1,0.1) and (0.3,0.2,0.2): its last two columns are equal, so it is singular.
(c)4 points
The three clubs have 2000 members together. How many does each have in the steady state? Give the second and third club.
Hint
Solve (A−I)x=0. Two of its rows are enough; then scale x to the total 2000.
Solution
The idea. The steady state is the eigenvector for λ=1, scaled to the conserved total.
The eigenvector
A−I has rows (−0.6,0.2,0.2), (0.3,−0.4,0.1) and (0.3,0.2,−0.3). Times 10, the first two rows say −6x+2y+2z=0 and 3x−4y+z=0. Twice the second added to the first gives −6y+4z=0, so z=23y; then 6x=2y+3y, so x=65y. With y=6: x1=(5,6,9).
The steady state
5+6+9=20, so scale by 100: (500,600,900).
Check
The third row: 0.3⋅500+0.2⋅600+0.7⋅900=150+120+630=900. Starting from any distribution of the 2000 members, the parts along the other eigenvectors shrink like 0.5k and 0.2k.
(d)3 points
An exceptional case: the matrixP=(0110) is also a Markov matrix. Start from u0=(1,0) and say what uk=Pku0 does.
Hint
Find both eigenvalues of P. Is the second one below 1 in size?
Solution
The idea. The steady state is reached only when every other eigenvalue has ∣λ∣<1.
The eigenvalues
λ2−1=0: λ=1 with x1=(1,1) and λ=−1 with x2=(1,−1). Here ∣λ2∣=1, the exceptional case of the lecture.
The powers
u0=21(1,1)+21(1,−1), so uk=21(1,1)+21(−1)k(1,−1): (1,0) for even k and (0,1) for odd k. It flips for ever and never settles.
Check
P simply swaps the two components: P(1,0)=(0,1) and P(0,1)=(1,0). Only a start at (0.5,0.5), a multiple of x1, stays put.
b sub n equals 1 over pi, times the integral from 0 to 2 pi of f(x) sine n x d x equals 1 over pi, times the quantity the integral from 0 to pi of sine n x d x minus the integral from pi to 2 pi of sine n x d x
∫0πsinxdx=2 and ∫π2πsinxdx=−2, so b1=4/π≈1.2732. For n=3: ∫0πsin3xdx=32 and ∫π2πsin3xdx=−32, so b3=3π4≈0.4244.
Loading graph…
The square wave (solid) and the first two nonzero terms of its Fourier series, b₁ sin x + b₃ sin 3x (dashed), computed from the formulas. Two terms already follow the steps of the wave, with a ripple.
Check
For even n the two halves cancel: ∫0πsin2xdx=0, so b2=0. The cosine coefficients are zero too: ∫0πcosxdx=0=∫π2πcosxdx, and the average a0 of f is 0.
The unknown function of t in the second- and third-order equations; in Problems 1, 5 and 6, the second component of an unknown eigenvector. Say it: “y”.
A square matrix with no negative entries whose columns each add up to one; it moves probabilities or populations from one step to the next. Explained in Markov matrices and Fourier series.
A way of writing a repeating function as a sum of sines and cosines whose frequencies are whole-number multiples of one frequency. Explained in Normal modes of a string and Fourier series.
To rewrite a matrix in a basis of its eigenvectors, where it becomes diagonal, with its eigenvalues down the diagonal. Explained in Diagonalisation and powers of A.
Unchanged by some swap, reflection or turn; for an expression in two quantities, unchanged when they are exchanged. Explained in Introduction to Fourier series.
Of a symmetric matrix or quadratic form: always giving a positive value for any nonzero input; equivalently, all its eigenvalues are positive. Explained in Symmetric matrices and positive definiteness.
A rectangular table of numbers, which acts on vectors to give new ones and so describes a linear change of coordinates. Explained in Planes through three points, and matrices.
The whole family of solutions of a differential equation, written with free constants that starting values or boundary conditions then fix. Explained in Differential equations and separation of variables.
A condition that no longer changes with time, or for a driven system the lasting motion left once start-up effects die away. Explained in Driven oscillators and resonance.
A single number worked out from a square array of numbers (a matrix), which measures how the matrix stretches areas or volumes. Explained in Determinants and the cross product.
To settle towards a definite finite value: an integral, series or sequence converges when its partial results approach a limit. Explained in Improper integrals.
In a square matrix, the entries running from the top left corner to the bottom right; a diagonal matrix has zeros everywhere else. Explained in The four fundamental subspaces.
A way of multiplying two vectors that gives a number: multiply matching components and add, or lengths times the cosine of the angle between them. Explained in Vectors and the dot product.
At right angles; more generally, of two vectors or functions, having a dot product, or an integral of their product, of zero. Explained in Introduction to Fourier series.
The polynomial whose roots are the eigenvalues of a matrix, found as the determinant of the matrix minus λ times the identity. Explained in Diagonalisation and powers of A.
A square matrix with only zeros below its diagonal (upper triangular) or only zeros above it (lower triangular). Explained in Elimination with matrices.
Of a square matrix: having no inverse, because its determinant is zero and some nonzero vector is sent to zero. Explained in The geometry of linear equations.
A list of numbers written as a column, or more generally anything that can be added and multiplied by numbers. Explained in Orthogonal vectors and subspaces.
A sum of very many very small pieces, such as the area under a graph; it undoes taking a derivative. Explained in Rates of change and area under a graph.
To become zero; sometimes, of a fixed point or solution, to stop existing.
Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).