Let $w_{1},...,w_{n}\in V$. Let $g_{ij}:=T(w_{i},w_{j})$, where $T(w_{i},w_{j})$ denotes the inner product. I want to show that $g_{ij}=\displaystyle\sum_{k=1}^{n}a_{ik}a_{kj}$.
Hint: suppose that $v_{1},...,v_{n}$ is an orthonormal basis for $V$ with respect to $T$ and $w_{i}=\displaystyle\sum_{j=1}^{n}a_{ij}v_{j}$.
I am lost a bit in the indices that appear in the solution:
Let $A:=(a_{ij})$ with $w_{i}=\displaystyle\sum_{j=1}^{n}a_{ij}v_{j}$. Then by the bilinearity $g_{ij}=T(w_{i},w_{j})=\displaystyle\sum_{k}a_{ik}a_{kj}$, where the rhs is just the entries of $AA^{T}$.
In, paricular I don't understad how to obtain the last equality (the sum). Since
$$w_{i}=\displaystyle\sum_{j=1}^{n}a_{ij}v_{j}\hspace{4mm} \text{and}\hspace{4mm} w_{j}=\displaystyle\sum_{i=1}^{n}a_{ji}v_{i}$$
is it true then
$$\displaystyle\sum_{i=1,j=1}^{n}w_{i}w_{j}=\displaystyle\sum_{j=1}^{n}\displaystyle\sum_{i=1}^{n}a_{ij}a_{ji}v_{j}v_{i}$$ but then as $v_{1},...v_{n}$ is an orthonormal basis with respect to $T$ we have that $$v_{j}v_{i}:=\delta_{ji}=\begin{cases}1,\;\text{if}\;j=i\\0 \;\text{if}\;j\neq i\end{cases}$$
Can someone explain how to get
$$g_{ij}=\displaystyle\sum_{k}a_{ik}a_{kj}$$ where did the index $k$ come from?
Thanks in advance
The index $k$ comes from the definition of matrix multiplication. If $A = (a_{ij})_{m \times n}$ and $B = (b_{ij})_{n \times p}$, then if $C = A \cdot B$, by definition we have: $$c_{ij} = \sum_{k = 1}^n a_{ik} b_{kj} $$
Try to recognize and interprete the matrix multiplications that appeared.