I have been told that for orthonormal right-handed bases {$\underline{e_i}$} and {$\underline{e'_i}$} in $\mathbb{R^3}$ with corresponding Cartesian coordinates {$x_i$} and {$x'_i$}: $\underline{x} = x_i\underline{e_i} = x'_i\underline{e'_i}$. Any such bases are related by a rotation: $$\underline{e'_i} = R_{ip}\underline{e_i}, \ x'_i = R_{ip}x_p$$
When I try to derrive that result I do the following; $$x'_i\underline{e'_i} = x'_iR_{ip}\underline{e_p} = x_p\underline{e_p}$$ So, $$x'_iR_{ip} = x_p$$ Which is evidently wrong. Looking for someone to point out (and explain) my mistake as well as any other background information to matrix multiplication that pertains to my current misunderstanding.
*Additional information: I can write $R_{ip}x'_i = R^T_{pi}x'_i = x_p$, so, $R^T\underline{x'} = \underline{x}$, and so since working with a rotation matrix, R is orthogonal so $R^T = R^{-1}$ and using this we can say, $\underline{x'} = R\underline{x}$ and so, $x'_i = R_{ip}x_p$. This is correct but I would like to be able to derrive this result using only suffix notation if possible.