Linear Algebra Basis Trick Let $V$ be a finite dimensional vector space over a field $F$. More generally, we can consider a free module $M$ over a commutative ring $A$, with rank $n$. 
Let $(m_1,...,m_n)$ be a basis for $M/A$ and $(m_1',m_2',...,m_n')$ be another basis. 
Any linear map $L:M\to M$ over $A$, has a corresponding matrix with respect to $m_i$ and $m_i'$. With respect to $m_i$ the matrix is given by $(a_{ij})$ where $Lb_j = \sum_i a_{ij}b_i$ and similarly for $(a'_{ij})$. We also have another matrix $(u_{ij})$, called the change-of-basis, from $m_i$ to $m_i'$, given by $m_j = \sum_i u_{ij}m_j'$. 
I always forget the relationship between $(a_{ij})$ and $(a'_{ij})$. Of course, I can derive it, but it is annoying when one has to do it again and again. What is the right way to conjugate? Is there some easy-to-remember technique, most preferably, using a commutative diagram, that we can use? I really hate it when my train of thought gets derailed trying to figure out which matrix goes where. 
As an additional question. How about those computations including the bilinear form matrix and its change-of-basis and those including discriminants of number fields with respect to a basis? Is there a generally convenient way of looking at this? 
 A: The relation that uses the coefficients of the matrix  $(a_{ij})$ is wrong. Don't forget matrix multiplication is done multiplying $row$ of the first matrix by columns of the second matrix. So the relation is:
$$Lb_i=\sum_{j=1}^n a_{ij}b_j$$
The change of basis matrix is also wrong: its column-vectors are made up of the coordinates of the new basis: $(m'_1,\dots,m'_n)$ in the old basis: $(m_1,\dots,m_n)$.
But it allows to compute ‘old’  coordinates (wrt the old basis) of a vector from their ‘new’ cordinates. So if we denote $X$ the column vector of coordinates in the old basis, $X'$ the column vector of the same vector in the new basis, $Y$ the column vector of old coordinates of the image of $X$ by $L$, and similarly for $Y'$, we have the relations ($A$ is the matrix of the transformation $L$ in the old basis, $A'$ its matrix in the new basis):
$$Y=AX,\qquad X= PX',\qquad Y=PY',$$
hence $$PY'=A(PX')\iff Y'=(P^{-1}AP)X'$$
so that $\,\,A'=P^{-1}AP$.
Here is a reminder in the form of a commutative diagram: both horizontal arrows are $f$, and both vertical arrows are the identity map, in the relevant bases. Just remember the change of basis from $\mathcal B$ to $\mathcal B'$ matrix is but the matrix of the identity map from $(E,\mathcal B')$ to  $(E,\mathcal B)$ :

A: There's some notation, which I think I learned from Lang's Algebra, that seems to make these things easier. If $f\colon V \to W$ is linear and we have bases $\mathbf v$ and $\mathbf w$ then ${}_{\mathbf w}[f]_{\mathbf v}$ is the matrix with respect to these. We have the property that ${}_{\mathbf w}[g]_{\mathbf v} \cdot {}_{\mathbf v}[f]_{\mathbf u} = {}_{\mathbf w}[g \circ f]_{\mathbf u}$.
Now, if I have two bases $\mathbf v$ and $\mathbf v'$ for $V$ then your  change of basis matrix from the first to the second R is just ${}_{\mathbf v'}[\operatorname{id}_V]_{\mathbf v}$. And now you can use  the composition rule.
