Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Recipe

Find singular values and vectors from the maximum-stretch definition

Use when: A is diagonal (or already diagonalized) and you want \sigma_i, \mathbf v_i directly from the variational definition, not from A^{\mathsf T}A

Goal: every singular value and its matching right singular vector, found one maximization at a time

Taught in Singular values and singular vectors

  1. 1

    For diagonal A with entries c_1,\dots,c_n on the diagonal, \lVert A\mathbf x\rVert^2=c_1^2x_1^2+\cdots+c_n^2x_n^2, a weighted sum of squares.

    Example

    For A=\text{diag}(3,1,2): \lVert A\mathbf x\rVert^2=9x_1^2+x_2^2+4x_3^2, using each diagonal entry squared as the weight on its own coordinate.

    Why: this rewrites the abstract maximum-stretch definition as an ordinary constrained-optimization problem in the unit vector's own coordinates.

  2. 2

    Among unit vectors, a weighted sum of squares is maximized by setting the coordinate with the largest weight to 1 and every other coordinate to 0.

    Example

    The largest weight above is 9 (the x_1^2 term), so the maximum is achieved at \mathbf x=(1,0,0), giving \sigma_1^2=9, so \sigma_1=3 and \mathbf v_1=(1,0,0).

    ⚡ Shortcut

    For a diagonal matrix, skip the optimization argument entirely: sort the absolute values of the diagonal entries in decreasing order, and that sorted list already is \sigma_1,\sigma_2,\dots

    Why: this is exactly the constrained maximum \sigma_1=\max_{\lVert\mathbf x\rVert=1}\lVert A\mathbf x\rVert, restated as ordinary algebra once A is diagonal.

  3. 3

    Set every coordinate already claimed by an earlier singular vector to zero, then maximize the remaining weighted sum among the coordinates that are left.

    Example

    With x_1 fixed at 0, maximize x_2^2+4x_3^2 subject to x_2^2+x_3^2=1: the larger weight is 4, giving \mathbf v_2=(0,0,1), \sigma_2=2. Only one coordinate remains, forcing \mathbf v_3=(0,1,0), \sigma_3=1.

    • every remaining coefficient is distinct — the next singular vector is forced, the standard basis vector for the next-largest remaining weight.
    • two or more remaining coefficients tie for largest — any pair of orthogonal directions spanning that tied space is a valid choice.

    Why: restricting to what's left after every earlier choice guarantees each new singular vector comes out perpendicular to the earlier ones automatically.

  4. 4

    Compute A\mathbf v_i and confirm its length equals the claimed \sigma_i, then confirm every pair of singular vectors has zero dot product.

    Example

    A(1,0,0)=(3,0,0), length 3, matching \sigma_1. (1,0,0)\cdot(0,0,1)=0, confirming \mathbf v_1 and \mathbf v_2 are orthogonal.

    Why: this catches a bookkeeping slip, a wrong coordinate flagged as the maximizer, before it propagates into an incorrect \Sigma, U, or V.

Common mistakes

  • Reporting a negative diagonal entry as a negative singular value; \sigma_i is always \lvert c_i\rvert, and the sign shows up in \mathbf u_i instead.
  • Forgetting to restrict to what's left before finding the next singular vector, and re-maximizing over the full space instead.
  • Picking an arbitrary vector in a tied direction without checking it's actually orthogonal to every earlier singular vector.
  • Skipping the length check in Step 4 and simply trusting whichever coordinate looked biggest.