In Riley's Math Methods book, there is a discussion on quadratic forms (see attached). However, I'm generally more lost about the assertion that "In any basis we can write..." the inner product as below. I am wondering why this is true. To be clear, we defined the (standard) inner product where orthogonal vectors $\mathbf a,\mathbf b$ have $\langle \mathbf a,\mathbf b\rangle=0$. In order to exploit this definition, we spoke earlier in the book about expressing any vector in the vector space as a linear combination of an orthonormal basis set so that we could evaluate $\langle \mathbf a,\mathbf b\rangle$ component-wise, as
$$\langle \mathbf a,\mathbf b\rangle=a_1b_1+a_2b_2...$$
If the vectors are not so expressed, then evaluating the inner product is more complex and consists of "cross terms" where we must consider the non-zero inner products of basis vectors (which are not orthogonal). Accordingly, I'm wondering how we can generally say that
$$Q(\mathbf x)=\langle \mathbf x,A\mathbf x \rangle=\mathbf x^TA\mathbf x$$
since this seems to imply that that $\mathbf x$ is expressed as a linear combination of orthonormal basis vectors. Now my understanding is that $Q(\mathbf x)$ is a (variable) scalar and so invariant under the various bases that we choose, but in order to evaluate it as we did above I assume that $\mathbf x$ needs to be expressed as an orthonormal basis right?