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

Compute a new Gram matrix by congruence

Use when: you have a form's Gram matrix relative to one basis and a change-of-basis matrix P, and need the Gram matrix relative to the new basis

Goal: the new Gram matrix A'=P^{\mathsf T}AP, correctly distinguished from the similarity transform a linear map's matrix would use instead

Taught in Change of basis for forms: congruence, not similarity

  1. 1

    Build P's columns from the new basis vectors, written in the old basis's coordinates.

    Example

    For the new basis \{(1,1),(1,-1)\}, P=\begin{pmatrix}1&1\\1&-1\end{pmatrix}, one new basis vector per column.

    Why: congruence needs the same change-of-basis matrix chapter 01 already builds for ordinary coordinate changes, not a new object.

  2. 2

    Compute the product AP before bringing in P^{\mathsf T}; matrix multiplication order matters here.

    Example

    For A=\begin{pmatrix}2&0\\0&-1\end{pmatrix}, AP=\begin{pmatrix}2&2\\-1&1\end{pmatrix}.

    Why: A'=P^{\mathsf T}AP is a product of three matrices, and computing AP first turns the rest into a single ordinary matrix multiplication.

  3. 3

    Transpose P, then multiply it against the product from Step 2.

    Example

    P^{\mathsf T}AP=\begin{pmatrix}1&1\\1&-1\end{pmatrix}\begin{pmatrix}2&2\\-1&1\end{pmatrix}=\begin{pmatrix}1&3\\3&1\end{pmatrix}.

    ⚡ Shortcut

    If A is symmetric, A'=P^{\mathsf T}AP is guaranteed symmetric too, for any invertible P; checking the result's symmetry is a quick sanity test on the arithmetic.

    Why: this section's derivation shows the new Gram matrix is exactly P^{\mathsf T}AP, never P^{-1}AP, which is the rule for a linear map's matrix instead.

  4. 4

    If P^{-1}AP is available for comparison, compute it too and check that it genuinely differs from A' unless P is orthogonal.

    • P^{-1}=P^{\mathsf T} (an orthogonal P) — congruence and similarity happen to give the same answer.
    • P^{-1}\ne P^{\mathsf T} — the two answers genuinely differ, and only P^{\mathsf T}AP is correct for a form.

    Why: mixing up the two formulas is this topic's single most common error, so checking they diverge, or coincide only when P is orthogonal, catches the mistake immediately.

Common mistakes

  • Using P^{-1}AP, the rule for a linear map's matrix, instead of P^{\mathsf T}AP for a form's Gram matrix.
  • Multiplying in the wrong order and getting confused, rather than simply computing AP first as a fixed habit.
  • Forgetting to transpose P at all, and left-multiplying by P itself.
  • Assuming A' must look different from A; a symmetric form can still be congruent to one that looks similar.