Flow Lab

Syllabus / Module 1: Linear Algebra, Reloaded

Lesson 1.7

Complex Eigenvalues & Rotation

When eigenvalues are complex, the transformation rotates. Complex numbers, Euler's formula e^{iθ}, and spirals.

Written byClaude Opus

🌊
Why this matters for simulation: Vortices and oscillating wakes behind a cylinder show up as complex eigenvalues of the linearized flow.

By the end of this lesson you can…

  • Do complex arithmetic in both rectangular and polar form, and explain multiplication as rotate-and-scale.
  • Derive Euler's formula from Taylor series and use it to compute powers of complex numbers.
  • Compute the complex eigenvalues of a real 2×2 matrix from its trace and determinant, and read off the modulus r and angle θ.
  • Recognize rotation-scaling matrices and predict whether iterating a matrix spirals in, spirals out, or orbits.
  • Write a real matrix with complex eigenvalues in real form A = P C P⁻¹, with P = [Re v, Im v].
  • Explain why forward Euler spirals outward on an undamped oscillator, and how complex eigenvalues describe aircraft modes and vortex shedding.
On this page
·
  1. When eigenvectors disappear
  2. Complex numbers, refreshed
  3. Multiplication is rotate-and-scale
  4. Euler’s formula
  5. Complex eigenvalues of real matrices
  6. Worked example: eigenvalues from trace and determinant
  7. Rotation-scaling matrices
  8. Spirals from iterating a matrix
  9. The real form: A = P C P⁻¹
  10. Worked example: the full real form
  11. Preview: spirals in continuous time
  12. Experiments in code
  13. Key Takeaways

Run forward Euler on a frictionless pendulum and something unsettling happens: the pendulum swings a little higher every period, gaining energy from nowhere, until the simulation is visibly wrong. Or linearize the flight equations of an airliner and you find a slow, lazy oscillation in which the aircraft trades altitude for airspeed, again and again. Both behaviors are rotations, and the eigenvector machinery of 1.5 Eigenvectors & Eigenvalues and 1.6 Change of Basis & Diagonalization seems to break down on rotations: a matrix that turns the plane leaves no direction on its own line, so it has no real eigenvectors at all. The fix is to let the eigenvalues be complex numbers. Once we do, rotation, oscillation and spirals become just another eigenvalue story, and we can say exactly when a spiral grows or decays, and by how much per step.

▶ Video Part 1: why rotations need complex numbers, and Euler's formulacaptions only
Transcript
  1. Some matrices have no real eigenvectors at all. They rotate every direction. To understand them we need complex numbers, and the payoff is spirals.
  2. Here is a matrix that rotates the plane by sixty degrees. An eigenvector would have to stay on its own line. Watch the amber image as I sweep v around.
  3. It never lands back on the dashed line. Every direction gets turned, so there is no real eigenvector, and no real eigenvalue.
  4. The algebra agrees. The characteristic equation is lambda squared minus lambda plus one equals zero, and its discriminant is negative. The roots are complex.
  5. Quick refresher. A complex number a plus b i is just a point in the plane: a steps along the real axis, b steps up the imaginary axis. Here is three plus two i.
  6. Every complex number also has a length, the modulus r, and an angle, the argument theta. So we can write it in polar form: r times cosine theta plus i sine theta.
  7. The conjugate, z bar, flips the sign of the imaginary part. It is the mirror image across the real axis, with the same length and the opposite angle.
  8. Now the key fact. Multiplying by i turns one into i, and i into minus one. It rotates the entire plane by ninety degrees.
  9. Multiplying by one plus i does more. Its length is root two and its angle is forty five degrees, so it rotates the plane by forty five degrees and stretches it by root two.
  10. In general, multiplying by a complex number multiplies the lengths and adds the angles. Every complex multiplication is a rotation combined with a scaling.
  11. And here is the bridge to matrices. Multiply a plus b i by x plus i y, and read off the real and imaginary parts. That is exactly the matrix a, minus b, b, a, acting on the vector x, y.
  12. The single most useful formula in this subject is Euler's formula: e to the i theta equals cosine theta plus i sine theta.
  13. As theta grows, the point e to the i theta walks around the unit circle at unit speed. Its shadow on the real axis is cosine, its shadow on the imaginary axis is sine.
  14. Why is it true? Take the Taylor series of e to the x from Calc Two and plug in i theta. Powers of i cycle through one, i, minus one, minus i.
  15. Collect the real terms and you get the cosine series. Collect the imaginary terms and you get the sine series. That is Euler's formula.
  16. So any complex number is r times e to the i theta, and multiplying by it scales by r and rotates by theta. Powers are easy: lambda to the n is r to the n, times e to the i n theta.
  17. Let's recap. A complex number is a point with a length and an angle. Multiplying by it rotates and scales the plane, and Euler's formula packs the angle into an exponential. In part two, we put this to work on real matrices and the spirals they make.

When eigenvectors disappear

Take the matrix that rotates the plane counterclockwise by an angle θ\theta:

R(θ)=[cos⁡θ−sin⁡θsin⁡θcos⁡θ].R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}.

Its columns are where ı^\hat\imath and ȷ^\hat\jmath land after turning by θ\theta (look back at 1.2 Matrices as Transformations if that reading of columns feels unfamiliar). Unless θ\theta is 00 or π\pi, every arrow gets knocked off its line, so there is no real eigenvector. The characteristic polynomial agrees:

det⁡(R−λI)=(cos⁡θ−λ)2+sin⁡2θ=λ2−2cos⁡θ λ+1.\det(R - \lambda I) = (\cos\theta - \lambda)^2 + \sin^2\theta = \lambda^2 - 2\cos\theta\,\lambda + 1 .

The discriminant is 4cos⁡2θ−4=−4sin⁡2θ4\cos^2\theta - 4 = -4\sin^2\theta, which is negative whenever sin⁡θ≠0\sin\theta \neq 0. The quadratic formula still produces roots, but they involve −1\sqrt{-1}:

λ=cos⁡θ±isin⁡θ.\lambda = \cos\theta \pm i \sin\theta .

We could declare “no eigenvalues” and move on. But those roots carry real information: cos⁡θ\cos\theta and sin⁡θ\sin\theta are right there. To read it, we need to be comfortable with complex numbers.

Complex numbers, refreshed

A complex number is z=a+biz = a + bi with a,ba, b real and i2=−1i^2 = -1. We call a=Re⁡za = \operatorname{Re} z the real part and b=Im⁡zb = \operatorname{Im} z the imaginary part. The key mental move: a complex number is a point in the plane, (a,b)(a, b), drawn in the complex plane with the real axis horizontal and the imaginary axis vertical. So 3+2i3 + 2i sits at (3,2)(3, 2), ii sits at (0,1)(0, 1) and −1-1 at (−1,0)(-1, 0).

Arithmetic. Addition is vector addition: (3+2i)+(1−4i)=4−2i(3 + 2i) + (1 - 4i) = 4 - 2i. Multiplication uses the distributive law and i2=−1i^2 = -1:

(a+bi)(c+di)=ac+adi+bci+bd i2=(ac−bd)+(ad+bc) i.(a + bi)(c + di) = ac + adi + bci + bd\,i^2 = (ac - bd) + (ad + bc)\,i .

Modulus and argument. Like any arrow, zz has a length and a direction. The modulus is ∣z∣=r=a2+b2|z| = r = \sqrt{a^2 + b^2}, and the argument θ=arg⁡z\theta = \arg z is the angle from the positive real axis, so a=rcos⁡θa = r\cos\theta and b=rsin⁡θb = r\sin\theta. This gives the polar form

z=r(cos⁡θ+isin⁡θ).z = r(\cos\theta + i \sin\theta).

For z=3+2iz = 3 + 2i: r=13≈3.606r = \sqrt{13} \approx 3.606 and θ=arctan⁡(2/3)≈33.7∘\theta = \arctan(2/3) \approx 33.7^\circ. (Watch the quadrant: −3−2i-3 - 2i has the same ratio b/ab/a but θ≈213.7∘\theta \approx 213.7^\circ. In code, use atan2(b, a).)

Conjugate. The conjugate zˉ=a−bi\bar z = a - bi is the mirror image across the real axis: same modulus, opposite angle. Two facts make it useful:

zzˉ=(a+bi)(a−bi)=a2+b2=∣z∣2,1z=zˉ∣z∣2.z\bar z = (a+bi)(a-bi) = a^2 + b^2 = |z|^2, \qquad \frac{1}{z} = \frac{\bar z}{|z|^2}.

The second is how you divide: 11+i=1−i2\dfrac{1}{1 + i} = \dfrac{1 - i}{2}.

Multiplication is rotate-and-scale

Here is the fact that makes everything in this lesson work. Multiply two numbers in polar form:

r1(cos⁡θ1+isin⁡θ1)⋅r2(cos⁡θ2+isin⁡θ2)=r1r2[(cos⁡θ1cos⁡θ2−sin⁡θ1sin⁡θ2)+i(sin⁡θ1cos⁡θ2+cos⁡θ1sin⁡θ2)]=r1r2[cos⁡(θ1+θ2)+isin⁡(θ1+θ2)].\begin{aligned} r_1(\cos\theta_1 + i\sin\theta_1)\cdot r_2(\cos\theta_2 + i\sin\theta_2) &= r_1 r_2\big[(\cos\theta_1\cos\theta_2 - \sin\theta_1\sin\theta_2) + i(\sin\theta_1\cos\theta_2 + \cos\theta_1\sin\theta_2)\big] \\ &= r_1 r_2\big[\cos(\theta_1 + \theta_2) + i \sin(\theta_1 + \theta_2)\big]. \end{aligned}

The trig addition formulas from precalculus did all the work. So:

Now write that multiplication as a matrix. If w=a+biw = a + bi and z=x+iyz = x + iy, then wz=(ax−by)+i(bx+ay)wz = (ax - by) + i(bx + ay), which in vector form is

[ax−bybx+ay]=[a−bba][xy].\begin{bmatrix} ax - by \\ bx + ay \end{bmatrix} = \begin{bmatrix} a & -b \\ b & a \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix}.

Multiplication by the complex number a+bia + bi is the real linear map with matrix [a−bba]\begin{bmatrix} a & -b \\ b & a \end{bmatrix}. Keep this matrix in mind; it’s the star of the rest of the lesson.

✅ Concept check

Multiplying every complex number by $w = 2i$ does what to the complex plane?

Euler’s formula

Polar form is clumsy to write. Euler’s formula packs it into one exponential:

There are two good ways to see why this is the right definition of an exponential with an imaginary exponent.

Reason 1: Taylor series (from Calc II). You know

ex=1+x+x22!+x33!+x44!+⋯ ,cos⁡x=1−x22!+x44!−⋯ ,sin⁡x=x−x33!+x55!−⋯e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \cdots, \quad \cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots, \quad \sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots

Plug x=iθx = i\theta into the exponential series. The powers of ii cycle through i,−1,−i,1i, -1, -i, 1:

eiθ=1+iθ−θ22!−iθ33!+θ44!+iθ55!−⋯=(1−θ22!+θ44!−⋯)+i(θ−θ33!+θ55!−⋯).e^{i\theta} = 1 + i\theta - \frac{\theta^2}{2!} - i\frac{\theta^3}{3!} + \frac{\theta^4}{4!} + i\frac{\theta^5}{5!} - \cdots = \Big(1 - \frac{\theta^2}{2!} + \frac{\theta^4}{4!} - \cdots\Big) + i\Big(\theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} - \cdots\Big).

The real terms form the cosine series and the imaginary terms form the sine series. (The series converge absolutely for every θ\theta, so regrouping is legal.)

Reason 2: motion on a circle. The defining property of ekte^{kt} is ddtekt=k ekt\frac{d}{dt}e^{kt} = k\,e^{kt}. Ask for that with k=ik = i: a point z(θ)z(\theta) with z(0)=1z(0) = 1 whose velocity is z′(θ)=i z(θ)z'(\theta) = i\,z(\theta). Multiplying by ii rotates by 90∘90^\circ, so the velocity is always perpendicular to the position, and it has the same length. Motion that is always perpendicular to the radius is motion on a circle. Starting at 11 with unit speed, after time θ\theta you’ve gone arc length θ\theta around the unit circle, which puts you at (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta). As θ\theta grows, eiθe^{i\theta} goes around the unit circle; its shadow on the real axis is cos⁡θ\cos\theta and its shadow on the imaginary axis is sin⁡θ\sin\theta.

Consequences. Every complex number can be written z=reiθz = re^{i\theta}, and the multiplication rule becomes the law of exponents:

r1eiθ1⋅r2eiθ2=r1r2 ei(θ1+θ2),(reiθ)n=rneinθ(de Moivre).r_1 e^{i\theta_1}\cdot r_2 e^{i\theta_2} = r_1 r_2\, e^{i(\theta_1 + \theta_2)}, \qquad (re^{i\theta})^n = r^n e^{in\theta} \quad \text{(de Moivre)}.

Powers are easy in polar form: raise the modulus to the nnth power and multiply the angle by nn. Adding eiθe^{i\theta} and e−iθe^{-i\theta} also gives the handy formulas cos⁡θ=12(eiθ+e−iθ)\cos\theta = \tfrac12(e^{i\theta} + e^{-i\theta}) and sin⁡θ=12i(eiθ−e−iθ)\sin\theta = \tfrac{1}{2i}(e^{i\theta} - e^{-i\theta}), which turn trig identities into algebra.

✏️ Pen & paperComplex arithmetic warm-up●○○

Let z=1+i3z = 1 + i\sqrt3 and w=2iw = 2i.

  1. Find ∣z∣|z|, arg⁡z\arg z, and write zz in the form reiθre^{i\theta}. Do the same for ww.
  2. Compute zwzw in polar form, then convert to a+bia + bi. Check by multiplying directly.
  3. Compute zˉ\bar z and 1/z1/z.
  4. Compute z6z^6 without expanding.
Show worked solution
  1. ∣z∣=1+3=2|z| = \sqrt{1 + 3} = 2 and arg⁡z=arctan⁡(3)=π/3\arg z = \arctan(\sqrt3) = \pi/3, so z=2eiπ/3z = 2e^{i\pi/3}. For ww: ∣w∣=2|w| = 2, arg⁡w=π/2\arg w = \pi/2, so w=2eiπ/2w = 2e^{i\pi/2}.
  2. zw=4ei(π/3+π/2)=4ei5π/6=4(−32+12i)=−23+2izw = 4e^{i(\pi/3 + \pi/2)} = 4e^{i5\pi/6} = 4\left(-\tfrac{\sqrt3}{2} + \tfrac12 i\right) = -2\sqrt3 + 2i. Directly: (1+i3)(2i)=2i+23 i2=−23+2i(1 + i\sqrt3)(2i) = 2i + 2\sqrt3\, i^2 = -2\sqrt3 + 2i. ✓
  3. zˉ=1−i3\bar z = 1 - i\sqrt3, and 1/z=zˉ/∣z∣2=14(1−i3)1/z = \bar z / |z|^2 = \tfrac14(1 - i\sqrt3). In polar form, 1/z=12e−iπ/31/z = \tfrac12 e^{-i\pi/3}: half the length, opposite angle.
  4. z6=26ei6π/3=64 e2πi=64z^6 = 2^6 e^{i6\pi/3} = 64\,e^{2\pi i} = 64. Six turns of 60∘60^\circ bring you all the way around to the positive real axis.

Complex eigenvalues of real matrices

Back to matrices. For any real 2×22 \times 2 matrix AA with trace T=a11+a22T = a_{11} + a_{22} and determinant D=det⁡AD = \det A, you saw in 1.5 Eigenvectors & Eigenvalues that the characteristic polynomial is

λ2−Tλ+D=0⟹λ=T2±T2−4D2.\lambda^2 - T\lambda + D = 0 \quad\Longrightarrow\quad \lambda = \frac{T}{2} \pm \frac{\sqrt{T^2 - 4D}}{2}.

When T2<4DT^2 \lt 4D, the square root is of a negative number and

λ=T2±i 4D−T22=a±bi.\lambda = \frac{T}{2} \pm i\,\frac{\sqrt{4D - T^2}}{2} = a \pm bi .

The identity ∣λ∣2=D|\lambda|^2 = D is worth remembering: the product of the eigenvalues is the determinant, and here the product is λλˉ=∣λ∣2\lambda\bar\lambda = |\lambda|^2. So for complex eigenvalues, ∣λ∣=det⁡A|\lambda| = \sqrt{\det A}, which you can read off without solving anything. The conjugate-pair rule holds for real matrices of any size, because the characteristic polynomial has real coefficients.

Worked example: eigenvalues from trace and determinant

Find the eigenvalues of A=[3−24−1]A = \begin{bmatrix} 3 & -2 \\ 4 & -1 \end{bmatrix} and their modulus and angle.

T=3+(−1)=2T = 3 + (-1) = 2 and D=(3)(−1)−(−2)(4)=−3+8=5D = (3)(-1) - (-2)(4) = -3 + 8 = 5. Since T2=4<20=4DT^2 = 4 \lt 20 = 4D, the eigenvalues are complex:

λ=22±i20−42=1±2i.\lambda = \frac{2}{2} \pm i\frac{\sqrt{20 - 4}}{2} = 1 \pm 2i .

Then r=∣λ∣=1+4=5≈2.236r = |\lambda| = \sqrt{1 + 4} = \sqrt5 \approx 2.236 (check: D=5\sqrt{D} = \sqrt5 ✓), and θ=arctan⁡(2/1)≈63.43∘\theta = \arctan(2/1) \approx 63.43^\circ. We’ll see shortly that this means: in a suitable coordinate system, AA rotates by about 63.4∘63.4^\circ and stretches by 5\sqrt5. We’ll finish this example below by finding that coordinate system.

✅ Concept checkselect all that apply

Select every matrix with non-real (complex) eigenvalues.

▶ Video Part 2: rotation-scaling matrices, spirals, and the real form A = PCP⁻¹captions only
Transcript
  1. In part one we saw that complex multiplication rotates and scales. Now we find real matrices that do exactly the same thing, and watch what happens when we iterate them.
  2. Back to real matrices. The matrix a, minus b, b, a is r times a rotation by theta. Its eigenvalues are a plus and minus b i: the very complex number it imitates, and its conjugate.
  3. For any real two by two matrix, the eigenvalues solve lambda squared minus trace times lambda plus determinant. When trace squared is less than four times the determinant, they come as a complex conjugate pair.
  4. Now iterate. Start at a point and apply the rotation scaling matrix over and over. With r equal to point nine two, each step turns twenty five degrees and shrinks the distance by eight percent.
  5. The orbit spirals inward. After n steps the distance is r to the n times the start, so magnitude less than one means decay to zero.
  6. Make r one point zero five and the same spiral runs outward. Make r exactly one and the points stay on a circle forever. The modulus of the eigenvalue is the whole story.
  7. A general real matrix with complex eigenvalues does the same thing, just in a tilted coordinate system. Here the orbit spirals around ellipses instead of circles.
  8. The ellipses are circles seen through the matrix P, whose columns are the real and imaginary parts of a complex eigenvector. In that basis, A is a pure rotation scaling: A equals P C P inverse.
  9. The real reason this matters is differential equations. For x prime equals A x with eigenvalues alpha plus or minus i beta, solutions look like e to the alpha t times cosine and sine of beta t.
  10. Beta sets how fast it turns. Alpha sets whether it grows or decays. With alpha negative you get a smooth inward spiral, which is a damped oscillator: a mass on a spring with friction.
  11. Aircraft have these modes too. The slow phugoid, where the plane trades height for speed, and the Dutch roll, a yawing and rolling wobble, are each a complex eigenvalue pair of the linearized flight equations.
  12. Here is a connection to your simulations course. Take the undamped oscillator, whose true orbits are circles, and step it with forward Euler.
  13. The Euler matrix is a rotation scaling matrix with eigenvalues one plus or minus i h. Their modulus is the square root of one plus h squared, which is bigger than one. So every step spirals outward.
  14. That is the energy drift you saw when Euler made a pendulum swing higher and higher. It is not a bug in your code. It is an eigenvalue outside the unit circle.
  15. Finally, fluids. Flow past a cylinder above a critical speed starts shedding vortices, alternating top and bottom, in the famous von Karman street.
  16. Linearize the flow around the steady state and you find a complex eigenvalue pair. The imaginary part is the shedding frequency. The real part crossing zero is the moment the wake starts to oscillate.
  17. To recap. Complex multiplication is rotation and scaling. Complex eigenvalues of a real matrix mean rotation, and their modulus decides between inward spirals, outward spirals, and closed orbits.
  18. Next time, we let time flow continuously, and meet the matrix exponential, which turns these step by step spirals into smooth ones.

Rotation-scaling matrices

The simplest matrices with complex eigenvalues are the ones we met as “multiplication by a+bia + bi”:

C=[a−bba].C = \begin{bmatrix} a & -b \\ b & a \end{bmatrix}.

Write a=rcos⁡θa = r\cos\theta and b=rsin⁡θb = r\sin\theta, where r=a2+b2r = \sqrt{a^2+b^2}. Then

C=r[cos⁡θ−sin⁡θsin⁡θcos⁡θ]=r R(θ):C = r\begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} = r\,R(\theta):

a rotation by θ\theta followed by a uniform scaling by rr. That’s why CC is called a rotation-scaling matrix. Its eigenvalues are

det⁡(C−λI)=(a−λ)2+b2=0⟹a−λ=±bi⟹λ=a∓bi=re∓iθ.\det(C - \lambda I) = (a - \lambda)^2 + b^2 = 0 \quad\Longrightarrow\quad a - \lambda = \pm bi \quad\Longrightarrow\quad \lambda = a \mp bi = re^{\mp i\theta}.

So the eigenvalues of CC are exactly the complex number a+bia + bi that CC imitates, and its conjugate. The modulus of the eigenvalue is the scaling factor and the argument is the rotation angle. The eigenvectors are complex: you can check that C[1−i]=[a+bib−ai]=(a+bi)[1−i]C\begin{bmatrix} 1 \\ -i \end{bmatrix} = \begin{bmatrix} a + bi \\ b - ai \end{bmatrix} = (a + bi)\begin{bmatrix} 1 \\ -i \end{bmatrix}, and conjugating gives the eigenvector (1,i)(1, i) for a−bia - bi.

Powers of CC are as easy as powers of complex numbers. Rotations compose by adding angles, so

Cn=rnR(nθ),C^n = r^n R(n\theta),

the matrix version of (reiθ)n=rneinθ(re^{i\theta})^n = r^n e^{in\theta}.

✏️ Pen & paperRotations, powers and eigenvectors●●○
  1. Show that the rotation matrix R(θ)R(\theta) has eigenvalues e±iθe^{\pm i\theta}, and that (1,−i)(1, -i) is an eigenvector for eiθe^{i\theta}.
  2. Compute M8M^8 for M=[1−111]M = \begin{bmatrix} 1 & -1 \\ 1 & 1 \end{bmatrix} without multiplying eight matrices.
  3. Why must a rotation-scaling matrix with θ=2π/k\theta = 2\pi/k and r=1r = 1 satisfy Ck=IC^k = I? What does the orbit of a point look like?
Show worked solution
  1. From the first section, det⁡(R−λI)=λ2−2cos⁡θ λ+1\det(R - \lambda I) = \lambda^2 - 2\cos\theta\,\lambda + 1, with roots cos⁡θ±isin⁡θ=e±iθ\cos\theta \pm i\sin\theta = e^{\pm i\theta}. For the eigenvector, R[1−i]=[cos⁡θ+isin⁡θsin⁡θ−icos⁡θ]R\begin{bmatrix} 1 \\ -i \end{bmatrix} = \begin{bmatrix} \cos\theta + i\sin\theta \\ \sin\theta - i\cos\theta \end{bmatrix}. The second entry is −i(cos⁡θ+isin⁡θ)-i(\cos\theta + i\sin\theta), because −icos⁡θ−i2sin⁡θ=sin⁡θ−icos⁡θ-i\cos\theta - i^2 \sin\theta = \sin\theta - i\cos\theta. So the result is eiθ(1,−i)e^{i\theta}(1, -i). ✓
  2. MM is the rotation-scaling matrix for 1+i=2 eiπ/41 + i = \sqrt2\, e^{i\pi/4}, so M=2 R(45∘)M = \sqrt2\, R(45^\circ) and M8=(2)8R(360∘)=16IM^8 = (\sqrt2)^8 R(360^\circ) = 16 I. This is the matrix version of (1+i)8=16(1+i)^8 = 16.
  3. Ck=1kR(k⋅2π/k)=R(2π)=IC^k = 1^k R(k \cdot 2\pi/k) = R(2\pi) = I. Every point returns to where it started after kk steps, so the orbit is kk equally spaced points on a circle: a regular kk-gon. (You saw the 12-gon for θ=30∘\theta = 30^\circ in the video.)

Spirals from iterating a matrix

Now iterate: pick a starting vector x⃗0\vec x_0 and repeatedly apply CC,

x⃗n+1=C x⃗n⟹x⃗n=Cnx⃗0=rnR(nθ) x⃗0.\vec x_{n+1} = C\,\vec x_n \quad\Longrightarrow\quad \vec x_n = C^n \vec x_0 = r^n R(n\theta)\,\vec x_0 .

Each step turns the point by θ\theta and multiplies its distance from the origin by rr, so

∥x⃗n∥=rn ∥x⃗0∥.\|\vec x_n\| = r^n\,\|\vec x_0\| .

The modulus of the eigenvalue is the whole story:

∣λ∣=r\lvert\lambda\rvert = rorbit of x⃗n+1=Cx⃗n\vec x_{n+1} = C\vec x_n
r<1r \lt 1spirals inward to the origin (stable)
r=1r = 1stays on a circle forever; closed if θ/2π\theta/2\pi is rational
r>1r \gt 1spirals outward to infinity (unstable)

The angle θ\theta only sets how tightly wound the spiral is: about 360∘/θ360^\circ/\theta steps per turn.

◆ Interactive Spiral map: iterate xₙ₊₁ = A xₙ and watch the eigenvalues

Loading simulation…

Things to try:

  1. In rotation-scaling mode, slide rr slowly through 11. The orbit switches from an inward to an outward spiral exactly as the red eigenvalue dots in the inset cross the dashed unit circle. The bottom readout compares ∥x⃗n∥\|\vec x_n\| with rn∥x⃗0∥r^n\|\vec x_0\|; they agree exactly.
  2. Press r = 1 and set θ=30∘\theta = 30^\circ, then θ=72∘\theta = 72^\circ. You get a 12-gon and a pentagon. Try θ=37∘\theta = 37^\circ: the orbit does not close until step 360, so within 200 steps it fills in the circle instead.
  3. Switch to General A = P C P⁻¹ and change the tilt and length of the columns of PP. Same eigenvalues, same inward or outward behavior, but the spiral now runs along ellipses. That’s the next section.
  4. Switch to Any 2×2 matrix and drag a12a_{12} from negative values up past zero. When T2−4DT^2 - 4D turns positive, the eigenvalue dots collide on the real axis and split apart, and the spiral stops spiraling.
✅ Concept check

You iterate $\vec x_{n+1} = A\vec x_n$ with $A = \begin{bmatrix} 0.8 & -0.6 \\ 0.6 & 0.8 \end{bmatrix}$. What does the orbit do?

The real form: A = P C P⁻¹

A general real matrix with complex eigenvalues isn’t a rotation-scaling matrix; the [3−24−1]\begin{bmatrix} 3 & -2 \\ 4 & -1 \end{bmatrix} from before certainly doesn’t look like one. But in the right basis it is one. This is the complex-eigenvalue analogue of diagonalization, and like 1.6 Change of Basis & Diagonalization it’s a change of basis. The difference is that we can’t use the complex eigenvectors as a real basis directly. Instead we split one eigenvector into its real and imaginary parts.

Derivation. Write v⃗=x⃗+iy⃗\vec v = \vec x + i\vec y with x⃗=Re⁡v⃗\vec x = \operatorname{Re}\vec v and y⃗=Im⁡v⃗\vec y = \operatorname{Im}\vec v real vectors. Expand Av⃗=λv⃗A\vec v = \lambda\vec v:

Ax⃗+iAy⃗=(a−bi)(x⃗+iy⃗)=(ax⃗+by⃗)+i(−bx⃗+ay⃗).A\vec x + iA\vec y = (a - bi)(\vec x + i\vec y) = (a\vec x + b\vec y) + i(-b\vec x + a\vec y).

Since AA, x⃗\vec x, y⃗\vec y are real, match real and imaginary parts:

Ax⃗=ax⃗+by⃗,Ay⃗=−bx⃗+ay⃗.A\vec x = a\vec x + b\vec y, \qquad A\vec y = -b\vec x + a\vec y .

Read column by column, that says A [x⃗    y⃗]=[x⃗    y⃗][a−bba]A\,[\vec x \;\; \vec y] = [\vec x \;\; \vec y]\begin{bmatrix} a & -b \\ b & a \end{bmatrix}, i.e. AP=PCAP = PC. Finally, x⃗\vec x and y⃗\vec y are linearly independent: if y⃗=cx⃗\vec y = c\vec x, then v⃗=(1+ic)x⃗\vec v = (1 + ic)\vec x would be a complex multiple of a real vector, x⃗\vec x would itself be an eigenvector, and Ax⃗=λx⃗A\vec x = \lambda\vec x with Ax⃗A\vec x real forces λ\lambda real, which is a contradiction. (The case x⃗=0\vec x = 0 works the same way with y⃗\vec y.) So PP is invertible and A=PCP−1A = PCP^{-1}. ■\blacksquare

Geometric meaning. P−1P^{-1} moves to coordinates along Re⁡v⃗\operatorname{Re}\vec v and Im⁡v⃗\operatorname{Im}\vec v. In those coordinates AA acts as CC, rotating by θ\theta and scaling by r=∣λ∣r = |\lambda|, and PP moves back. The circles that CC rotates along become ellipses in the original coordinates. So every real 2×22\times2 matrix with complex eigenvalues is a rotation-scaling in disguise. Iterating it gives spirals along a family of nested ellipses, inward if ∣λ∣<1|\lambda| \lt 1 and outward if ∣λ∣>1|\lambda| \gt 1. Also, An=PCnP−1=rnPR(nθ)P−1A^n = P C^n P^{-1} = r^n P R(n\theta) P^{-1}, so ∥x⃗n∥\|\vec x_n\| stays within a constant factor of rn∥x⃗0∥r^n\|\vec x_0\|. The constant is the ratio of the ellipses’ longest to shortest axes.

Worked example: the full real form

Write A=[3−24−1]A = \begin{bmatrix} 3 & -2 \\ 4 & -1 \end{bmatrix} as PCP−1PCP^{-1} and describe the iteration x⃗n+1=Ax⃗n\vec x_{n+1} = A\vec x_n.

Step 1: eigenvalues. From before, λ=1±2i\lambda = 1 \pm 2i. Take λ=1−2i\lambda = 1 - 2i, so a=1a = 1 and b=2b = 2.

Step 2: eigenvector. Solve (A−λI)v⃗=0(A - \lambda I)\vec v = 0:

A−(1−2i)I=[2+2i−24−2+2i].A - (1 - 2i)I = \begin{bmatrix} 2 + 2i & -2 \\ 4 & -2 + 2i \end{bmatrix}.

The rows of a singular 2×22\times2 matrix are proportional, so the first row is enough: (2+2i)v1−2v2=0(2 + 2i)v_1 - 2v_2 = 0 gives v2=(1+i)v1v_2 = (1 + i)v_1. Take v1=1v_1 = 1:

v⃗=[11+i].\vec v = \begin{bmatrix} 1 \\ 1 + i \end{bmatrix}.

Check with the second row: 4(1)+(−2+2i)(1+i)=4+(−2−2i+2i+2i2)=4−4=04(1) + (-2 + 2i)(1 + i) = 4 + (-2 - 2i + 2i + 2i^2) = 4 - 4 = 0. ✓

Step 3: split into real and imaginary parts.

Re⁡v⃗=[11],Im⁡v⃗=[01],P=[1011],P−1=[10−11],C=[1−221].\operatorname{Re}\vec v = \begin{bmatrix} 1 \\ 1 \end{bmatrix}, \quad \operatorname{Im}\vec v = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad P = \begin{bmatrix} 1 & 0 \\ 1 & 1 \end{bmatrix}, \quad P^{-1} = \begin{bmatrix} 1 & 0 \\ -1 & 1 \end{bmatrix}, \quad C = \begin{bmatrix} 1 & -2 \\ 2 & 1 \end{bmatrix}.

Step 4: verify. PC=[1−23−1]PC = \begin{bmatrix} 1 & -2 \\ 3 & -1 \end{bmatrix}, and

PCP−1=[1−23−1][10−11]=[1+2−23+1−1]=[3−24−1]=A.✓PCP^{-1} = \begin{bmatrix} 1 & -2 \\ 3 & -1 \end{bmatrix}\begin{bmatrix} 1 & 0 \\ -1 & 1 \end{bmatrix} = \begin{bmatrix} 1 + 2 & -2 \\ 3 + 1 & -1 \end{bmatrix} = \begin{bmatrix} 3 & -2 \\ 4 & -1 \end{bmatrix} = A. \checkmark

Step 5: interpret. C=5 R(63.43∘)C = \sqrt5\,R(63.43^\circ). In the skewed coordinates along (1,1)(1, 1) and (0,1)(0, 1), every step rotates by 63.43∘63.43^\circ and stretches by 5\sqrt5. In the original plane, iterates spiral outward along ellipses, taking a little under 6 steps per turn. The video used A/2.4A/2.4, which has the same PP and the same angle but ∣λ∣=5/2.4≈0.93|\lambda| = \sqrt5/2.4 \approx 0.93, so it spirals inward along the same ellipses.

✏️ Pen & paperReal form, start to finish●●○

Let A=[1−213]A = \begin{bmatrix} 1 & -2 \\ 1 & 3 \end{bmatrix}.

  1. Find the eigenvalues, r=∣λ∣r = |\lambda| and θ\theta.
  2. Find PP and CC with A=PCP−1A = PCP^{-1}, and verify your answer by multiplying.
  3. Describe the orbit of x⃗n+1=Ax⃗n\vec x_{n+1} = A\vec x_n starting from any nonzero x⃗0\vec x_0.
Show worked solution
  1. T=4T = 4 and D=3−(−2)=5D = 3 - (-2) = 5. Since 16<2016 \lt 20, λ=2±i20−16/2=2±i\lambda = 2 \pm i\sqrt{20 - 16}/2 = 2 \pm i. So r=5≈2.236r = \sqrt5 \approx 2.236 and θ=arctan⁡(1/2)≈26.57∘\theta = \arctan(1/2) \approx 26.57^\circ.
  2. Take λ=2−i\lambda = 2 - i (a=2a = 2, b=1b = 1). Then A−λI=[−1+i−211+i]A - \lambda I = \begin{bmatrix} -1 + i & -2 \\ 1 & 1 + i \end{bmatrix}. The second row gives v1+(1+i)v2=0v_1 + (1 + i)v_2 = 0; with v2=1v_2 = 1, v⃗=(−1−i, 1)\vec v = (-1 - i,\ 1). Check the first row: (−1+i)(−1−i)−2=(1+i−i−i2)−2=2−2=0(-1 + i)(-1 - i) - 2 = (1 + i - i - i^2) - 2 = 2 - 2 = 0. ✓ So Re⁡v⃗=(−1,1)\operatorname{Re}\vec v = (-1, 1), Im⁡v⃗=(−1,0)\operatorname{Im}\vec v = (-1, 0), and P=[−1−110],P−1=[01−1−1],C=[2−112].P = \begin{bmatrix} -1 & -1 \\ 1 & 0 \end{bmatrix}, \quad P^{-1} = \begin{bmatrix} 0 & 1 \\ -1 & -1 \end{bmatrix}, \quad C = \begin{bmatrix} 2 & -1 \\ 1 & 2 \end{bmatrix}. (det⁡P=0−(−1)=1\det P = 0 - (-1) = 1.) Verify: PC=[−3−12−1]PC = \begin{bmatrix} -3 & -1 \\ 2 & -1 \end{bmatrix} and PCP−1=[0+1−3+10+12+1]=[1−213]PCP^{-1} = \begin{bmatrix} 0 + 1 & -3 + 1 \\ 0 + 1 & 2 + 1 \end{bmatrix} = \begin{bmatrix} 1 & -2 \\ 1 & 3 \end{bmatrix}. ✓ A different eigenvector scaling gives a different PP, which is also correct; the check PCP−1=APCP^{-1} = A is what matters.
  3. Since r=5>1r = \sqrt5 \gt 1, the orbit spirals outward along ellipses centered at the origin. Each step advances 26.57∘26.57^\circ in PP-coordinates (about 13.5 steps per turn), and the size grows by roughly 5\sqrt5 per step. The origin is an unstable spiral point for this map.

Preview: spirals in continuous time

Iterated maps are half the story. The other half is the differential equation x⃗ ′=Ax⃗\vec x\,' = A\vec x, which you’ll solve properly with the matrix exponential in 1.8 The Matrix Exponential: From Hops to Flows and 7.4 Complex & Repeated Eigenvalues. Here’s the preview, done by hand for a rotation-scaling matrix with eigenvalues α±iβ\alpha \pm i\beta:

x⃗ ′=[α−ββα]x⃗.\vec x\,' = \begin{bmatrix} \alpha & -\beta \\ \beta & \alpha \end{bmatrix}\vec x .

In complex notation z=x1+ix2z = x_1 + ix_2, this is just z′=(α+iβ)zz' = (\alpha + i\beta)z, a scalar linear ODE with solution z(t)=e(α+iβ)tz0=eαteiβtz0z(t) = e^{(\alpha + i\beta)t}z_0 = e^{\alpha t}e^{i\beta t}z_0. Back in real coordinates:

x⃗(t)=eαt R(βt) x⃗0,e.g. x⃗0=(1,0)  ⇒  x⃗(t)=eαt[cos⁡βtsin⁡βt].\vec x(t) = e^{\alpha t}\,R(\beta t)\,\vec x_0, \qquad\text{e.g. } \vec x_0 = (1, 0) \;\Rightarrow\; \vec x(t) = e^{\alpha t}\begin{bmatrix} \cos\beta t \\ \sin\beta t \end{bmatrix}.

The imaginary part β\beta is the angular frequency; the real part α\alpha is the growth or decay rate. In continuous time the dividing line is α=0\alpha = 0 (the imaginary axis) instead of ∣λ∣=1|\lambda| = 1 (the unit circle). That’s because one time-step of length hh of this flow is the matrix eαhR(βh)e^{\alpha h}R(\beta h), with eigenvalue modulus eαhe^{\alpha h}, which is less than 1 exactly when α<0\alpha \lt 0.

The damped oscillator x′′+2ζωx′+ω2x=0x'' + 2\zeta\omega x' + \omega^2 x = 0 written as a system has characteristic equation λ2+2ζωλ+ω2=0\lambda^2 + 2\zeta\omega\lambda + \omega^2 = 0, with roots λ=−ζω±iω1−ζ2\lambda = -\zeta\omega \pm i\omega\sqrt{1 - \zeta^2} when ζ<1\zeta \lt 1. In the (x,x′)(x, x') phase plane, every underdamped mass-spring system, RLC circuit and pendulum near rest is a decaying spiral. That’s 5.3 Mechanical Vibrations: Spring–Mass–Damper.

✏️ Pen & paperSwirl or strain?●●●

In a 2D incompressible flow the velocity-gradient matrix G=∇u⃗G = \nabla\vec u has trace zero (that’s ∇⋅u⃗=0\nabla\cdot\vec u = 0). Near a point, relative motion follows x⃗ ′=Gx⃗\vec x\,' = G\vec x. For each GG, find the eigenvalues and decide whether nearby fluid swirls (closed elliptical paths) or is strained (stretched along one direction and squeezed along another).

G1=[0−210],G2=[120−1],G3=[0100].G_1 = \begin{bmatrix} 0 & -2 \\ 1 & 0 \end{bmatrix}, \qquad G_2 = \begin{bmatrix} 1 & 2 \\ 0 & -1 \end{bmatrix}, \qquad G_3 = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}.

Then explain why G3G_3, a simple shear flow u⃗=(y,0)\vec u = (y, 0), has nonzero vorticity but no swirl.

Show worked solution

With T=0T = 0, the characteristic equation is λ2+D=0\lambda^2 + D = 0, so the eigenvalues are complex exactly when D>0D \gt 0.

  • G1G_1: D=0−(−2)(1)=2>0D = 0 - (-2)(1) = 2 \gt 0, so λ=±i2\lambda = \pm i\sqrt2. Purely imaginary means α=0\alpha = 0: particles circulate on closed ellipses (stretched along x1x_1, since ∣−2∣>∣1∣|-2| \gt |1|) with angular frequency 2\sqrt2. Swirl. It’s a vortex core.
  • G2G_2: D=−1<0D = -1 \lt 0, so λ=±1\lambda = \pm 1, real. Fluid is stretched along the eigenvector for +1+1, namely (1,0)(1, 0), and compressed along the eigenvector for −1-1, namely (1,−1)(1, -1). Strain, a saddle.
  • G3G_3: D=0D = 0, so λ=0,0\lambda = 0, 0, real and repeated. Particles slide along horizontal lines at speed yy; nobody goes around anything. No swirl.

For G3G_3 the vorticity is ωz=∂v/∂x−∂u/∂y=0−1=−1≠0\omega_z = \partial v/\partial x - \partial u/\partial y = 0 - 1 = -1 \neq 0. Its rotation part Ω\Omega does have eigenvalues ±i/2\pm i/2, but the strain part S=12(G+GT)=[01/21/20]S = \tfrac12(G + G^T) = \begin{bmatrix} 0 & 1/2 \\ 1/2 & 0 \end{bmatrix} is exactly strong enough to cancel the rotation. Vorticity measures the rotation part of GG; swirl needs rotation to beat strain, which is the condition that GG itself has complex eigenvalues. That’s why vortex-detection criteria use the eigenvalues of GG rather than vorticity alone: boundary layers are full of vorticity but contain no vortices.

✏️ Pen & paperHow fast does Euler's energy drift?●●○

A 1 Hz oscillator (ω=2π\omega = 2\pi) is integrated with forward Euler at h=0.01h = 0.01 s.

  1. Show that the energy En=12(vn2+ω2xn2)E_n = \tfrac12(v_n^2 + \omega^2 x_n^2) satisfies En+1=(1+h2ω2)EnE_{n+1} = (1 + h^2\omega^2)E_n exactly.
  2. How many steps until the energy doubles? How many oscillation periods is that?
Show worked solution
  1. Let yn=(ωxn,vn)y_n = (\omega x_n, v_n). The Euler update xn+1=xn+hvnx_{n+1} = x_n + hv_n, vn+1=vn−hω2xnv_{n+1} = v_n - h\omega^2 x_n becomes [ωxn+1vn+1]=[1hω−hω1][ωxnvn],\begin{bmatrix} \omega x_{n+1} \\ v_{n+1} \end{bmatrix} = \begin{bmatrix} 1 & h\omega \\ -h\omega & 1 \end{bmatrix}\begin{bmatrix} \omega x_n \\ v_n \end{bmatrix}, a rotation-scaling matrix with r=1+h2ω2r = \sqrt{1 + h^2\omega^2}. So ∥yn+1∥=r∥yn∥\|y_{n+1}\| = r\|y_n\|, and since En=12∥yn∥2E_n = \tfrac12\|y_n\|^2, En+1=r2En=(1+h2ω2)EnE_{n+1} = r^2 E_n = (1 + h^2\omega^2)E_n.
  2. hω=0.02π≈0.06283h\omega = 0.02\pi \approx 0.06283, so the factor is 1+0.003948=1.0039481 + 0.003948 = 1.003948. Doubling needs n=ln⁡2/ln⁡(1.003948)≈0.6931/0.003940≈176n = \ln 2 / \ln(1.003948) \approx 0.6931 / 0.003940 \approx 176 steps, which is 1.761.76 s, less than two periods. Halving hh only roughly doubles that time (the per-step growth is O(h2)O(h^2) but there are 1/h1/h steps per unit time), which is why Euler is hopeless for long oscillator runs.

Experiments in code

First, see the rnr^n law numerically. Change r and theta and watch the spiral and the ratio.

🐍 PythonIterating a rotation-scaling matrix
⌘/Ctrl + Enter

Now implement the key computations yourself, from trace and determinant only.

🧪 Coding exerciseExercise: complex eigenvalues and the real form
⌘/Ctrl + Enter

Finally, measure Euler’s outward spiral and confirm the 1+h2ω2\sqrt{1 + h^2\omega^2} factor.

🧪 Coding exerciseExercise: forward Euler on an oscillator spirals out
⌘/Ctrl + Enter
✅ Concept check

Forward Euler on $x'' + x = 0$ with $h = 0.1$: by what factor does the amplitude $\sqrt{x^2 + v^2}$ grow each step? (3 decimals)

Key Takeaways

  • A complex number a+bi=reiθa + bi = re^{i\theta} is a point in the plane. Multiplying by it rotates by θ\theta and scales by rr, and as a real map it is the matrix [a−bba]\begin{bmatrix} a & -b \\ b & a \end{bmatrix}.
  • Euler’s formula eiθ=cos⁡θ+isin⁡θe^{i\theta} = \cos\theta + i\sin\theta follows from the Taylor series, and from the fact that z′=izz' = iz means moving on the unit circle. It makes powers easy: (reiθ)n=rneinθ(re^{i\theta})^n = r^n e^{in\theta}.
  • A real 2×22\times2 matrix has complex eigenvalues exactly when T2<4DT^2 \lt 4D. They come in conjugate pairs a±bia \pm bi with a=T/2a = T/2 and ∣λ∣=D|\lambda| = \sqrt{D}.
  • Rotation-scaling matrices C=rR(θ)C = rR(\theta) have eigenvalues re±iθre^{\pm i\theta}, and Cn=rnR(nθ)C^n = r^nR(n\theta).
  • Iterating x⃗n+1=Ax⃗n\vec x_{n+1} = A\vec x_n with complex eigenvalues gives spirals: inward if ∣λ∣<1|\lambda| \lt 1, outward if ∣λ∣>1|\lambda| \gt 1, closed orbits on a circle or ellipse if ∣λ∣=1|\lambda| = 1.
  • Real form: with λ=a−bi\lambda = a - bi and eigenvector v⃗\vec v, A=PCP−1A = PCP^{-1}, where P=[Re⁡v⃗ Im⁡v⃗]P = [\operatorname{Re}\vec v\ \operatorname{Im}\vec v]. Every such matrix is a rotation-scaling in skewed coordinates, and its circles become ellipses.
  • In continuous time, λ=α±iβ\lambda = \alpha \pm i\beta gives eαt(cos⁡βt,sin⁡βt)e^{\alpha t}(\cos\beta t, \sin\beta t): damped oscillators, phugoid and Dutch roll modes, and the onset of vortex shedding.
  • Forward Euler on an undamped oscillator has eigenvalues 1±ihω1 \pm ih\omega with ∣λ∣=1+h2ω2>1|\lambda| = \sqrt{1 + h^2\omega^2} \gt 1, which explains its energy drift.
Finished this lesson?

Mark it complete to track your progress (saved in this browser). Reading every section does this for you.

Where this leads

These later lessons build directly on this one: