Invariance Of Inner Product and Quadratic Forms

I think what you might be missing is that the matrix $\mathsf A$ in $Q(\mathbf x)=\langle\mathbf x,\mathcal A\mathbf x\rangle=\mathsf x^T\mathsf A\mathsf x$ depends on the linear operator $\mathcal A$ (obviously), the choice of basis, and the choice of inner product. Clearly when $\mathcal x$ and $\mathcal A$ are respectively the coordinates of $\mathbf x$ and matrix of $\mathcal A$ relative to some orthonormal basis, this follows from linearity of the inner product. What happens when the basis isn’t orthonormal?

Let $\mathcal B=(\mathbf v_1,\dots,\mathbf v_n)$ be an arbitrary ordered basis of $\mathbb R^n$ and $\mathsf B$ the matrix whose columns are the coordinates of the $\mathbf v_i$ in some orthonormal basis $\mathcal E$. The matrix $\mathsf B$ then converts from $\mathcal B$-coordinates to $\mathcal E$-coordinates. Then, if $\mathsf a$ and $\mathsf b$ are the $\mathcal B$-coordinate vectors of $\mathbf a$ and $\mathbf b$, respectively, we have $$\langle\mathbf a,\mathbf b\rangle = (\mathsf B\mathsf x)^T(\mathsf B\mathsf y) = \mathsf x^T(\mathsf B^T\mathsf B)\mathsf y.$$ The matrix $\mathsf G=\mathsf B^T\mathsf B$ is known as the Gram matrix of $\mathsf B$. Moreover, if $\mathsf A$ is the matrix of a linear operator $\mathcal A$ with respect to $\mathcal E$, then $$\langle\mathbf x,\mathcal A\mathbf x\rangle = (\mathsf B\mathsf x)^T(\mathsf A\mathsf B\mathsf x) = \mathsf x^T(\mathsf B^T\mathsf A\mathsf B)\mathsf x,$$ which is also of the required form. (I could’ve chosen $\mathsf A$ to be the matrix of $\mathcal A$ relative to $\mathcal B$ instead to get $\mathsf G\mathsf A$ for the matrix of the quadratic form, but I did it the other way in anticipation of the change-of-basis formula for quadratic forms.)

I’ll leave as an exercise for you to show that this also works for an arbitrary inner product. The key is to show that any scalar product $(\mathbf a,\mathbf b)$ can be expressed in coordinates as $\mathsf a^T\mathsf Q\mathsf b$ for some fixed symmetric matrix $\mathsf Q$. Additionally, for an inner product (a positive-definite scalar product), it’s always possible to find a basis in which it looks like the standard Euclidean inner product. (Use the Gram-Schmidt process.)