The question seems trivial which is why I have some trouble coming up with a proof that is mathematically correct. BTW I cannot yet use eigenvalues as we have not yet covered them in class.
If $$D=[d_{ij}]$$ is an $n\times n$ matrix then $$D^2=\sum_{k=1}^{n}d_{ik}d_{kj}$$ But we know that when $i\ne k$, $d_{ik}=0$ and that when $j\ne k$, $d_{kj}=0$ because the matrix has the property of being a diagonal matrix. Therefore $$D^2=\sum_{k=1}^{n}d_{kk}d_{kk}=\sum_{k=1}^{n}d_{kk}^2$$
My problem is, I have no idea if his proof is sufficiently mathematically complete and how to improve it if not.
$\endgroup$ 11 Answer
$\begingroup$What you wrote $$\sum_{k=1}^n d_{ik}d_{kj}$$ is the entry of $D^2$ in the $ith$ row and $jth$ column.
If $i = j$, this sum is $d_{ii}^2$ since both factors are nonzero exactly when $k=i$.
If $i\neq j$, this sum is $0$ since the first factor in each term $d_{ik}$ is nonzero only when $k=i$, but the second factor $d_{kj}$ is zero then.
This shows that all nondiagonal entries of $D^2$ are $0$ and the diagonal entries of $D^2$ are the squares of the diagonal entries of $D$. Since $0^2=0$, each entry of $D^2$ are squares of the corresponding entry in $D$.
$\endgroup$