Unit 6, lesson 29

Rayleigh Quotients

How the Rayleigh quotient of a Hermitian matrix ignores scaling, equals a weighted average of eigenvalues, and has the smallest and largest eigenvalues as its minimum and maximum, attained on whole eigenspaces.

  • Video 29
  • Rayleigh Quotients and Min-Max Bounds

Let xx run around the unit circle and record xTAxx^{\mathsf{T}}Ax for the symmetric matrix AA with rows (2,1)(2, 1) and (1,2)(1, 2). Writing x=(cos⁡θ,sin⁡θ)x = (\cos\theta, \sin\theta) gives the reading 2+sin⁡2θ2 + \sin 2\theta, which swings between 11 and 33, exactly the eigenvalues of AA, and reaches them along the eigenvectors (1,−1)(1, -1) and (1,1)(1, 1). This lesson explains why that happens for every Hermitian matrix. The tool is the Rayleigh quotient, which turns out to be a weighted average of eigenvalues, and the same argument shows which vectors attain the extremes, what changes when an eigenvalue repeats, and why the matrix must be Hermitian.

Key terms

Rayleigh quotient

Definition Let F\mathbb{F} be R\mathbb{R} or C\mathbb{C}, and let A∈Fn×nA \in \mathbb{F}^{n \times n} be Hermitian (real symmetric when F=R\mathbb{F} = \mathbb{R}). The Rayleigh quotient of AA is the function defined for nonzero x∈Fnx \in \mathbb{F}^n by

RA(x)=x∗Axx∗x=⟨x,Ax⟩⟨x,x⟩.R_A(x) = \frac{x^{*}Ax}{x^{*}x} = \frac{\langle x, Ax \rangle}{\langle x, x \rangle}.

The denominator is ∥x∥2>0\lVert x \rVert^2 > 0, and the numerator is real because AA is Hermitian, so RA(x)R_A(x) is a real number. If Ax=λxAx = \lambda x with x≠0x \ne 0, then RA(x)=λ x∗x/x∗x=λR_A(x) = \lambda\, x^{*}x / x^{*}x = \lambda, so every eigenvalue of AA is a value of the quotient.

In plain words The quotient measures the quadratic form per unit of squared length. At an eigenvector it reads off the eigenvalue.

Example For the matrix AA with rows (2,1)(2, 1) and (1,2)(1, 2) and the vector x=(1,2)x = (1, 2),

RA(x)=2+2+2+81+4=145.R_A(x) = \frac{2 + 2 + 2 + 8}{1 + 4} = \frac{14}{5}.

At the eigenvectors (1,1)(1, 1) and (1,−1)(1, -1) the quotient is 6/2=36/2 = 3 and 2/2=12/2 = 1.

Scale invariance of the quotient

Definition For every nonzero x∈Fnx \in \mathbb{F}^n and every nonzero scalar c∈Fc \in \mathbb{F},

RA(cx)=c‾ c  x∗Axc‾ c  x∗x=RA(x).R_A(cx) = \frac{\overline{c}\,c\; x^{*}Ax}{\overline{c}\,c\; x^{*}x} = R_A(x).

So the quotient is constant along each line through the origin, with the origin itself removed. In particular RA(x)=RA(x/∥x∥)R_A(x) = R_A(x / \lVert x \rVert), and RA(u)=u∗AuR_A(u) = u^{*}Au when ∥u∥=1\lVert u \rVert = 1, so the values of the quotient are exactly the values of u∗Auu^{*}Au on the unit sphere. Over C\mathbb{C} the scalar cc may be complex, so all the phase multiples eiθxe^{i\theta}x give the same value.

In plain words Only the direction of xx matters, not its length, and over C\mathbb{C} not its phase either. That is why one may restrict attention to unit vectors without losing any value.

Example With AA and x=(1,2)x = (1, 2) as above, the numerator is 1414 at xx and 126126 at −3x=(−3,−6)-3x = (-3, -6), but the quotients agree, since

RA(−3x)=12645=145.R_A(-3x) = \frac{126}{45} = \frac{14}{5}.

Over C\mathbb{C} the vector (2−i)x(2 - i)x gives the same value, with the common factor ∣2−i∣2=5\lvert 2 - i \rvert^2 = 5 in numerator and denominator.

Weighted average of eigenvalues

Definition Let A∈Fn×nA \in \mathbb{F}^{n \times n} be Hermitian, and let q1,…,qnq_1, \dots, q_n be an orthonormal basis of Fn\mathbb{F}^n with Aqj=λjqjAq_j = \lambda_j q_j and every λj\lambda_j real, as the spectral theorem provides. Write a nonzero xx as x=c1q1+⋯+cnqnx = c_1q_1 + \cdots + c_nq_n with cj=qj∗xc_j = q_j^{*}x. Then Ax=∑jλjcjqjAx = \sum_j \lambda_j c_j q_j, orthonormality removes every mixed term, and

x∗Ax=∑j=1nλj∣cj∣2,x∗x=∑j=1n∣cj∣2.\begin{gathered} x^{*}Ax = \sum_{j=1}^{n} \lambda_j \lvert c_j \rvert^2, \\[0.4em] x^{*}x = \sum_{j=1}^{n} \lvert c_j \rvert^2. \end{gathered}

Hence

RA(x)=∑j=1nwjλj,wj=∣cj∣2∥x∥2.\begin{gathered} R_A(x) = \sum_{j=1}^{n} w_j \lambda_j, \\[0.4em] w_j = \frac{\lvert c_j \rvert^2}{\lVert x \rVert^2}. \end{gathered}

The weights are nonnegative and add up to 11, so the quotient is a weighted average of the eigenvalues. The eigenvalues are the same for every input, and only the weights depend on xx. For a unit vector the weights are simply ∣cj∣2\lvert c_j \rvert^2. The argument works over C\mathbb{C} because each ∣cj∣2\lvert c_j \rvert^2 is a nonnegative real number.

In plain words Split xx into its eigenvector components. Each component contributes its eigenvalue, weighted by the share of the squared length that it carries.

Example For the matrix AA with rows (2,1)(2, 1) and (1,2)(1, 2), take q1=(1,−1)/2q_1 = (1, -1)/\sqrt{2} with λ1=1\lambda_1 = 1 and q2=(1,1)/2q_2 = (1, 1)/\sqrt{2} with λ2=3\lambda_2 = 3. For x=(1,2)x = (1, 2) the coefficients are c1=−1/2c_1 = -1/\sqrt{2} and c2=3/2c_2 = 3/\sqrt{2}, so ∣c1∣2=1/2\lvert c_1 \rvert^2 = 1/2 and ∣c2∣2=9/2\lvert c_2 \rvert^2 = 9/2, which add up to ∥x∥2=5\lVert x \rVert^2 = 5. The weights are 1/101/10 and 9/109/10, and

RA(x)=110⋅1+910⋅3=145,R_A(x) = \frac{1}{10} \cdot 1 + \frac{9}{10} \cdot 3 = \frac{14}{5},

as computed directly before.

Minimum and maximum of the Rayleigh quotient

Definition Let A∈Fn×nA \in \mathbb{F}^{n \times n} be Hermitian with eigenvalues ordered as λ1≤λ2≤⋯≤λn\lambda_1 \le \lambda_2 \le \cdots \le \lambda_n, repeated according to multiplicity. Then

λ1≤RA(x)≤λn\lambda_1 \le R_A(x) \le \lambda_n

for every nonzero x∈Fnx \in \mathbb{F}^n, and both bounds are attained, so

min⁡x≠0RA(x)=λ1,max⁡x≠0RA(x)=λn.\begin{gathered} \min_{x \ne 0} R_A(x) = \lambda_1, \\[0.4em] \max_{x \ne 0} R_A(x) = \lambda_n. \end{gathered}

With the weights wjw_j from the eigenvector expansion, the lower bound follows from RA(x)−λ1=∑jwj(λj−λ1)R_A(x) - \lambda_1 = \sum_j w_j(\lambda_j - \lambda_1), a sum of nonnegative terms, and the upper bound from λn−RA(x)=∑jwj(λn−λj)\lambda_n - R_A(x) = \sum_j w_j(\lambda_n - \lambda_j) in the same way. A unit eigenvector for λ1\lambda_1 gives the value λ1\lambda_1, and one for λn\lambda_n gives λn\lambda_n, so the bounds are sharp. The Hermitian hypothesis is needed. The real form xTBxx^{\mathsf{T}}Bx of a real matrix BB only detects its symmetric part, so the eigenvalues of a nonsymmetric BB need not bound it. A complex matrix that is not Hermitian can give nonreal values, as iIiI does, with quotient ii at every nonzero vector, and then a minimum does not even make sense.

In plain words A weighted average can never fall below its smallest ingredient or rise above its largest, and it reaches either one by putting all the weight there. So the extreme readings of the quotient are the extreme eigenvalues.

Example For A=diag⁡(1,4)A = \operatorname{diag}(1, 4) and the real unit vector x=(cos⁡θ,sin⁡θ)x = (\cos\theta, \sin\theta),

RA(x)=cos⁡2θ+4sin⁡2θ=1+3sin⁡2θ,\begin{aligned} R_A(x) &= \cos^2\theta + 4\sin^2\theta \\[0.4em] &= 1 + 3\sin^2\theta, \end{aligned}

which runs from 11 at θ=0\theta = 0 to 44 at θ=π/2\theta = \pi/2. The level set x12+4x22=1x_1^2 + 4x_2^2 = 1 is a different picture. It is an ellipse, and its point in the unit direction uu lies at distance 1/RA(u)1/\sqrt{R_A(u)} from the origin, so its radii run from 1/21/2 to 11. Without symmetry the conclusion can fail. The matrix BB with rows (1,4)(1, 4) and (0,1)(0, 1) has both eigenvalues equal to 11, but on real unit vectors xTBx=1+4x1x2x^{\mathsf{T}}Bx = 1 + 4x_1x_2 ranges from −1-1 to 33. Those are the eigenvalues of its symmetric part, the matrix with rows (1,2)(1, 2) and (2,1)(2, 1).

Extremizers in a repeated eigenspace

Definition Let A∈Fn×nA \in \mathbb{F}^{n \times n} be Hermitian with eigenvalues λ1≤⋯≤λn\lambda_1 \le \cdots \le \lambda_n. For nonzero xx,

RA(x)=λ1  ⟺  Ax=λ1x,R_A(x) = \lambda_1 \iff Ax = \lambda_1 x,

and likewise RA(x)=λnR_A(x) = \lambda_n exactly when Ax=λnxAx = \lambda_n x. In the sum RA(x)−λ1=∑jwj(λj−λ1)R_A(x) - \lambda_1 = \sum_j w_j(\lambda_j - \lambda_1), equality with 00 forces wj=0w_j = 0, that is cj=0c_j = 0, for every jj with λj>λ1\lambda_j > \lambda_1, so xx lies in the eigenspace Eλ1=ker⁡(A−λ1I)E_{\lambda_1} = \ker(A - \lambda_1 I). Conversely every nonzero vector of that eigenspace gives λ1\lambda_1. The unit minimizers are therefore exactly the unit vectors of Eλ1E_{\lambda_1}, whose dimension is the multiplicity mm of λ1\lambda_1. When m=1m = 1 they are ±q1\pm q_1 over R\mathbb{R}, or eiθq1e^{i\theta}q_1 over C\mathbb{C}. When m≥2m \ge 2 they fill the whole unit sphere of an mm-dimensional subspace, no single eigenvector is preferred, and any orthonormal basis of the eigenspace can serve in the expansion. The same holds for the maximizers and EλnE_{\lambda_n}.

In plain words The extreme values are reached on whole eigenspaces, not just at one chosen eigenvector. When the smallest eigenvalue repeats there is a whole circle or sphere of minimizing directions, and there is no such thing as the minimizing eigenvector. The same goes for the largest.

Example The matrix

A=[311131113]A = \begin{bmatrix} 3 & 1 & 1 \\ 1 & 3 & 1 \\ 1 & 1 & 3 \end{bmatrix}

satisfies x∗Ax=2∥x∥2+∣x1+x2+x3∣2x^{*}Ax = 2\lVert x \rVert^2 + \lvert x_1 + x_2 + x_3 \rvert^2, so

RA(x)=2+∣x1+x2+x3∣2∥x∥2.R_A(x) = 2 + \frac{\lvert x_1 + x_2 + x_3 \rvert^2}{\lVert x \rVert^2}.

Its eigenvalues are 22, 22 and 55. The minimum 22 is attained exactly when x1+x2+x3=0x_1 + x_2 + x_3 = 0. That plane is the eigenspace for 22, and every unit vector in it is a minimizer, including the orthogonal pair (1,−1,0)/2(1, -1, 0)/\sqrt{2} and (1,1,−2)/6(1, 1, -2)/\sqrt{6} and every unit combination of them. The maximum 55 needs ∣x1+x2+x3∣2=3∥x∥2\lvert x_1 + x_2 + x_3 \rvert^2 = 3\lVert x \rVert^2, the equality case of the Cauchy-Schwarz inequality, so xx is a multiple of (1,1,1)(1, 1, 1). Over R\mathbb{R} the unit maximizers are only ±(1,1,1)/3\pm(1, 1, 1)/\sqrt{3}.

Check yourself

  1. The symmetric matrix AA with rows (5,2)(5, 2) and (2,2)(2, 2) has eigenvectors (1,−2)(1, -2) for the eigenvalue 11 and (2,1)(2, 1) for the eigenvalue 66. Compute RA(e1)R_A(e_1) directly and as a weighted average of the eigenvalues, and give the range of RAR_A.
Show the answer

Directly, RA(e1)=e1TAe1/1=5R_A(e_1) = e_1^{\mathsf{T}}Ae_1 / 1 = 5. The unit eigenvectors are q1=(1,−2)/5q_1 = (1, -2)/\sqrt{5} and q2=(2,1)/5q_2 = (2, 1)/\sqrt{5}, so c1=q1Te1=1/5c_1 = q_1^{\mathsf{T}}e_1 = 1/\sqrt{5} and c2=2/5c_2 = 2/\sqrt{5}. The weights are 1/51/5 and 4/54/5, and

RA(e1)=15⋅1+45⋅6=5.R_A(e_1) = \frac{1}{5} \cdot 1 + \frac{4}{5} \cdot 6 = 5.

Every value of RAR_A lies in [1,6][1, 6], the minimum 11 is attained exactly at the nonzero multiples of (1,−2)(1, -2), and the maximum 66 exactly at the nonzero multiples of (2,1)(2, 1). For 0≤t≤10 \le t \le 1 the unit vector 1−t q1+t q2\sqrt{1 - t}\,q_1 + \sqrt{t}\,q_2 has weights 1−t1 - t and tt and quotient 1+5t1 + 5t, so every value in between occurs as well, and the range is exactly [1,6][1, 6].

  1. The real matrix BB with rows (2,3)(2, 3) and (0,2)(0, 2) has the double eigenvalue 22. Someone concludes that xTBx/xTx=2x^{\mathsf{T}}Bx / x^{\mathsf{T}}x = 2 for every nonzero real xx. Test this at (1,1)(1, 1) and (1,−1)(1, -1), find the true range, and explain what went wrong.
Show the answer

The numerator is xTBx=2x12+3x1x2+2x22x^{\mathsf{T}}Bx = 2x_1^2 + 3x_1x_2 + 2x_2^2. At (1,1)(1, 1) the quotient is 7/27/2, and at (1,−1)(1, -1) it is 1/21/2, so it is not constant. The matrix BB is not symmetric, so the theorem does not apply. The form only detects the symmetric part

H=B+BT2=[23/23/22],H = \frac{B + B^{\mathsf{T}}}{2} = \begin{bmatrix} 2 & 3/2 \\ 3/2 & 2 \end{bmatrix},

whose eigenvalues are 1/21/2 and 7/27/2. On nonzero real vectors the quotient of BB equals RHR_H, so its range is [1/2,7/2][1/2, 7/2], while the eigenvalues of BB itself do not determine it.

  1. For the real symmetric matrix below, find the minimum and maximum of RAR_A and all real unit vectors that attain each. Is the minimizer unique up to sign?
A=[200031013]A = \begin{bmatrix} 2 & 0 & 0 \\ 0 & 3 & 1 \\ 0 & 1 & 3 \end{bmatrix}
Show the answer

Subtracting 2∥x∥22\lVert x \rVert^2 from the form leaves x22+2x2x3+x32x_2^2 + 2x_2x_3 + x_3^2, so

RA(x)=2+(x2+x3)2∥x∥2.R_A(x) = 2 + \frac{(x_2 + x_3)^2}{\lVert x \rVert^2}.

The minimum is 22, attained exactly when x2+x3=0x_2 + x_3 = 0. The minimizing unit vectors are all unit vectors in the plane spanned by e1e_1 and (0,1,−1)(0, 1, -1), such as e1e_1, (0,1,−1)/2(0, 1, -1)/\sqrt{2} and (1,1,−1)/3(1, 1, -1)/\sqrt{3}. That plane is the eigenspace of the double eigenvalue 22, so the minimizers form a whole circle and are not unique up to sign.

For the maximum, (x2+x3)2≤2(x22+x32)≤2∥x∥2(x_2 + x_3)^2 \le 2(x_2^2 + x_3^2) \le 2\lVert x \rVert^2, with equality exactly when x2=x3x_2 = x_3 and x1=0x_1 = 0. So the maximum is 44, attained only at ±(0,1,1)/2\pm(0, 1, 1)/\sqrt{2}, and indeed A(0,1,1)=4(0,1,1)A(0, 1, 1) = 4(0, 1, 1). The eigenvalues are 22, 22 and 44.

How this lesson connects