Simultaneous diagonlisation of two quadratic forms, one of which is positive definite

Let $\varphi, \phi$ be quadratic forms on $V$ and suppose $\varphi$ is positive definite.

I want to find a basis for V such that $\varphi$ and $\phi$ are both represented by diagonal matrices.

My idea is to define an inner product $<,>: V\times V \rightarrow F$ where $<v,w> = \varphi(v,w)$.

I know that if I can find a basis that is orthonormal w.r.t. this inner product that diagonalises $\phi$, then I am done, since $\varphi$ will be represented by the identity with respect to this basis.

I know that I can use Gram-Schmidt to get an orthonormal basis for $V$, but I don't understand how to choose a basis that diagonalises $\phi$.

I realised I didn't understand what I was doing when I tried the example where $\phi$ is the symmetric bilinear form associated to $2x^2 + 3y^2 +3z^2 - 2yz = (\sqrt{3}z - \frac{1}{\sqrt{3}}y)^2 + 2x^2 + \frac{8}{3}y^2$ which is positive definite, and wish to simultaneously diagonalise this and $\phi$ which is the symmetric bilinear form associated to the quadratic form $3x^2 + 3y^2 + z^2 +2xy - 3xz + 3yz$.

Help in general, or with relevance to this particular example, gratefully received.

• Well, seeing as this is mostly a question about bilinear forms, the natural notion of diagonalisation is invertible $P, P^T AP$. I'm not so much after a quick way to do the computation, more an explanation of what is going on when diagonalising $\phi$. I don't have access to the book, unfortunately. – probablystuck May 10 '17 at 14:28
• Notably, $\varphi$ and $\phi$ are both "phi". – Omnomnomnom May 10 '17 at 14:41

Let $\varphi$ denote the positive definite form. Let $\psi$ denote the second form. I'll assume you're working over $F = \Bbb R$; for $F = \Bbb C$ you'd have to clarify whether we're considering a "sesquilinear" quadratic form.
If $A$ is the matrix of $\psi$ relative to a $\varphi$-orthonormal basis, you question amounts to asking whether there exists an orthogonal matrix $U$ such that $U^TAU$ is diagonal. By the spectral theorem, this is possible whenever $A$ is symmetric. Since $A$ is the matrix associated with a quadratic form, it is always possible; $A$ is necessarily symmetric.
In order to find such a basis, it suffices to find an orthonormal eigenbasis of $A$. That is: from our bilinear form $\psi$, we get a linear transformation $T_\psi$. Once we select mutually orthogonal eigenvectors of $T_\psi$, we have the columns of our desired $U$. To that end, it suffices to find any basis eigenvectors, then apply the Gram-Schmidt process.