BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

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.

You need this first

Full reading path (26 pages)
  1. Vectors (8.01)
  2. Vectors and the dot product (18.02)
  3. Determinants and the cross product (18.02)
  4. Planes through three points, and matrices (18.02)
  5. Equations of planes and square systems (18.02)
  6. The geometry of linear equations (18.06)
  7. Elimination with matrices (18.06)
  8. Matrix multiplication and inverse matrices (18.06)
  9. Factorization into A = LU (18.06)
  10. Transposes, permutations and vector spaces (18.06)
  11. Properties of determinants (18.06)
  12. Determinant formulas and cofactors (18.06)
  13. Cramer's rule, the inverse matrix and volume (18.06)
  14. Column space and nullspace (18.06)
  15. Eigenvalues and eigenvectors (18.06)
  16. Diagonalisation and powers of A (18.06)
  17. Differential equations and exp(At) (18.06)
  18. Solving Ax = 0: pivot variables and special solutions (18.06)
  19. Solving Ax = b: the complete solution (18.06)
  20. Independence, basis and dimension (18.06)
  21. The four fundamental subspaces (18.06)
  22. Orthogonal vectors and subspaces (18.06)
  23. Projections onto subspaces (18.06)
  24. Projection matrices and least squares (18.06)
  25. Orthogonal matrices and Gram–Schmidt (18.06)
  26. Markov matrices and Fourier series (18.06)
On this page · 9 sections
  1. How to answer
  2. What you need from the lessons
  3. Problem 1
  4. Problem 2
  5. Problem 3
  6. Problem 4
  7. Problem 5
  8. Problem 6
  9. Problem 7

This set practises two lessons: differential equations and exp(At) (Lecture 23) and Markov matrices and Fourier series (Lecture 24). Eigenvalues and diagonalisation themselves belong to Problem Set 7; symmetric and positive definite matrices to Problem Set 9.

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.

How to answer#

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.250.25, not 1/41/4. A number box accepts any value within 0.010.01 of the exact one, or within 0.0050.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 c12c_{12} 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.

What you need from the lessons#

Differential equations (Lecture 23). Each eigenvalue λi\lambda_i of AA, with eigenvector xix_i, gives a pure exponential solution of du/dt=Audu/dt = Au, and the general solution combines them; the constants come from the start, Sc=u(0)Sc = u(0), with the eigenvectors in the columns of SS (pp. 13–14 of the Lecture 23 transcript):

General solution
u(t)=c1eλ1tx1+c2eλ2tx2+⋯+cneλntxnu(t) = c_1e^{\lambda_1t}x_1 + c_2e^{\lambda_2t}x_2 + \cdots + c_ne^{\lambda_nt}x_n
In words

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

Every solution goes to zero when every eigenvalue has a negative real part; one eigenvalue 00 with the others of negative real part gives a steady state; a positive real part blows up (pp. 9–10). For a 2×22 \times 2 matrix the eigenvalues add up to the trace and multiply to the determinant, so

Two by two stability
trace⁡=λ1+λ2<0anddet⁡A=λ1λ2>0\operatorname{trace} = \lambda_1 + \lambda_2 < 0 \quad\text{and}\quad \det A = \lambda_1\lambda_2 > 0
In words

t r a c e equals lambda one plus lambda two less than 0 and the determinant of capital A equals lambda one lambda two greater than 0

The matrix exponential is defined by its series, which converges for every AA and tt; with nn independent eigenvectors it is built from SS and the diagonal Λ\Lambda, and u(t)=eAtu(0)u(t) = e^{At}u(0):

The matrix exponential
eAt=I+At+(At)22+(At)36+⋯=SeΛtS−1e^{At} = I + At + \frac{(At)^2}{2} + \frac{(At)^3}{6} + \cdots = Se^{\Lambda t}S^{-1}
In words

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 geometric series converges only when every eigenvalue of AtAt is below 1 in size (p. 18):

Geometric series
(I−At)−1=I+At+(At)2+(At)3+⋯(I - At)^{-1} = I + At + (At)^2 + (At)^3 + \cdots
In words

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=0y'' + by' + ky = 0 becomes a first-order system for u=(y′,y)u = (y', y): the equation in the top row, the trivial equation y′=y′y' = y' below it. Higher orders work the same way, with ones just below the diagonal (p. 23):

First-order form
ddt(y′y)=(−b−k10)(y′y)\frac{d}{dt}\begin{pmatrix} y' \\ y \end{pmatrix} = \begin{pmatrix} -b & -k \\ 1 & 0 \end{pmatrix}\begin{pmatrix} y' \\ y \end{pmatrix}
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\lambda = 1 is an eigenvalue, the others have ∣λ∣≤1|\lambda| \leq 1 (in all but exceptional cases ∣λ∣<1|\lambda| < 1), and the powers approach the steady state c1x1c_1x_1 (pp. 2–4 of the Lecture 24 transcript):

Approach to the steady state
uk=Aku0=c1 1k x1+c2λ2kx2+⋯  →  c1x1u_k = A^ku_0 = c_1\,1^k\,x_1 + c_2\lambda_2^kx_2 + \cdots \;\to\; c_1x_1
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

A matrix and its transpose have the same eigenvalues:

Same eigenvalues for the transpose
det⁡(A−λI)=det⁡(AT−λI)\det(A - \lambda I) = \det(A^T - \lambda I)
In words

the determinant of the quantity capital A minus lambda capital I, equals the determinant of the quantity capital A ^ capital T minus lambda capital I

Orthonormal bases and Fourier series (Lecture 24). If q1,…,qnq_1, \dots, q_n are orthonormal and v=x1q1+⋯+xnqnv = x_1q_1 + \cdots + x_nq_n, a dot product with qiq_i picks out one coefficient (pp. 15–16):

Coefficient in an orthonormal basis
xi=qiTvx_i = q_i^Tv
In words

x sub i equals q sub i ^ capital T v

Functions on [0,2π][0, 2\pi] have the inner product ∫02πf(x)g(x) dx\int_0^{2\pi} f(x)g(x)\,dx, in which 1,cos⁡x,sin⁡x,cos⁡2x,sin⁡2x,…1, \cos x, \sin x, \cos 2x, \sin 2x, \dots are orthogonal (pp. 19–20). In the Fourier series of ff, the coefficient of cos⁡x\cos x is found by multiplying by cos⁡x\cos x and integrating:

Fourier series and its first coefficient
f(x)=a0+a1cos⁡x+b1sin⁡x+a2cos⁡2x+b2sin⁡2x+⋯ ,a1=1π∫02πf(x)cos⁡x dxf(x) = a_0 + a_1\cos x + b_1\sin x + a_2\cos 2x + b_2\sin 2x + \cdots, \qquad a_1 = \frac{1}{\pi}\int_0^{2\pi} f(x)\cos x\,dx
In words

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

Problem 1#

Problem

Solving du/dt = Au

16 points

Solve the system

The system of Problem 1
dudt=Au,A=(−312−2),u(0)=(30)\frac{du}{dt} = Au, \qquad A = \begin{pmatrix} -3 & 1 \\ 2 & -2 \end{pmatrix}, \qquad u(0) = \begin{pmatrix} 3 \\ 0 \end{pmatrix}
In words

d u over d t equals capital A u, capital A equals minus 3 1; 2 minus 2, u(0) equals 3; 0

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 1 (our own problem)

(a)4 points

Find the two eigenvalues of AA.

Hint

The eigenvalues solve λ2−(trace⁡)λ+det⁡A=0\lambda^2 - (\operatorname{trace})\lambda + \det A = 0.

Solution

The idea. For a 2×22 \times 2 matrix the trace and the determinant give the characteristic polynomial.

The characteristic polynomial

The trace is −3−2=−5-3 - 2 = -5 and the determinant is (−3)(−2)−(1)(2)=4(-3)(-2) - (1)(2) = 4:

Eigenvalues of A
λ2+5λ+4=(λ+1)(λ+4)=0,λ1=−1, λ2=−4\lambda^2 + 5\lambda + 4 = (\lambda + 1)(\lambda + 4) = 0, \qquad \lambda_1 = -1,\ \lambda_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

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 1(a) (our own solution)

Check

−1+(−4)=−5-1 + (-4) = -5 is the trace and (−1)(−4)=4(-1)(-4) = 4 the determinant. Both eigenvalues are negative, so every solution will decay to zero.

(b)6 points

Find eigenvectors x1x_1 for λ1\lambda_1 and x2x_2 for λ2\lambda_2, with first components equal to 1. Write u(0)=c1x1+c2x2u(0) = c_1x_1 + c_2x_2 and find c2c_2. Then give the second component u2(t)u_2(t) of the solution.

Hint

x1x_1 is in the nullspace of A−λ1IA - \lambda_1I: a matrix whose two rows are multiples of each other, so one row is enough.

Hint

c1x1+c2x2=u(0)c_1x_1 + c_2x_2 = u(0) is two equations for c1c_1 and c2c_2. Then each cixic_i x_i is multiplied by its own eλite^{\lambda_it}.

Solution

The idea. Eigenvectors from the nullspaces, constants from u(0)u(0), and then each piece grows or decays with its own exponential.

The eigenvectors

A+I=(−212−1)A + I = \begin{pmatrix} -2 & 1 \\ 2 & -1 \end{pmatrix}: the first row says −2x+y=0-2x + y = 0, so x1=(1,2)x_1 = (1, 2). A+4I=(1122)A + 4I = \begin{pmatrix} 1 & 1 \\ 2 & 2 \end{pmatrix}: x+y=0x + y = 0, so x2=(1,−1)x_2 = (1, -1).

The constants

c1(1,2)+c2(1,−1)=(3,0)c_1(1, 2) + c_2(1, -1) = (3, 0) means c1+c2=3c_1 + c_2 = 3 and 2c1−c2=02c_1 - c_2 = 0. Adding, 3c1=33c_1 = 3: so c1=1c_1 = 1 and c2=2c_2 = 2.

The solution

Solution of Problem 1
u(t)=e−t(12)+2e−4t(1−1)=(e−t+2e−4t2e−t−2e−4t)u(t) = e^{-t}\begin{pmatrix} 1 \\ 2 \end{pmatrix} + 2e^{-4t}\begin{pmatrix} 1 \\ -1 \end{pmatrix} = \begin{pmatrix} e^{-t} + 2e^{-4t} \\ 2e^{-t} - 2e^{-4t} \end{pmatrix}
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

Source: 18.06 Lecture 23 transcript (Prof. Strang), p. 5 (the general solution; the numbers are our own)

So u2(t)=2e−t−2e−4tu_2(t) = 2e^{-t} - 2e^{-4t}.

Check

At t=0t = 0: u=(1+2,2−2)=(3,0)u = (1 + 2, 2 - 2) = (3, 0). And du2/dt=−2e−t+8e−4tdu_2/dt = -2e^{-t} + 8e^{-4t} should equal 2u1−2u2=2e−t+4e−4t−4e−t+4e−4t=−2e−t+8e−4t2u_1 - 2u_2 = 2e^{-t} + 4e^{-4t} - 4e^{-t} + 4e^{-4t} = -2e^{-t} + 8e^{-4t}. It does.

(c)4 points

u2u_2 starts at 0, rises and falls back to 0. At which time is it largest, and what is its largest value?

Hint

Set du2/dt=0du_2/dt = 0 and solve for e3te^{3t}.

Solution

The idea. A maximum of a smooth function is where its derivative is zero.

The time

du2/dt=−2e−t+8e−4t=0du_2/dt = -2e^{-t} + 8e^{-4t} = 0 gives e3t=4e^{3t} = 4:

Time of the maximum
t∗=ln⁡43≈0.4621t^* = \frac{\ln 4}{3} \approx 0.4621
In words

t star equals log 4 over 3 is approximately 0.4621

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 1(c) (our own solution)

The value

At t∗t^*, e−3t∗=14e^{-3t^*} = \frac14, so u2=2e−t∗(1−e−3t∗)=32e−t∗=32⋅4−1/3≈0.9449u_2 = 2e^{-t^*}(1 - e^{-3t^*}) = \frac32e^{-t^*} = \frac32 \cdot 4^{-1/3} \approx 0.9449.

The two components of the solution of Problem 1, computed from the formula: u1u_1 (solid) falls from 3, u2u_2 (dashed) rises from 0 to its largest value near t=0.46t = 0.46 and then decays with u1u_1.

Check

Before t∗t^* the term 8e−4t8e^{-4t} wins and u2u_2 rises; after it, −2e−t-2e^{-t} wins and u2u_2 falls. So the stationary point is a maximum.

(d)2 points

Show that u1(t)+u2(t)=3e−tu_1(t) + u_2(t) = 3e^{-t}, without using the solution, from the columns of AA. (This part has no box.)

Hint

Add the two equations du1/dt=…du_1/dt = \dots and du2/dt=…du_2/dt = \dots. What does each column of AA add up to?

Solution

The idea. The column sums of AA say how the total changes.

Adding the equations

du1/dt=−3u1+u2du_1/dt = -3u_1 + u_2 and du2/dt=2u1−2u2du_2/dt = 2u_1 - 2u_2. Their sum is d(u1+u2)/dt=−u1−u2d(u_1 + u_2)/dt = -u_1 - u_2, because each column of AA adds up to −1-1. So the total s=u1+u2s = u_1 + u_2 solves ds/dt=−sds/dt = -s with s(0)=3s(0) = 3, which gives s=3e−ts = 3e^{-t}.

Check

From part (b): (e−t+2e−4t)+(2e−t−2e−4t)=3e−t(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.)

Problem 2#

Problem

Stability from the trace and the determinant

16 points

For a real number aa, take

The matrix of Problem 2
A=(−2a1−3),dudt=AuA = \begin{pmatrix} -2 & a \\ 1 & -3 \end{pmatrix}, \qquad \frac{du}{dt} = Au
In words

capital A equals minus 2 a; 1 minus 3, d u over d t equals capital A u

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 2 (our own problem)

(a)3 points

Every solution goes to zero exactly when aa is below a certain number. Find it.

Hint

The trace does not depend on aa. What must the determinant do?

Solution

The idea. The 2×22 \times 2 test: trace negative and determinant positive.

The test

The trace is −5<0-5 < 0 for every aa. The determinant is 6−a6 - a, positive exactly when a<6a < 6. So the system is stable for a<6a < 6.

Check

At a=6a = 6 the determinant is zero, so one eigenvalue is 00 and the other is the trace −5-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≥0a \geq 0 the eigenvalues are real. Give the larger one as a formula in aa.

Hint

λ2−(trace⁡)λ+det⁡A=0\lambda^2 - (\operatorname{trace})\lambda + \det A = 0, solved with the quadratic formula. Simplify the term under the root.

Solution

The idea. The characteristic polynomial of a 2×22 \times 2 matrix comes from its trace and determinant.

The quadratic formula

Eigenvalues of the matrix of Problem 2
λ2+5λ+(6−a)=0,λ=−5±25−4(6−a)2=−5±1+4a2\lambda^2 + 5\lambda + (6 - a) = 0, \qquad \lambda = \frac{-5 \pm \sqrt{25 - 4(6 - a)}}{2} = \frac{-5 \pm \sqrt{1 + 4a}}{2}
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

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 2(b) (our own solution)

The larger one takes the plus sign.

Check

At a=0a = 0: (−5+1)/2=−2(-5 + 1)/2 = -2, the larger diagonal entry of the triangular matrix. At a=6a = 6: (−5+5)/2=0(-5 + 5)/2 = 0, as part (a) found.

(c)5 points

Now take a=−6.5a = -6.5. Find the real part of the eigenvalues and the positive imaginary part, and say what the solutions do.

Hint

With a=−6.5a = -6.5 the term under the root is negative: its square root is ii times the root of the positive number.

Hint

The size of eλte^{\lambda t} depends only on the real part of λ\lambda.

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=−251 + 4a = 1 - 26 = -25, so λ=(−5±5i)/2=−2.5±2.5i\lambda = (-5 \pm 5i)/2 = -2.5 \pm 2.5i.

The behaviour

Each pure solution contains e−2.5te±2.5ite^{-2.5t}e^{\pm 2.5it}. The factor e±2.5it=cos⁡2.5t±isin⁡2.5te^{\pm 2.5it} = \cos 2.5t \pm i\sin 2.5t has size 1 and turns; e−2.5te^{-2.5t} shrinks. So the solutions spiral in to zero.

Check

The trace and determinant test agrees: trace −5<0-5 < 0 and determinant 6+6.5=12.5>06 + 6.5 = 12.5 > 0. And (−2.5)2+2.52=12.5(-2.5)^2 + 2.5^2 = 12.5, the product of the two conjugate eigenvalues.

(d)3 points

For comparison, take B=(0−330)B = \begin{pmatrix} 0 & -3 \\ 3 & 0 \end{pmatrix} and du/dt=Budu/dt = Bu. Say what the solutions do. Then show that ∥u(t)∥2=u12+u22\|u(t)\|^2 = u_1^2 + u_2^2 never changes (this step has no box).

Hint

Trace 00: the stability test is on its border. Find the eigenvalues.

Hint

Differentiate u12+u22u_1^2 + u_2^2 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\lambda^2 + 9 = 0, so λ=±3i\lambda = \pm 3i. Since ∣e3it∣=1|e^{3it}| = 1, the solutions neither shrink nor grow: they circle at a fixed size.

The length

du1/dt=−3u2du_1/dt = -3u_2 and du2/dt=3u1du_2/dt = 3u_1, so

The length does not change
ddt(u12+u22)=2u1(−3u2)+2u2(3u1)=0\frac{d}{dt}\left(u_1^2 + u_2^2\right) = 2u_1(-3u_2) + 2u_2(3u_1) = 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

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 2(d) (our own solution)

Check

u(t)=(cos⁡3t,sin⁡3t)u(t) = (\cos 3t, \sin 3t) is a solution: its derivative (−3sin⁡3t,3cos⁡3t)(-3\sin 3t, 3\cos 3t) equals BuB u. Its length is always 1.

Problem 3#

Problem

The matrix exponential

14 points

Take the matrix

The matrix of Problem 3
A=(4−211)A = \begin{pmatrix} 4 & -2 \\ 1 & 1 \end{pmatrix}
In words

capital A equals 4 minus 2; 1 1

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 3 (our own problem)

(a)5 points

Write eAt=SeΛtS−1e^{At} = Se^{\Lambda t}S^{-1} and give its (1,2)(1, 2) entry, the entry in the first row and second column, as a formula in tt.

Hint

The trace is 5 and the determinant 6. Find both eigenvectors, put them in the columns of SS and invert the 2×22 \times 2 matrix SS.

Hint

eΛte^{\Lambda t} is diagonal with eλ1te^{\lambda_1t} and eλ2te^{\lambda_2t}. Multiply the three matrices in order.

Solution

The idea. Diagonalise AA; the exponential of the diagonal matrix is the diagonal of exponentials.

Eigenvalues and eigenvectors

λ2−5λ+6=(λ−2)(λ−3)\lambda^2 - 5\lambda + 6 = (\lambda - 2)(\lambda - 3), so λ1=2\lambda_1 = 2, λ2=3\lambda_2 = 3. A−2I=(2−21−1)A - 2I = \begin{pmatrix} 2 & -2 \\ 1 & -1 \end{pmatrix} gives x1=(1,1)x_1 = (1, 1); A−3I=(1−21−2)A - 3I = \begin{pmatrix} 1 & -2 \\ 1 & -2 \end{pmatrix} gives x2=(2,1)x_2 = (2, 1).

The three factors

S and its inverse
S=(1211),S−1=1−1(1−2−11)=(−121−1)S = \begin{pmatrix} 1 & 2 \\ 1 & 1 \end{pmatrix}, \qquad S^{-1} = \frac{1}{-1}\begin{pmatrix} 1 & -2 \\ -1 & 1 \end{pmatrix} = \begin{pmatrix} -1 & 2 \\ 1 & -1 \end{pmatrix}
In words

capital S equals 1 2; 1 1, capital S to the power minus 1 equals 1 over minus 1 1 minus 2; minus 1 1 equals minus 1 2; 1 minus 1

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 3(a) (our own solution)
The exponential of A
eAt=(1211)(e2t00e3t)(−121−1)=(−e2t+2e3t2e2t−2e3t−e2t+e3t2e2t−e3t)e^{At} = \begin{pmatrix} 1 & 2 \\ 1 & 1 \end{pmatrix}\begin{pmatrix} e^{2t} & 0 \\ 0 & e^{3t} \end{pmatrix}\begin{pmatrix} -1 & 2 \\ 1 & -1 \end{pmatrix} = \begin{pmatrix} -e^{2t} + 2e^{3t} & 2e^{2t} - 2e^{3t} \\ -e^{2t} + e^{3t} & 2e^{2t} - e^{3t} \end{pmatrix}
In words

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

Source: 18.06 Lecture 23 transcript (Prof. Strang), pp. 19–21 (the formula; the numbers are our own)

The (1,2)(1, 2) entry is 2e2t−2e3t2e^{2t} - 2e^{3t}.

Check

SS−1=(−1+22−2−1+12−1)=ISS^{-1} = \begin{pmatrix} -1 + 2 & 2 - 2 \\ -1 + 1 & 2 - 1 \end{pmatrix} = I. Part (b) checks the result itself.

(b)2 points

Check, from the series, that eAte^{At} must equal II at t=0t = 0 and that its derivative at t=0t = 0 must be AA. 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=0t = 0?

Solution

The idea. The first two terms of the series, I+AtI + At, decide the value and the slope at t=0t = 0.

From the series

At t=0t = 0 every term after II is zero. Differentiating term by term gives A+A2t+12A3t2+⋯A + A^2t + \frac12A^3t^2 + \cdots, which is AA at t=0t = 0. (In fact the derivative is AeAtAe^{At}, so u=eAtu(0)u = e^{At}u(0) solves du/dt=Audu/dt = Au.)

On the matrix

At t=0t = 0 the four entries are −1+2=1-1 + 2 = 1, 2−2=02 - 2 = 0, −1+1=0-1 + 1 = 0 and 2−1=12 - 1 = 1: the identity. Their derivatives at t=0t = 0 are −2+6=4-2 + 6 = 4, 4−6=−24 - 6 = -2, −2+3=1-2 + 3 = 1 and 4−3=14 - 3 = 1: the matrix AA.

(c)3 points

Find the (1,1)(1, 1) entry of eAte^{At} at t=0.5t = 0.5.

Hint

Put t=0.5t = 0.5 into the (1,1)(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.5t = 0.5
−e1+2e1.5≈−2.7183+8.9634=6.2451-e^{1} + 2e^{1.5} \approx -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

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 3(c) (our own solution)

Check

The trace of eAte^{At} is e2t+e3te^{2t} + e^{3t}, the sum of its eigenvalues. At t=0.5t = 0.5 the diagonal of part (a) gives 6.2451+(2e−e1.5)=6.2451+0.9549=7.20006.2451 + (2e - e^{1.5}) = 6.2451 + 0.9549 = 7.2000, and e+e1.5=2.7183+4.4817=7.2000e + e^{1.5} = 2.7183 + 4.4817 = 7.2000.

(d)4 points

Compare the two series of the lecture for this AA and t>0t > 0. For which tt does the exponential series I+At+(At)2/2+⋯I + At + (At)^2/2 + \cdots converge? And up to which tt does the geometric series I+At+(At)2+⋯I + At + (At)^2 + \cdots converge?

Hint

The eigenvalues of AtAt are tt times the eigenvalues of AA.

Solution

The idea. Factorials make the exponential series converge always; the geometric series needs every eigenvalue of AtAt below 1 in size.

The exponential series

The nn-th term is (At)n/n!(At)^n/n!, and n!n! grows faster than any power: the series converges for every AA and every tt (Lecture 23 transcript, p. 18).

The geometric series

The eigenvalues of AtAt are 2t2t and 3t3t. Both are below 1 when 3t<13t < 1, so the geometric series converges for 0<t<13≈0.33330 < t < \frac13 \approx 0.3333. (Stopping at 2t<12t < 1, that is t<12t < \frac12, forgets the larger eigenvalue.)

Check

At t=13t = \frac13 the matrix I−AtI - At has the eigenvalue 1−3⋅13=01 - 3 \cdot \frac13 = 0: it is singular, so (I−At)−1(I - At)^{-1} does not even exist there.

Problem 4#

Problem

A third-order equation as a system

12 points

Take the third-order equation

The equation of Problem 4
y(3)−2y′′−y′+2y=0y^{(3)} - 2y'' - y' + 2y = 0
In words

y to the power (3) minus 2 y double prime minus y prime plus 2 y equals 0

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 4 (our own problem)

Here y(3)y^{(3)} is the third derivative of yy.

(a)4 points

Write it as du/dt=Cudu/dt = Cu with u=(y′′,y′,y)u = (y'', y', y), as in the lecture. Give the entries c11c_{11} and c13c_{13} of the 3×33 \times 3 matrix CC.

Hint

The top row of du/dtdu/dt is the third derivative y(3)y^{(3)}: solve the equation for it. The other two rows are trivial equations.

Solution

The idea. The equation itself goes in the top row; y′′=y′′y'' = y'' and y′=y′y' = y' fill the rows below.

The matrix

y(3)=2y′′+y′−2yy^{(3)} = 2y'' + y' - 2y, so

The first-order form of Problem 4
ddt(y′′y′y)=(21−2100010)(y′′y′y)\frac{d}{dt}\begin{pmatrix} y'' \\ y' \\ y \end{pmatrix} = \begin{pmatrix} 2 & 1 & -2 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{pmatrix}\begin{pmatrix} y'' \\ y' \\ y \end{pmatrix}
In words

d over d t y double prime; y prime; y equals 2 1 minus 2; 1 0 0; 0 1 0 y double prime; y prime; y

Source: 18.06 Lecture 23 transcript (Prof. Strang), p. 23 (the method; the third-order matrix is our own)

So c11=2c_{11} = 2 and c13=−2c_{13} = -2.

Check

The second row says d(y′)/dt=y′′d(y')/dt = y'' and the third dy/dt=y′dy/dt = y', both true. The ones sit just below the diagonal, as in the lecture's description.

(b)4 points

Show that det⁡(C−λI)=−(λ3−2λ2−λ+2)\det(C - \lambda I) = -(\lambda^3 - 2\lambda^2 - \lambda + 2) (this step has no box). Then find the largest eigenvalue of CC.

Hint

Expand the determinant along the first row. For the roots, try small whole numbers.

Solution

The idea. The eigenvalues of this matrix are the roots of the equation's own polynomial: try y=eλty = e^{\lambda t} and you get the same polynomial.

The determinant

Determinant along the first row
det⁡(2−λ1−21−λ001−λ)=(2−λ)λ2−1⋅(−λ)+(−2)⋅1=−λ3+2λ2+λ−2\det\begin{pmatrix} 2 - \lambda & 1 & -2 \\ 1 & -\lambda & 0 \\ 0 & 1 & -\lambda \end{pmatrix} = (2 - \lambda)\lambda^2 - 1\cdot(-\lambda) + (-2)\cdot 1 = -\lambda^3 + 2\lambda^2 + \lambda - 2
In words

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

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 4(b) (our own solution)

The roots

λ3−2λ2−λ+2=λ2(λ−2)−(λ−2)=(λ−2)(λ−1)(λ+1)\lambda^3 - 2\lambda^2 - \lambda + 2 = \lambda^2(\lambda - 2) - (\lambda - 2) = (\lambda - 2)(\lambda - 1)(\lambda + 1). The eigenvalues are 22, 11 and −1-1; the largest is 22.

Check

Their sum 2+1−1=22 + 1 - 1 = 2 is the trace of CC, and their product −2-2 is det⁡C\det C (put λ=0\lambda = 0 in the determinant).

(c)4 points

Two eigenvalues are positive, so most solutions blow up. Take y(0)=1y(0) = 1 and y′(0)=−1y'(0) = -1. For which value of y′′(0)y''(0) does y(t)y(t) go to zero as t→∞t \to \infty?

Hint

y(t)y(t) is a combination of eλte^{\lambda 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−ty(t) = \alpha e^{2t} + \beta e^{t} + \gamma e^{-t}. For y→0y \to 0 we need α=β=0\alpha = \beta = 0, so y=γe−ty = \gamma e^{-t}. Then y(0)=γ=1y(0) = \gamma = 1, and y′(0)=−1y'(0) = -1 holds already. So y=e−ty = e^{-t} and y′′(0)=1y''(0) = 1.

Check

In general the three starting values give α+β+γ=1\alpha + \beta + \gamma = 1, 2α+β−γ=−12\alpha + \beta - \gamma = -1 and 4α+β+γ=y′′(0)4\alpha + \beta + \gamma = y''(0). The first and third give 3α=y′′(0)−13\alpha = y''(0) - 1, and the first two give 3α+2β=03\alpha + 2\beta = 0. Both α\alpha and β\beta vanish exactly when y′′(0)=1y''(0) = 1.

Problem 5#

Problem

Two regions

16 points

Each year 0.80.8 of the people in region P stay and 0.20.2 move to region Q; 0.70.7 of the people in Q stay and 0.30.3 move to P. Nobody arrives from outside or leaves. At the start (year 0) region P has 10001000 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)u_k = (\text{people in P}, \text{people in Q}) in year kk,

The model of Problem 5
uk+1=Auk,A=(0.80.30.20.7),u0=(10000)u_{k+1} = Au_k, \qquad A = \begin{pmatrix} 0.8 & 0.3 \\ 0.2 & 0.7 \end{pmatrix}, \qquad u_0 = \begin{pmatrix} 1000 \\ 0 \end{pmatrix}
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

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 5 (our own problem)

(a)4 points

AA is a Markov matrix, so one eigenvalue is 1. Find the other, and choose the eigenvector for λ=1\lambda = 1.

Hint

The two eigenvalues add up to the trace.

Solution

The idea. For a Markov matrix, λ=1\lambda = 1 is known; the trace gives the other eigenvalue at once.

The eigenvalues

The trace is 1.51.5, so the other eigenvalue is 1.5−1=0.51.5 - 1 = 0.5. The determinant agrees: 0.56−0.06=0.5=1⋅0.50.56 - 0.06 = 0.5 = 1 \cdot 0.5.

The eigenvectors

A−I=(−0.20.30.2−0.3)A - I = \begin{pmatrix} -0.2 & 0.3 \\ 0.2 & -0.3 \end{pmatrix}: −0.2x+0.3y=0-0.2x + 0.3y = 0, so x1=(3,2)x_1 = (3, 2), with no negative component, as the lecture says it must be. A−0.5I=(0.30.30.20.2)A - 0.5I = \begin{pmatrix} 0.3 & 0.3 \\ 0.2 & 0.2 \end{pmatrix} gives x2=(1,−1)x_2 = (1, -1).

Check

A(3,2)=(2.4+0.6,0.6+1.4)=(3,2)A(3, 2) = (2.4 + 0.6, 0.6 + 1.4) = (3, 2). The vector (1,1)(1, 1) is the eigenvector of ATA^T for λ=1\lambda = 1, not of AA (Lecture 24 transcript, p. 8).

(b)3 points

Show that the total number of people stays 10001000 (this step has no box). How many people live in P in the steady state?

Hint

What does each column of AA add up to? The steady state is the multiple of x1x_1 with the right total.

Solution

The idea. Columns adding to 1 conserve the total; the steady state is the eigenvector for λ=1\lambda = 1 with that total.

The total

Each column of AA adds up to 1: of the people in P, the fractions 0.80.8 and 0.20.2 are found again in P and Q, and of the people in Q, 0.3+0.7=10.3 + 0.7 = 1. So the total in year k+1k + 1 equals the total in year kk, and it stays 10001000.

The steady state

The multiple of (3,2)(3, 2) with total 10001000 is 200⋅(3,2)=(600,400)200 \cdot (3, 2) = (600, 400): 600600 people in P.

Check

A(600,400)=(480+120,120+280)=(600,400)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 kk as a formula in kk.

Hint

Write u0=c1x1+c2x2u_0 = c_1x_1 + c_2x_2; then uk=c1x1+c2λ2kx2u_k = c_1x_1 + c_2\lambda_2^kx_2, with λ2\lambda_2 from part (a).

Solution

The idea. Expand u0u_0 in eigenvectors; each part is multiplied by its own eigenvalue every year.

The constants

c1(3,2)+c2(1,−1)=(1000,0)c_1(3, 2) + c_2(1, -1) = (1000, 0): 3c1+c2=10003c_1 + c_2 = 1000 and 2c1−c2=02c_1 - c_2 = 0. Adding, 5c1=10005c_1 = 1000, so c1=200c_1 = 200 and c2=400c_2 = 400.

The solution

Population in year k
uk=200(32)+400 (0.5)k(1−1)=(600+400 (0.5)k400−400 (0.5)k)u_k = 200\begin{pmatrix} 3 \\ 2 \end{pmatrix} + 400\,(0.5)^k\begin{pmatrix} 1 \\ -1 \end{pmatrix} = \begin{pmatrix} 600 + 400\,(0.5)^k \\ 400 - 400\,(0.5)^k \end{pmatrix}
In words

u sub k equals 200 3; 2 plus 400 (0.5) to the power k 1; minus 1 equals 600 plus 400 (0.5) to the power k; 400 minus 400 (0.5) to the power k

Source: 18.06 Lecture 24 transcript (Prof. Strang), p. 3 (the expansion; the numbers are our own)

Check

At k=0k = 0: (1000,0)(1000, 0). At k=1k = 1: (800,200)(800, 200), and directly A(1000,0)=(800,200)A(1000, 0) = (800, 200).

(d)4 points

In which year does the population of region P first fall below 610610?

Hint

Use your formula from part (c) and find the first whole kk for which it falls below 610.

Solution

The idea. The distance to the steady state halves every year.

The inequality

400(0.5)k<10400(0.5)^k < 10 means 2k>402^k > 40, so k>log⁡240≈5.32k > \log_2 40 \approx 5.32. The first whole year is k=6k = 6.

Check

Year 5: 600+400/32=612.5600 + 400/32 = 612.5. Year 6: 600+400/64=606.25600 + 400/64 = 606.25.

Problem 6#

Problem

Three clubs

14 points

Members move between three clubs every year by the Markov matrix

The matrix of Problem 6
A=(0.40.20.20.30.60.10.30.20.7)A = \begin{pmatrix} 0.4 & 0.2 & 0.2 \\ 0.3 & 0.6 & 0.1 \\ 0.3 & 0.2 & 0.7 \end{pmatrix}
In words

capital A equals 0.4 0.2 0.2; 0.3 0.6 0.1; 0.3 0.2 0.7

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 6 (our own problem)

(a)3 points

Show that (1,1,1)(1, 1, 1) is an eigenvector of ATA^T, and explain why this makes λ=1\lambda = 1 an eigenvalue of AA. (This part has no box.)

Hint

The rows of ATA^T are the columns of AA.

Solution

The idea. Column sums of AA are row sums of ATA^T, and AA and ATA^T share their eigenvalues.

The eigenvector of the transpose

Each entry of AT(1,1,1)A^T(1, 1, 1) is the sum of one column of AA: 0.4+0.3+0.30.4 + 0.3 + 0.3, 0.2+0.6+0.20.2 + 0.6 + 0.2 and 0.2+0.1+0.70.2 + 0.1 + 0.7, each equal to 1. So AT(1,1,1)=(1,1,1)A^T(1, 1, 1) = (1, 1, 1).

Back to A

det⁡(A−λI)=det⁡(AT−λI)\det(A - \lambda I) = \det(A^T - \lambda I), so AA has the same eigenvalue 11, though with a different eigenvector (Lecture 24 transcript, pp. 7–8).

(b)4 points

Find the other two eigenvalues of AA.

Hint

The three eigenvalues add up to the trace and multiply to det⁡A\det A. One of them is 1.

Solution

The idea. Knowing λ1=1\lambda_1 = 1, the trace and the determinant leave a quadratic for the other two.

Trace and determinant

The trace is 0.4+0.6+0.7=1.70.4 + 0.6 + 0.7 = 1.7, so λ2+λ3=0.7\lambda_2 + \lambda_3 = 0.7. Along the first row,

Determinant of the matrix of Problem 6
det⁡A=0.4(0.42−0.02)−0.2(0.21−0.03)+0.2(0.06−0.18)=0.16−0.036−0.024=0.1\det A = 0.4(0.42 - 0.02) - 0.2(0.21 - 0.03) + 0.2(0.06 - 0.18) = 0.16 - 0.036 - 0.024 = 0.1
In words

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

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 6(b) (our own solution)

so λ2λ3=0.1\lambda_2\lambda_3 = 0.1.

The quadratic

λ2−0.7λ+0.1=(λ−0.5)(λ−0.2)=0\lambda^2 - 0.7\lambda + 0.1 = (\lambda - 0.5)(\lambda - 0.2) = 0: the other eigenvalues are 0.50.5 and 0.20.2, both below 1 in size.

Check

A−0.5IA - 0.5I has rows (−0.1,0.2,0.2)(-0.1, 0.2, 0.2), (0.3,0.1,0.1)(0.3, 0.1, 0.1) and (0.3,0.2,0.2)(0.3, 0.2, 0.2): its last two columns are equal, so it is singular.

(c)4 points

The three clubs have 20002000 members together. How many does each have in the steady state? Give the second and third club.

Hint

Solve (A−I)x=0(A - I)x = 0. Two of its rows are enough; then scale xx to the total 2000.

Solution

The idea. The steady state is the eigenvector for λ=1\lambda = 1, scaled to the conserved total.

The eigenvector

A−IA - I has rows (−0.6,0.2,0.2)(-0.6, 0.2, 0.2), (0.3,−0.4,0.1)(0.3, -0.4, 0.1) and (0.3,0.2,−0.3)(0.3, 0.2, -0.3). Times 10, the first two rows say −6x+2y+2z=0-6x + 2y + 2z = 0 and 3x−4y+z=03x - 4y + z = 0. Twice the second added to the first gives −6y+4z=0-6y + 4z = 0, so z=32yz = \frac32y; then 6x=2y+3y6x = 2y + 3y, so x=56yx = \frac56y. With y=6y = 6: x1=(5,6,9)x_1 = (5, 6, 9).

The steady state

5+6+9=205 + 6 + 9 = 20, so scale by 100100: (500,600,900)(500, 600, 900).

Check

The third row: 0.3⋅500+0.2⋅600+0.7⋅900=150+120+630=9000.3 \cdot 500 + 0.2 \cdot 600 + 0.7 \cdot 900 = 150 + 120 + 630 = 900. Starting from any distribution of the 2000 members, the parts along the other eigenvectors shrink like 0.5k0.5^k and 0.2k0.2^k.

(d)3 points

An exceptional case: the matrix P=(0110)P = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} is also a Markov matrix. Start from u0=(1,0)u_0 = (1, 0) and say what uk=Pku0u_k = P^ku_0 does.

Hint

Find both eigenvalues of PP. Is the second one below 1 in size?

Solution

The idea. The steady state is reached only when every other eigenvalue has ∣λ∣<1|\lambda| < 1.

The eigenvalues

λ2−1=0\lambda^2 - 1 = 0: λ=1\lambda = 1 with x1=(1,1)x_1 = (1, 1) and λ=−1\lambda = -1 with x2=(1,−1)x_2 = (1, -1). Here ∣λ2∣=1|\lambda_2| = 1, the exceptional case of the lecture.

The powers

u0=12(1,1)+12(1,−1)u_0 = \frac12(1, 1) + \frac12(1, -1), so uk=12(1,1)+12(−1)k(1,−1)u_k = \frac12(1, 1) + \frac12(-1)^k(1, -1): (1,0)(1, 0) for even kk and (0,1)(0, 1) for odd kk. It flips for ever and never settles.

Check

PP simply swaps the two components: P(1,0)=(0,1)P(1, 0) = (0, 1) and P(0,1)=(1,0)P(0, 1) = (1, 0). Only a start at (0.5,0.5)(0.5, 0.5), a multiple of x1x_1, stays put.

Problem 7#

Problem

Coefficients in an orthogonal basis

12 points

Take the four vectors q1=12(1,1,1,1)q_1 = \frac12(1, 1, 1, 1), q2=12(1,1,−1,−1)q_2 = \frac12(1, 1, -1, -1), q3=12(1,−1,1,−1)q_3 = \frac12(1, -1, 1, -1), q4=12(1,−1,−1,1)q_4 = \frac12(1, -1, -1, 1) in four-dimensional space, and the square wave

The square wave of Problem 7
f(x)={1,0<x<π−1,π<x<2πf(x) = \begin{cases} 1, & 0 < x < \pi \\ -1, & \pi < x < 2\pi \end{cases}
In words

f(x) equals 1, when 0 less than x less than pi; or minus 1, when pi less than x less than 2 pi

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 7 (our own problem)

(a)5 points

Check that q1,…,q4q_1, \dots, q_4 are orthonormal (this check has no box). Write v=(3,1,2,−2)v = (3, 1, 2, -2) as x1q1+x2q2+x3q3+x4q4x_1q_1 + x_2q_2 + x_3q_3 + x_4q_4 and find x3x_3 and x4x_4.

Hint

No equations to solve: one dot product for each coefficient.

Solution

The idea. In an orthonormal basis each coefficient is a dot product, xi=qiTvx_i = q_i^Tv.

Orthonormal

Each qiq_i has four entries ±12\pm\frac12, so qiTqi=4⋅14=1q_i^Tq_i = 4 \cdot \frac14 = 1. Any two different ones agree in sign in two places and differ in two, so qiTqj=14(1+1−1−1)=0q_i^Tq_j = \frac14(1 + 1 - 1 - 1) = 0.

The coefficients

x3=q3Tv=12(3−1+2+2)=3x_3 = q_3^Tv = \frac12(3 - 1 + 2 + 2) = 3 and x4=q4Tv=12(3−1−2−2)=−1x_4 = q_4^Tv = \frac12(3 - 1 - 2 - 2) = -1.

Check

The other two are x1=12(3+1+2−2)=2x_1 = \frac12(3 + 1 + 2 - 2) = 2 and x2=12(3+1−2+2)=2x_2 = \frac12(3 + 1 - 2 + 2) = 2. In an orthonormal basis lengths are kept: x12+⋯+x42=4+4+9+1=18x_1^2 + \cdots + x_4^2 = 4 + 4 + 9 + 1 = 18, and ∥v∥2=9+1+4+4=18\|v\|^2 = 9 + 1 + 4 + 4 = 18.

(b)7 points

By the same steps that give a1a_1, find the coefficients b1b_1 of sin⁡x\sin x and b3b_3 of sin⁡3x\sin 3x in the Fourier series of the square wave.

Hint

Multiply the series by sin⁡x\sin x and integrate from 00 to 2π2\pi. Which term survives, and what is ∫02πsin⁡2x dx\int_0^{2\pi}\sin^2x\,dx?

Hint

Split each integral at x=πx = \pi, where ff changes sign.

Solution

The idea. The sines and cosines are orthogonal, so multiplying by sin⁡nx\sin nx and integrating leaves one term, bn∫02πsin⁡2nx dx=πbnb_n\int_0^{2\pi}\sin^2nx\,dx = \pi b_n.

The formula

As for a1a_1 in the lecture, with sin⁡nx\sin nx in place of cos⁡x\cos x:

Sine coefficients
bn=1π∫02πf(x)sin⁡nx dx=1π(∫0πsin⁡nx dx−∫π2πsin⁡nx dx)b_n = \frac{1}{\pi}\int_0^{2\pi} f(x)\sin nx\,dx = \frac{1}{\pi}\left(\int_0^{\pi}\sin nx\,dx - \int_{\pi}^{2\pi}\sin nx\,dx\right)
In words

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

Source: MIT 18.06 Lecture 24: Markov matrices; fourier series, Problem 7(b) (our own solution)

The two coefficients

∫0πsin⁡x dx=2\int_0^{\pi}\sin x\,dx = 2 and ∫π2πsin⁡x dx=−2\int_\pi^{2\pi}\sin x\,dx = -2, so b1=4/π≈1.2732b_1 = 4/\pi \approx 1.2732. For n=3n = 3: ∫0πsin⁡3x dx=23\int_0^\pi\sin 3x\,dx = \frac23 and ∫π2πsin⁡3x dx=−23\int_\pi^{2\pi}\sin 3x\,dx = -\frac23, so b3=43π≈0.4244b_3 = \frac{4}{3\pi} \approx 0.4244.

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 nn the two halves cancel: ∫0πsin⁡2x dx=0\int_0^\pi\sin 2x\,dx = 0, so b2=0b_2 = 0. The cosine coefficients are zero too: ∫0πcos⁡x dx=0=∫π2πcos⁡x dx\int_0^\pi\cos x\,dx = 0 = \int_\pi^{2\pi}\cos x\,dx, and the average a0a_0 of ff is 00.

Symbols on this page

Show the 83 symbols used here
α\alpha alpha.
In Problem 4(c), the amount of the pure solution for the largest eigenvalue in y(t). Say it: “alpha”.
β\beta beta.
In Problem 4(c), the amount of the pure solution for the middle eigenvalue in y(t). Say it: “beta” (sounds like “bay-ta or bee-ta”).
γ\gamma gamma.
In Problem 4(c), the amount of the pure solution for the negative eigenvalue in y(t). Say it: “gamma”.
λ\lambda lambda.
An eigenvalue of the matrix of a problem. Say it: “lambda”.
Λ\Lambda capital lambda.
The diagonal matrix of the eigenvalues of A. Say it: “capital lambda”.
π\pi pi.
The ratio of a circle's circumference to its diameter, π ≈ 3.14159. Say it: “pi”.
∞\infty infinity.
Infinity: larger than any number. Say it: “infinity”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
≤\le less than or equal.
Is less than or equal to. Say it: “is less than or equal to”.
≥\ge greater than or equal.
Is greater than or equal to. Say it: “is greater than or equal to”.
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
±\pm plus or minus.
Plus or minus: both signs, or an uncertainty (67.3 ± 1.2). Say it: “plus or minus”.
×\times times.
Times (multiplication). Between two vectors: the cross product. Say it: “times”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
∫\int integral.
Integral: the sum of infinitely many small pieces, such as the area under a curve. Say it: “the integral of”.
det⁡\det determinant.
Determinant of a matrix. Say it: “the determinant of”.
sin⁡\sin sine.
Sine of an angle. Say it: “sine”.
cos⁡\cos cosine.
Cosine of an angle. Say it: “cos”.
ln⁡\ln natural logarithm.
Natural logarithm (base e ≈ 2.718). Say it: “log”.
log⁡\log logarithm.
Logarithm; log₁₀ is the base-10 logarithm. Say it: “log”.
aa a.
The real parameter in the matrix of Problem 2. Say it: “a”.
zz z.
In Problem 6(c), the third component of the unknown eigenvector. Say it: “z”.
cc c.
The vector of the constants c₁, …, cₙ, found from Sc = u(0). Say it: “c”.
kk k.
In y″ + by′ + ky = 0, the coefficient of y; in a Markov chain, the number of steps (in Problem 5, the year). Say it: “k”.
TT T.
The transpose: Aᵀ, or a row vector such as qᵢᵀ. Say it: “capital T”.
xx x.
The variable of the functions in a Fourier series; in Problems 1, 5 and 6, the first component of an unknown eigenvector. Say it: “x”.
yy y.
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”.
tt t.
Time, the variable of the differential equations. Say it: “t”.
dd d.
The d of a derivative, as in du/dt. Say it: “d”.
ii i.
The imaginary unit, i² = −1; as a subscript, the number of an eigenvalue, eigenvector or basis vector. Say it: “i”.
nn n.
The size of an n × n matrix or of n-dimensional space; in a Fourier series, the n of cos nx and sin nx. Say it: “n”.
ee e.
The base of natural logarithms, about 2.718. Say it: “e”.
ff f.
A function on [0, 2π] written as a Fourier series; in Problem 7, the square wave. Say it: “f”.
gg g.
A second function in the inner product of functions. Say it: “g”.
vv v.
The vector expanded in an orthonormal basis (in Problem 7, given in its statement). Say it: “v”.
PP P.
The 2 × 2 Markov matrix of Problem 6(d), given in its statement. Say it: “capital P”.
AA A.
The matrix of each problem, given in its statement (in What you need, any square matrix of the kind named there). Say it: “capital A”.
BB B.
The 2 × 2 matrix of Problem 2(d), given in its statement. Say it: “capital B”.
CC C.
The 3 × 3 matrix of the first-order form of the equation in Problem 4. Say it: “capital C”.
bb b.
The coefficient of y′ in the equation y″ + by′ + ky = 0. Say it: “b”.
ss s.
In Problem 1(d), the total u₁ + u₂. Say it: “s”.
SS S.
The eigenvector matrix: the eigenvectors of A in its columns. Say it: “capital S”.
y′y' y prime.
The first derivative of y with respect to t. Say it: “y prime”.
a1a_{1} a one.
The coefficient of cos x in a Fourier series. Say it: “a one”.
a2a_{2} a two.
The coefficient of cos 2x in a Fourier series. Say it: “a two”.
uu u.
The unknown vector of each system du/dt = Au (in Problem 4, the vector (y″, y′, y)). Say it: “u”.
x1x_{1} x 1.
An eigenvector for the eigenvalue λ₁ (for a Markov matrix, the one for λ = 1); in an expansion v = x₁q₁ + ⋯, the coefficient of q₁. Say it: “x one”.
x2x_{2} x 2.
An eigenvector for the eigenvalue λ₂; in an expansion v = x₁q₁ + x₂q₂ + ⋯, the coefficient of q₂. Say it: “x two”.
x4x_{4} x four.
In Problem 7, the coefficient of q₄ in the expansion of v. Say it: “x four”.
a0a_{0} a nought.
The constant term of a Fourier series: the average value of f. Say it: “a nought”.
y′′y'' y double prime.
The second derivative of y with respect to t. Say it: “y double prime”.
xnx_{n} x n.
The eigenvector for λₙ; in an expansion in an orthonormal basis, the coefficient of qₙ. Say it: “x sub n”.
x3x_{3} x three.
In Problem 7, the coefficient of q₃ in the expansion of v. Say it: “x three”.
II I.
The identity matrix. Say it: “capital I”.
xix_{i} x i.
The eigenvector for λᵢ; in an expansion in an orthonormal basis, the coefficient of qᵢ. Say it: “x sub i”.
c1c_{1} c one.
The first constant of the general solution: the amount of the first eigenvector in the starting vector. Say it: “c one”.
c2c_{2} c two.
The second constant of the general solution: the amount of the second eigenvector in the starting vector. Say it: “c two”.
cic_{i} c i.
The constant multiplying the i-th pure exponential solution. Say it: “c sub i”.
u1u_{1} u one.
The first component of the solution u(t). Say it: “u one”.
u2u_{2} u two.
The second component of the solution u(t). Say it: “u two”.
b1b_{1} b 1.
The coefficient of sin x in a Fourier series. Say it: “b one”.
b2b_{2} b 2.
The coefficient of sin 2x in a Fourier series. Say it: “b two”.
b3b_{3} b 3.
The coefficient of sin 3x in a Fourier series. Say it: “b three”.
q1q_{1} q one.
The first vector of an orthonormal basis (in Problem 7, given in its statement). Say it: “q one”.
q2q_{2} q two.
The second vector of an orthonormal basis (in Problem 7, given in its statement). Say it: “q two”.
qiq_{i} q sub i.
The i-th vector of an orthonormal basis. Say it: “q sub i”.
qjq_{j} q sub j.
Another vector of the same orthonormal basis, with j different from i. Say it: “q sub j”.
q3q_{3} q three.
The third vector of the orthonormal basis of Problem 7. Say it: “q three”.
bnb_{n} b sub n.
The coefficient of sin nx in a Fourier series. Say it: “b sub n”.
cnc_{n} c sub n.
The last constant of the general solution, the amount of the n-th eigenvector. Say it: “c sub n”.
λ1\lambda_{1} lambda one.
The first eigenvalue of the matrix of a problem (for a Markov matrix, the eigenvalue 1). Say it: “lambda one”.
λ2\lambda_{2} lambda two.
The second eigenvalue of the matrix of a problem. Say it: “lambda two”.
λi\lambda_{i} lambda i.
The i-th eigenvalue of the matrix. Say it: “lambda i”.
qnq_{n} q n.
The last vector of an orthonormal basis of n-dimensional space. Say it: “q n”.
λn\lambda_{n} lambda n.
The last of the n eigenvalues of an n × n matrix. Say it: “lambda n”.
uku_{k} u k.
The vector after k steps of a Markov chain (in Problem 5, the people in P and in Q in year k). Say it: “u sub k”.
uk+1u_{k+1} u k plus 1.
The vector one step after uₖ. Say it: “u sub k plus 1”.
u0u_{0} u nought.
The starting vector of a Markov chain. Say it: “u nought”.
λ3\lambda_{3} lambda 3.
The third eigenvalue of the matrix of Problem 6. Say it: “lambda three”.
q4q_{4} q four.
The fourth vector of the orthonormal basis of Problem 7. Say it: “q four”.
c11c_{11} c one one.
The entry in the first row and first column of the matrix C of Problem 4. Say it: “c one one”.
c12c_{12} c one two.
In How to answer, an example of how entries are numbered: first row, second column. Say it: “c one two”.
c13c_{13} c one three.
The entry in the first row and third column of the matrix C of Problem 4. Say it: “c one three”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 47 words used here

Also used

differential equation.
An equation that links an unknown function to its derivatives; solving it means finding the function. Explained in Circular motion dynamics: worked problems.
Markov matrix.
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.
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.
eigenvalue.
A number λ for which a matrix turns some non-zero vector into λ times that vector, only stretching or shrinking it. Explained in Linear systems with constant coefficients: eigenvalues and eigenvectors.
diagonalise.
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.
symmetric.
Unchanged by some swap, reflection or turn; for an expression in two quantities, unchanged when they are exchanged. Explained in Introduction to Fourier series.
positive definite.
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.
matrix.
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.
MIT.
Massachusetts Institute of Technology: the university in Cambridge, USA, whose free courses this site rewrites.
eigenvector.
A non-zero vector that a matrix only stretches or shrinks without turning: multiplying it by the matrix gives a number times the same vector. Explained in Linear systems with constant coefficients: eigenvalues and eigenvectors.
general solution.
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.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
real part.
For a complex number a + bi, the ordinary number a. Explained in Differential equations and exp(At).
steady state.
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.
determinant.
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.
matrix exponential.
The matrix e^(At), defined by the exponential series with a matrix in place of a number; it solves x′ = Ax. Explained in The matrix exponential.
converge.
To settle towards a definite finite value: an integral, series or sequence converges when its partial results approach a limit. Explained in Improper integrals.
diagonal.
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.
geometric series.
A series where each term is x times the one before; for x between −1 and 1 the total is 1/(1 − x).
transpose.
The matrix made by writing the rows of a matrix as columns, flipping it across its main diagonal. Explained in Planes through three points, and matrices.
orthonormal basis.
A set of basis vectors that are all at right angles to each other and all of length one. Explained in Basis vectors, the metric and 4-momentum.
orthonormal.
Of a set of vectors: each has length one and each is at right angles to all the others. Explained in Projection matrices and least squares.
dot product.
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.
inner product.
A rule that gives a number from two vectors, generalising the dot product, from which lengths and angles are defined. Explained in Complex matrices and the fast Fourier transform.
orthogonal.
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.
integration.
Finding an integral: adding up very many small pieces, or finding an antiderivative. Explained in Differentials and antiderivatives.
characteristic polynomial.
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.
nullspace.
All the vectors x that a matrix sends to zero, that is, all solutions of Ax = 0. Explained in Column space and nullspace.
derivative.
The rate at which a function changes as its input changes: the slope of its graph at a point. Explained in Position and velocity in one dimension.
stable.
Of a state or motion: a small disturbance stays small or dies away, so the system remains close to it. Explained in Torque and balance.
triangular matrix.
A square matrix with only zeros below its diagonal (upper triangular) or only zeros above it (lower triangular). Explained in Elimination with matrices.
stability.
Whether a state or solution returns after a small disturbance (stable) or moves further and further from it (unstable). Explained in Autonomous equations, critical points and stability.
differentiation.
Finding a derivative: working out how fast a function changes. Explained in The derivative: slope of the tangent line and rate of change.
factorial.
The product of all the whole numbers from 1 up to n, written n!; for example 4! = 24. Explained in The chain rule and higher derivatives.
singular.
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.
vector.
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.
conserved.
Keeping the same total value as time passes, as energy and momentum do when nothing outside changes them. Explained in Conservation of energy.
integral.
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.

Academic

problem set.
A weekly sheet of exercises that students work through and hand in, to practise what the lectures taught.
transcript.
A written record of exactly what was said in a recorded lecture, word for word.
citation.
A note saying exactly where a statement, number or formula comes from, so readers can check it.
on paper.
In theory or in a calculation, as opposed to in a real experiment or in reality.
significant.
Large enough to matter or to be noticed; in statistics, too large to put down to chance.
argument.
A chain of reasoning that leads to a conclusion; in maths also the input of a function, such as x in sin x.
blow up.
In maths, to grow without limit; to become infinite.
trivial.
So simple or obvious that it needs no argument; in maths, also the obvious zero solution.
vanish.
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).