We know that each least square solution of \(x=b\) satisfies the equation \(\displaystyle{A}^{{T}}{A}{x}={A}^{{T}}{b}\). Therefore first of all find \(\displaystyle{A}^{{T}}{A},{A}^{{T}}{b}\)

\[A^TA=\begin{bmatrix}2 & -2&2 \\1 &0&3 \end{bmatrix}\begin{bmatrix}2 & 1 \\-2 & 0\\2&3 \end{bmatrix}=\begin{bmatrix}12 & 8 \\8 &10 \end{bmatrix}\]

\[A^Tb=\begin{bmatrix}2 & -2&2 \\1 &0&3 \end{bmatrix}\begin{bmatrix}-5&8&1 \end{bmatrix}=\begin{bmatrix}-24\\-2\end{bmatrix}\]

The equation \(\displaystyle{A}^{{T}}{A}{x}={A}^{{T}}{b}\) becomes.

\[\begin{bmatrix}12& 8 \\8& 10 \end{bmatrix}\begin{bmatrix}x_1 \\x_2\end{bmatrix}=\begin{bmatrix}-24\\-2 \end{bmatrix}\]

The augmented matrix for \(\displaystyle{A}^{{T}}{A}{x}={A}^{{T}}{b}\) to solve this sytem

\[\begin{bmatrix}12&8&-24\\8&10&-2\end{bmatrix}\]

Use row operation to solve this system

\[\begin{bmatrix}12&8&-24\\8&10&-2\end{bmatrix}\sim\begin{bmatrix}1&0&-4\\0& 1&3 \end{bmatrix}\]

The solution of the augmented matrix.

\(\displaystyle{x}_{{1}}=-{4},\ {x}_{{2}}={3}\)

The general least square solution for Ax=b

\[\hat{x}=\begin{bmatrix}-4\\3 \end{bmatrix}\]