Please help me understand the following notation Can someone kindly tell me the meaning of the following notation:
A book defined the following matrix $(a_{ij})_{3\times 3}$ :
$a_{ij}=\begin{cases} d_{ij}& i\neq j\\d_{ii}+\sum_{j=1}^3 d_{ij}&i=j\end{cases}$
where $d_{ij}$ are elements defined for $1\le i,j\le 3$.
I dont understand the case for $i=j$ 
Does it mean $d_{11}=d_{11}+d_{12}+d_{13}$?
 A: I agree with Theo Bendit's comment re: the reuse of a variable in the summation, as it tends to confuse people. Thus, I will rephrase it to give that, for $i = j$, the notation means $a_{ii} = d_{ii} + \sum_{k=1}^3 d_{ik} = d_{ii} + d_{i1} + d_{i2} + d_{i3}$. Thus, for example, $a_{11} = d_{11} + d_{11} + d_{12} + d_{13} = 2d_{11} + d_{12} + d_{13}$.
A: \begin{aligned}
a_{11} & = d_{11} + d _{11} + d_{12} + d _{13} \\
a_{12} & = d_{12} \\
a_{13} & = d_{13} \\
a_{21} & = d_{21} \\
a_{22} & = d_{22} + d _{21} + d_{22} + d _{23} \\
a_{23} & = d_{23} \\
a_{31} & = d_{31} \\
a_{32} & = d_{32} \\
a_{33} & = d_{33} + d _{31} + d_{32} + d _{33}
\end{aligned}
A: 
We have for $1\leq i,j\leq 3$
\begin{align*}
a_{ij}&=
\begin{cases} 
d_{ij}\qquad\qquad\qquad\qquad i\neq j\\
d_{ii}+\sum_{\color{blue}{j}=1}^3 d_{i\color{blue}{j}}\quad\qquad i=j
\end{cases}\tag{1}\\
&=
\begin{cases} 
d_{ij}\qquad\qquad\qquad\qquad i\neq j\\
d_{ii}+\left(\sum_{\color{blue}{j}=1}^3 d_{i\color{blue}{j}}\right)\quad\,\,\,\, i=j
\end{cases}\tag{2}\\
&=
\begin{cases} 
d_{ij}\qquad\qquad\qquad\qquad i\neq j\\
d_{ii}+\sum_{k=1}^3 d_{ik}\quad\qquad i=j
\end{cases}\\
\end{align*}
These variants are all valid and represent the same.
  
  
*
  
*In (1) and (2) readability is reduced somewhat due to the multiple usage of  $j$,  on the one hand as bound index    variable   and on the other hand  as  free variable.
  
*The scope of the index variable $\color{blue}{j}$ is indicated in (2)  by parenthesis.

