Matrix of a bilinear form (source code)

= Matrix of a bilinear form
{title2=$A_{ij}=B(e_i,e_j),\quad B(v,w)=v^TAw$}

= Bilinear form matrix
{synonym}

= Pairing matrix
{synonym}

Choose an <ordered basis> $(e_1,\ldots,e_n)$ of a <finite-dimensional vector space>. The <matrix of a bilinear form> records all pairings of <basis vectors>, with $A_{ij}=B(e_i,e_j)$. Writing $v=\sum_i v_i e_i$ and $w=\sum_j w_j e_j$, separate <linearity> gives
$$
B(v,w)=\sum_{i,j}v_iw_jB(e_i,e_j)=\sum_{i,j}v_iA_{ij}w_j=v^TAw,
$$
where the last expression uses the <coordinate vectors> of $v,w$. Conversely, every <matrix> $A$ defines a <bilinear form> by this formula.https://ocw.mit.edu/courses/res-18-011-algebra-i-student-notes-fall-2021/mit18_701f21_lect24.pdf[MIT Algebra I, Lecture 24, Proposition 24.5: basis coefficients]{ref}

For a concrete <bilinear form> on $\mathbb R^2$, take
$$
A=\begin{pmatrix}1&2\\0&1\end{pmatrix},\qquad B(v,w)=v_1w_1+2v_1w_2+v_2w_2.
$$
Then $B((1,0),(0,1))=2$ but $B((0,1),(1,0))=0$: a <bilinear form> need not be a <symmetric bilinear form>. For $v=(2,1)^T$ and $w=(-1,3)^T$, first compute $Aw=(5,3)^T$, then $v^TAw=2\cdot5+1\cdot3=13$. Reversing the inputs gives $Av=(4,1)^T$ and $w^TAv=-4+3=-1$.

\Image[/bilinear-form-pairings.png]
{title=Basis coefficients determine each pairing, but self-pairings lose the alternating part}

Under <change of basis>, let the columns of an <invertible matrix> $P$ be the new <basis vectors> in old <coordinates>. Thus $v=Pv'$ and $w=Pw'$, so
$$
B(v,w)=(Pv')^TA(Pw')=(v')^T(P^TAP)w',\qquad A'=P^TAP.
$$
This is <matrix congruence>, rather than the <matrix similarity> $P^{-1}AP$ for an <endomorphism>. Both inputs have changed <coordinates>, which explains the two factors of $P$. For the displayed $A$ and $P=\begin{pmatrix}1&1\\0&1\end{pmatrix}$, direct multiplication gives $A'=\begin{pmatrix}1&3\\1&4\end{pmatrix}$; its $(1,2)$ entry is $B(e_1,e_1+e_2)=3$.<Bilinear Forms by Keith Conrad>[Theorem 2.8: change of basis]{ref}