How do I show AD_ij? I am doing my homework and I came across this question. I get confused as to how prove what they are asking.
Let $D$ be a $n \times n$ diagonal matrix with diagonal elements $d_i$ and $A = A_{ij}$ be a square matrix of dimension $n \times n$. Show that $DA$ corresponds to multiplying the $i$th row of $A$ by $d_i$ and that $AD$ is the corresponding operation on columns. 
It will help to write down an expression for $(AD)_{ij}$ and then explain why this correspondence holds. 
 A: If $[A_{ij}]$ and $[D_{ij}]$ were arbitrary matrices, their product would be given by $(AD)_{ij}=\sum_{i=1}^k A_{ik}D_{kj}$.
In your case, a lot of these are zero. Use that to simplify things.
A: $D_{ij} = d_i$ if $i=j$ and zero otherwise.
$[AD]_{ij} = \sum_k A_{ik} D_{kj}$ but because $D_{kj} = 0$ for all $k\neq j$,
all but one term in the sum disappears, and you get
$$[AD]_{ij} = A_{ij} D_{jj} = A_{ij}d_j$$
So every element of $[AD]$ is the corresponding element of $A$, multiplied by the diagonal element of $D$ that matches the column index of the element of $A$.
Completely similar analysis of $[DA]$ leads to the same conclusion, only now it is the row index of the element of $A$ that matters.
A: Hint:
Write the definition of the product. For the sake of being as general as possible, denote $d_{ij}$ the element in row $i$ and column $j$ of D. We know that $d_{ij}=0$ if $i\ne j$,  $d_{ii}=d_i$. Denote  $c_{ij}$ the similar coefficient of the product $DA$. By definition,
$$c_{ij}=d_{i1}A_{1j}+\dots+d_{ii}A_{ij}+\dots +d_{in}A_{nj}=d_{i}A_{ij}.$$
