# What am I doing wrong in attempting to find the least squares solution of the system Ax = b?

I am attempting to find the least-squares solution x* of the system Ax = b, where $$A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{bmatrix}$$ and $$B = \begin{bmatrix} 1 \\ 0 \\ 0 \\ \end{bmatrix}$$ I'm trying to solve for x* using the formula $$x^* = (A^TA)^{-1} A^Tb$$ I am getting stuck after I calculate $$(A^TA)= \begin{bmatrix} 66 & 78 & 90 \\ 78 & 93 & 108 \\ 90 & 108 & 126 \\ \end{bmatrix}$$ because I am getting an error when I attempt to calculate the inverse of this matrix in my calculator. What am I missing?

The determinant of $A$ is $0$, hence it is not invertible.
The matrix $A^TA$ is not full rank because the matrix $A$ is not full rank. This is why you cannot invert it. Re-express the system using only linearly independent rows. The matrix $A$ is of rank 2. Re-express your system with a $2\times 3$ matrix. With this representation, you can use the least square formula.