Confusion over a change of bases Suppose I am given that a bilinear form $\phi(u,v)$ on $\mathbb{R}^3$ is represented by a diagonalisable matrix $M$ with respect to the pair of bases $\{u_i\}$ and $\{v_i\}$. If I wanted to find a pair of bases $\{\tilde{u_i}\}$ and $\{\tilde{v_i}\}$ with respect to which $\phi$ is represented by a diagonal matrix, would I simply need to diagonalise $M$ i.e. find $P$ such that:
$$\Delta =PMP^{-1}$$
and then see where $P$ sends $\{u_i\}$ and $\{v_i\}?$ This feels wrong but I am not sure how else to answer this.
 A: Lets consider bases $\mathcal{B}_{1} = \{u_{i}\}$, $\mathcal{B}_{2} = \{v_{i}\}$, $\mathcal{B}_{1}^{\prime} = \{ u_{i}^{\prime}\}$, $\mathcal{B}_{2}^{\prime} = \{ v_{i}^{\prime}\}$.  You have that
$$\phi(w_{1},w_{2}) = [w_{1}]_{\mathcal{B}_{1}}^{T} M [w_{2}]_{\mathcal{B}_{2}}$$
and also that
$$\phi(w_{1},w_{2}) = [w_{1}]_{\mathcal{B}_{1}^{\prime}}^{T} \Delta [w_{2}]_{\mathcal{B}_{2}^{\prime}}$$
for some diagonal matrix $\Delta$.  You should use the change of bases matrices to get the correct formula from here.
If you can find $PMP^{-1} = \Delta$, then you can take $P = A_{1}^{T}$ and $P^{-1} = A_{2}$ and use that info to recover your bases (by interpreting them as the correct change-of-basis matrices, see the comment below).
A: You don't typically coordinatize bilinear forms by pairs of bases, but rather only by one base, i.e. the matrix $M$ of $\phi$ with respect to the base $U$ is given by $M_{i,j} = \phi(u_i, u_j)$. Switching to a different base is realized by a congruence transformation, that is, a transformation of the form $M \mapsto P^T M P$ with $P$ a regular matrix.
Algorithmically, you would try to transform $M$ to diagonal form by performing congruence operations. This means that after performing an operation on the columns of $M$, you immediately perform the corresponding operations on the rows.
Example: Say you swap columns 1 and 4. Then immediately afterwards, you have to swap rows 1 and 4. This algorithm can also give you the transformation matrix $P$ if you start with an identity matrix and perform the column operations on it in parallel to $M$.
