<s>[INST] How to prove that a $3 \times 3$ Magic Square must have $5$ in its middle cell? A Magic Square of order $n$ is an arrangement of $n^2$ numbers, usually distinct integers, in a square, such that the $n$ numbers in all rows, all columns, and both diagonals sum to the same constant.

How to prove that a normal $3\times 3$ magic square must have $5$ in its middle cell?
I have tried taking $a,b,c,d,e,f,g,h,i$ and solving equations to calculate $e$ but there are so many equations that I could not manage to solve them.
 [/INST] Let 
\begin{array}{|c|c|c|}
\hline
    a & b & c\\ 
\hline
   d & e & f \\ 
\hline
   g & h & i \\ 
\hline
\end{array}
be a magic square of order three with sum row, column, and diagonal sums equal to S. then
\begin{align}
   a+e+i &= S\\
   b+e+h &= S\\
   c+e+g &= S\\
   d+e+f &= S \\
\hline
   (a+b+c)+(d+e+f)+(g+h+i) + 3e &= 4S\\
   3S + 3e = 4S\\
   e = \dfrac 13 S
\end{align}
So, if the top row is $a,b,c$, then $e = \dfrac{a+b+c}{3}$.
We end up with
\begin{array}{|c|c|c|}
\hline
    a & b & c\\ 
\hline
   \dfrac{-2a+b+4c}{3} & \dfrac{a+b+c}{3} & \dfrac{4a+b-2c}{3} \\ 
\hline
   \dfrac{2a+2b-c}{3} & \dfrac{2a-b+2c}{3} & \dfrac{-a+2b+2c}{3} \\ 
\hline
\end{array}
This is OK, but it would be nice to have a representation that doesn't use fractions.  This works.
\begin{array}{|c|c|c|}
\hline
    a & b & -a-b+3e\\ 
\hline
   -2a-b+4e & e & 2a+b-e \\ 
\hline
   a+b-e & -b+2e & -a+2e \\ 
\hline
\end{array}
There are other representations.
For programmers
Every order-3 magic square can be rotated and reflected so that the smallest element is in the center of the left column and the next-smallest element in the bottom of the right column. Having made this transformation, and ordered the elements from 1 to 9, there are two possible outcomes for the 'arrays of orders'.
$$\text{Type 1: } \; 
\begin{bmatrix}
   8 & 3 & 4\\ 
   1 & 5 & 9 \\ 
   6 & 7 & 2 \\ 
\end{bmatrix}
\qquad
\text{Type 0: } \; 
\begin{bmatrix}
   8 & 4 & 3\\ 
   1 & 5 & 9 \\ 
   7 & 6 & 2 \\ 
\end{bmatrix}$$
Note that the first array of orders is in fact also a magic square while the second isn't. An example of a magic square of type $0$ is
$$\begin{bmatrix}
   8 & 4 & 3\\ 
   0 & 5 & 10 \\ 
   7 & 6 & 2 \\ 
\end{bmatrix}$$
Using 
$\quad \begin{bmatrix}
   a & b & c\\ 
   d & e & f \\ 
   g & h & i \\ 
\end{bmatrix} \quad$
 to reference the elements of a magic square, it would be tempting, noticing the locations of the elements of orders $1,2$ and $3$ to hope that elements $\{d,i,b\}$ or elements $\{d,i,c\}$ could be used to generate the other six elements of the magic square. Unfortunately, elements $\{d,i,b\}$ do not since, for all magic squares $b+d = 2i$. But, choosing elements $\{d,i,c\}$, we get
\begin{array}{|c|c|c|}
\hline
   2c-2d+i & -d+2i &        c\\ 
\hline
         d & c-d+i & 2c-3d+2i \\ 
\hline
   c-2d+2i &  2c-d &        i \\ 
\hline
\end{array}
So, to generate positive integer magic squares with distinct elements, choose integer $0 < d < i < c$, with $2i-d > 0$ and use the above formula to fill in the rest.
</s>