Tutorials › Linear Algebra › Complex Roots and Oscillatory Linear Recurrences

Applications of Diagonalization · Tutorial 587 of 1000

Complex Roots and Oscillatory Linear Recurrences

Learn how a complex-conjugate root pair produces a real oscillating sequence and how to determine its formula from two initial values.

Intermediate 10 min read

What You'll Learn

  • Identify when a second-order real recurrence has nonreal characteristic roots.
  • Convert a conjugate root pair into a radius and an angle.
  • Derive the real cosine-and-sine solution from the recurrence.
  • Determine both constants from the initial values.
  • Check explicit recurrence solutions and avoid a common scaling error.

From Complex Roots to Real Oscillations

A real recurrence can have complex characteristic roots even though every term of the sequence is real. When the roots are a conjugate pair, their contributions combine into a real expression involving sine and cosine. The resulting sequence may alternate in sign or oscillate in a more gradual pattern, while a factor raised to the index controls its scale.

Consider a real sequence \((x_n)_{n\geq 0}\) satisfying a second-order homogeneous recurrence \(x_{n+2}+a x_{n+1}+b x_n=0\) for every integer \(n\geq 0\), where \(a,b\in\mathbb R\). Two initial values, \(x_0\) and \(x_1\), determine the later terms. The characteristic polynomial of this recurrence is \(p(\lambda)=\lambda^2+a\lambda+b\); its roots are called the characteristic roots. To see why they are relevant, substituting a trial sequence \(x_n=\lambda^n\) gives \(\lambda^{n+2}+a\lambda^{n+1}+b\lambda^n=\lambda^n p(\lambda)\). Thus a root produces a sequence that satisfies the recurrence.

Definition: A nonreal conjugate pair of characteristic roots has the form \(r(\cos\theta+i\sin\theta)\) and \(r(\cos\theta-i\sin\theta)\), where \(r>0\), \(0<\theta<\pi\), and \(i^2=-1\). The number \(r\) is the modulus of either root, and \(\theta\) is the angle of the root with positive imaginary part.

Writing the roots this way separates their shared size \(r\) from their opposite angles. Their sum is \(2r\cos\theta\), and their product is \(r^2\). Consequently, the recurrence with these roots can be written \(x_{n+2}-2r\cos\theta\,x_{n+1}+r^2x_n=0\). This form makes the sine and cosine structure visible.

Theorem (Real form of the solution): Suppose a second-order real recurrence has characteristic roots \(r(\cos\theta+i\sin\theta)\) and \(r(\cos\theta-i\sin\theta)\), with \(r>0\) and \(0<\theta<\pi\). For any real initial values \(x_0,x_1\), its unique solution is \(x_n=r^n(C\cos(n\theta)+D\sin(n\theta))\), where \(C=x_0\) and \(D=\dfrac{x_1/r-x_0\cos\theta}{\sin\theta}\).

Proof. The recurrence has the form \(x_{n+2}-2r\cos\theta\,x_{n+1}+r^2x_n=0\), since the sum and product of its characteristic roots are \(2r\cos\theta\) and \(r^2\). The angle-addition identities give \(\cos((n+2)\theta)-2\cos\theta\cos((n+1)\theta)+\cos(n\theta)=0\), and the same identity holds with sine in place of cosine. Multiplying these identities by \(r^{n+2}\) shows that both \(r^n\cos(n\theta)\) and \(r^n\sin(n\theta)\) satisfy the recurrence. Their linear combination with real coefficients \(C,D\) therefore satisfies it as well.

At \(n=0\), that combination equals \(C\), so matching \(x_0\) requires \(C=x_0\). At \(n=1\), it equals \(r(C\cos\theta+D\sin\theta)\). Since \(0<\theta<\pi\) implies \(\sin\theta\ne0\), matching \(x_1\) gives \(D=(x_1/r-C\cos\theta)/\sin\theta\). Thus the displayed formula has the prescribed initial values. Finally, the recurrence determines each next term from the two preceding terms: \(x_{n+2}=2r\cos\theta\,x_{n+1}-r^2x_n\). Any two solutions with the same \(x_0,x_1\) must therefore agree at \(x_2\), then at \(x_3\), and successively at every later index. The formula is the unique solution. \(\square\)

Testing for a Nonreal Root Pair

Theorem (Discriminant test): For the recurrence \(x_{n+2}+a x_{n+1}+b x_n=0\) with real coefficients, the characteristic roots are nonreal exactly when \(a^2-4b<0\). In that case \(b>0\), and the roots can be written with \(r=\sqrt b\), \(\cos\theta=-\dfrac{a}{2\sqrt b}\), and \(\sin\theta=\dfrac{\sqrt{4b-a^2}}{2\sqrt b}\), where \(0<\theta<\pi\).

Proof. The quadratic formula gives the roots \(\lambda=(-a\pm\sqrt{a^2-4b})/2\). If \(a^2-4b<0\), the square root is purely imaginary and the roots are nonreal conjugates. The inequality also gives \(b>a^2/4\geq0\), so \(r=\sqrt b\) is positive. The proposed cosine and sine satisfy \(\cos^2\theta+\sin^2\theta=\dfrac{a^2+4b-a^2}{4b}=1\), and the sine is positive. Hence they specify an angle in \((0,\pi)\), and the two roots are \(r(\cos\theta\pm i\sin\theta)\). Conversely, if the roots are \(\alpha+i\beta\) and \(\alpha-i\beta\) with \(\beta\ne0\), then their sum and product give \(a=-2\alpha\) and \(b=\alpha^2+\beta^2\). It follows that \(a^2-4b=4\alpha^2-4(\alpha^2+\beta^2)=-4\beta^2<0\). This proves both directions. \(\square\)

Worked Example: Finding the Formula from Initial Values

Solve \(x_{n+2}-2x_{n+1}+4x_n=0\) with \(x_0=1\) and \(x_1=2\).

The characteristic polynomial is \(\lambda^2-2\lambda+4\). Its discriminant is \((-2)^2-4(1)(4)=4-16=-12\), so its roots are \(\lambda=(2\pm\sqrt{-12})/2=1\pm i\sqrt3\). Each root has modulus \(r=\sqrt{1^2+(\sqrt3)^2}=2\). For the root with positive imaginary part, \(\cos\theta=1/2\) and \(\sin\theta=\sqrt3/2\), so \(\theta=\pi/3\).

The theorem gives \(C=x_0=1\), and \(D=\dfrac{x_1/r-C\cos\theta}{\sin\theta} =\dfrac{2/2-1/2}{\sqrt3/2} =\dfrac{1/2}{\sqrt3/2} =\dfrac1{\sqrt3}\). Therefore \(x_n=2^n\left(\cos\left(\dfrac{n\pi}{3}\right)+\dfrac1{\sqrt3}\sin\left(\dfrac{n\pi}{3}\right)\right)\).

Check: At \(n=0\), the formula gives \(1\). At \(n=1\), it gives \(2(1/2+1/2)=2\). The recurrence gives \(x_2=2x_1-4x_0=0\) and \(x_3=2x_2-4x_1=-8\). The formula also gives \(x_2=4(-1/2+1/2)=0\) and \(x_3=8(-1+0)=-8\), as required.

Two Further Forms of the Oscillation

The sine-and-cosine expression records the initial conditions directly, but it can also be written as a single shifted cosine. If \(C,D\) are not both zero, set \(R=\sqrt{C^2+D^2}\) and choose an angle \(\phi\) such that \(\cos\phi=C/R\) and \(\sin\phi=D/R\). Then the angle-addition identity gives \(C\cos(n\theta)+D\sin(n\theta)=R\cos(n\theta-\phi)\). Thus the solution is \(x_n=Rr^n\cos(n\theta-\phi)\). If \(C=D=0\), every term is zero, and no phase angle is needed. This form describes an oscillation whose angle advances by \(\theta\) at each step, scaled by \(Rr^n\).

For real coefficients, the discriminant test can often be used before calculating any roots. A negative discriminant means the recurrence has the oscillatory form above; a zero or positive discriminant does not give a nonreal conjugate pair. In particular, a repeated real root is not covered by this formula. The condition \(\sin\theta\ne0\) is essential when solving for \(D\), and is guaranteed here by the roots being nonreal.

Worked Example: A Pure Sine Pattern

Solve \(x_{n+2}+\tfrac14x_n=0\) with \(x_0=3\) and \(x_1=2\).

The characteristic polynomial is \(\lambda^2+\tfrac14\). Its roots satisfy \(\lambda^2=-\tfrac14\), so they are \(i/2\) and \(-i/2\). Hence \(r=1/2\) and \(\theta=\pi/2\). The constants are \(C=3\) and \(D=\dfrac{2/(1/2)-3\cos(\pi/2)}{\sin(\pi/2)}=4\). The solution is \(x_n=(1/2)^n(3\cos(n\pi/2)+4\sin(n\pi/2))\).

Check: The formula gives \(x_0=3\) and \(x_1=(1/2)(4)=2\). The recurrence gives \(x_2=-\tfrac14(3)=-\tfrac34\) and \(x_3=-\tfrac14(2)=-\tfrac12\). The formula gives \(x_2=(1/4)(-3)=-\tfrac34\) and \(x_3=(1/8)(-4)=-\tfrac12\), confirming the terms.

Worked Example: Roots with a Non-special Angle

Solve \(x_{n+2}-2x_{n+1}+5x_n=0\) with \(x_0=0\) and \(x_1=1\).

The characteristic polynomial is \(\lambda^2-2\lambda+5\). Its discriminant is \(4-20=-16\), and its roots are \(1\pm2i\). Their modulus is \(r=\sqrt5\). For the root \(1+2i\), \(\cos\theta=1/\sqrt5\) and \(\sin\theta=2/\sqrt5\); these values define \(\theta\) in \((0,\pi)\). The initial values give \(C=0\) and \(D=\dfrac{1/\sqrt5}{2/\sqrt5}=\tfrac12\). Thus \(x_n=\dfrac12(\sqrt5)^n\sin(n\theta)\), with \(\cos\theta=1/\sqrt5\) and \(\sin\theta=2/\sqrt5\).

Check: The formula gives \(x_0=0\) and \(x_1=\tfrac12\sqrt5(2/\sqrt5)=1\). The recurrence gives \(x_2=2x_1-5x_0=2\) and \(x_3=2x_2-5x_1=-1\). For \(n=2\), \(\sin(2\theta)=2\sin\theta\cos\theta=4/5\), so the formula gives \(x_2=\tfrac12(5)(4/5)=2\). For \(n=3\), \(\sin(3\theta)=3\sin\theta-4\sin^3\theta=-2/(5\sqrt5)\), so it gives \(x_3=\tfrac12(5\sqrt5)(-2/(5\sqrt5))=-1\).

Common Pitfall: Losing the Factor \(r\)

The initial value \(x_1\) is not \(C\cos\theta+D\sin\theta\); the formula has an additional factor \(r\) at index \(1\). For the first worked example, the incorrect calculation \(D=(x_1-C\cos\theta)/\sin\theta\) gives \(D=(2-\tfrac12)/(\sqrt3/2)=\sqrt3\). Substituting this value into the claimed solution gives \(x_1=2(\tfrac12+\sqrt3\cdot\tfrac{\sqrt3}{2})=4\), contradicting the required initial value \(x_1=2\). The correct calculation divides \(x_1\) by \(r\) first: \(D=(x_1/r-C\cos\theta)/\sin\theta=(1-\tfrac12)/(\sqrt3/2)=1/\sqrt3\). Always substitute the proposed constants back into both initial values before using the resulting sequence.

The formula also provides a simple scale bound. Since \(|\cos(n\theta)|\leq1\) and \(|\sin(n\theta)|\leq1\), it follows that \(|x_n|\leq r^n(|C|+|D|)\). This bound does not remove the oscillation; it separates a bound on the size from the changing sine-and-cosine factor. The central procedure is therefore: identify the conjugate roots, write their modulus and angle, use \(x_0,x_1\) to find \(C,D\), and verify the initial terms against the recurrence.

Check Your Understanding

For each problem, identify what the roots imply and check any proposed formula using the recurrence and its initial values.

  1. For \(x_{n+2}+2x_{n+1}+5x_n=0\), find the characteristic roots, \(r\), and \(\theta\).
  2. For \(x_{n+2}-x_n=0\), explain why the nonreal-conjugate formula in this tutorial does not apply.
  3. Find \(C,D\) for roots \(2(\cos(\pi/3)\pm i\sin(\pi/3))\) and initial values \(x_0=0,\ x_1=1\).
  4. Use the discriminant to decide whether \(x_{n+2}+3x_{n+1}+4x_n=0\) has a nonreal root pair.
  5. For a solution \(x_n=r^n(C\cos(n\theta)+D\sin(n\theta))\), write \(x_0\) and \(x_1\) in terms of \(r,\theta,C,D\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon