Two problems regarding index notation with rotations I have two questions that refer to the same subject: index notation. Both of them refer to the use of index notation to represent a matrix times a vector.
When we have generally a matrix multiplicating a vector, we have, in index notation:
$$v'_i = a_{ij} v_j$$
(I've come to this formula just by performing the multiplication for a $2 \times 2$ matrix.
But, when we talk about a rotation matrix:
$$S_{ij} = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}$$
Then our multiplication is $$v_i' = S_{ji} v_j$$

Why has $i$ and $j$ changed places? I can see with when we construct the new basis vectors $\mathbf{\hat{e}}_1$ and $\mathbf{\hat{e}}_2$ we arrive to this, but why is the matrix not equal to the transformation $L_{ij} = S^{T}_{ij}$? I dont understand, since i see the matrix $S_{ij}$ as a change of basis matrix.

Another problem with this notation appears when i impose that the norm of a vector must remain constant. So
$$v_i v_i = v'_i v'_i$$
And since $v'_i = L_{ij}v_j$, we could substitute this in the equation above. But the result actually is 
$$v_i v_i = L_{ij}L_{ik}v_jv_k$$

Why do we write $L_{ij}L_{ik}v_jv_k$ instead of $L_{ij}v_jL_{ij}v_j$?

 A: When we say that the matrix 
$$S = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}$$
represents a rotation by an angle $\theta$ in the counterclockwise direction within a plane, what we really mean is that if you have a vector $\mathbf v$ in the plane whose coordinates $(v_1,v_2)$ are given according to a certain orthonormal basis
$B = \{\mathbf b_1, \mathbf b_2\},$
and you want to know the coordinates in the same basis $B$
of a vector $\mathbf v'$ of the same magnitude as $\mathbf v$ but in a direction turned at an angle $\theta$ counterclockwise from the direction of $\mathbf v,$ the answer is
$$
\begin{bmatrix} v'_1 \\ v'_2 \end{bmatrix}
= \begin{bmatrix}
   \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta
  \end{bmatrix}
  \begin{bmatrix} v_1 \\ v_2 \end{bmatrix}
= \begin{bmatrix} 
   (\cos\theta) v_1 - (\sin\theta) v_2 \\ 
   (\sin\theta) v_1 + (\cos\theta) v_2
  \end{bmatrix}
= \begin{bmatrix} 
   S_{11} v_1 + S_{12} v_2 \\ S_{21} v_1 + S_{22} v_2
  \end{bmatrix}.
$$
In other words, the coordinates of the new vector are given by
the formula $$v'_i = S_{ij}vj.$$
We do not reverse the order of the subscripts from the usual order
for matrix multiplication.
On the other hand, suppose we do not want to rotate the vector $\mathbf v,$
but instead we want to know the coordinates of the same vector in a new orthonormal basis
$B' = \{\mathbf b'_1, \mathbf b'_2\},$
where the new basis $B'$ is rotated by an angle $\theta$ counterclockwise
from the old basis $B.$
If we simply copied the coordinates of $\mathbf v$ that we found over the basis $B,$ and said that these were the coordinates of a vector over the basis $B',$ we would be describing a vector $\mathbf v'$ that is rotated an angle $\theta$ counterclockwise from the original vector $\mathbf v.$
But we do not want a new vector; we want new coordinates of the old
vector.
In order to describe our old vector over the new basis, we can
take the new vector $\mathbf v'$ and rotate it backward
(by an angle $\theta$ clockwise)
so that we get back to the original vector $\mathbf v.$
That is, we want to "undo" the undesired rotation of the vector
that occurs due to using the old coordinates over a new basis.
We cannot do this by multiplying by the matrix $S$;
that would rotate the vector an additional angle $\theta$ counterclockwise,
so we end up twice as far from the desired direction.
Instead, we have to multiply by $S^{-1},$
the matrix that reverses the rotation that $S$ performs.
The inverse of a rotation matrix is the transpose of the matrix,
so the new coordinates of the old vector are 
$$
S^{-1} \begin{bmatrix} v_1 \\ v_2 \end{bmatrix}
= S^T \begin{bmatrix} v_1 \\ v_2 \end{bmatrix}
= \begin{bmatrix} S_{11} & S_{21} \\ S_{12} & S_{22} \end{bmatrix}
  \begin{bmatrix} v_1 \\ v_2 \end{bmatrix}
= \begin{bmatrix} 
   S_{11} v_1 + S_{21} v_2 \\ S_{12} v_1 + S_{22} v_2
  \end{bmatrix},
$$
and that's how we might encounter the formula $v'_i = S_{ji}v_j.$
The coordinates of $S$ are "reversed" because we do not multiply
by $S$ for this calculation, but rather multiply by a (usually)
different matrix whose $ij$ entry is the $ji$ entry of $S.$

As for the inner-product question, it's important to remember that
the notation $v'_i = L_{ij}v_j$ represents a summation over the variable $j,$
that is, when we do this with vectors in a plane what we really have is
$$
v'_i = L_{i1} v_1 + L_{i2} v_2
$$
for $i = 1$ and for $i = 2.$
When you write $v_i v_i = v'_i v'_i,$
clearly you do not mean that $v_1v_1 = v'_1v'_1$ and $v_2v_2 = v'_2v'_2,$
because in the general case those equations are not true;
instead you mean that
$v_1v_1 + v_2v_2 = v'_1 v'_1 + v'_2 v'_2.$
Now let's look at the $i$th term of the right-hand sum, $v'_i v'_i.$
We already know that $v'_i = L_{i1} v_1 + L_{i2} v_2.$
Therefore
$$
v'_i v'_i = (L_{i1} v_1 + L_{i2} v_2)(L_{i1} v_1 + L_{i2} v_2).
$$
If we expand out the right-hand side of this,
we not only get the terms $L_{i1} v_1 L_{i1} v_1$
and $L_{i2} v_2 L_{i2} v_2,$
we also get the terms $L_{i1} v_1 L_{i2} v_2$ and $L_{i2} v_2 L_{i1} v_1.$
The pattern $L_{ij} v_j L_{ij} v_j$ matches only the first two terms, so it cannot give the correct sum in general.
The pattern $L_{ij} v_j L_{ik} v_k$ represents all the necessary terms as long as you remember to consider all possible combinations of $(j,k)$
and not just the ones where $j=k.$
And of course since $L_{ij},$ $v_j,$ $L_{ik},$ and $v_k$
all are numbers, the multiplication commutes, and
$$L_{ij} v_j L_{ik} v_k = L_{ij} L_{ik} v_j v_k.$$
