# Special method of solution for $A\vec x=\vec b$ where $A$ is a square matrix such that $A^tA$ is diagonal and has full rank?

Is there any special shorter method of solution other than cramer's rule for solving a system of $n$ linear equations in $n$ unknowns $A\vec x=\vec b$ where the square matrix $A$ has the property that $A^tA$ is diagonal and has full-rank i.e. all the diagonal entries of $A^tA$ are non-zero ? ( The solution set is obviously unique , since $rank(A)=rank(A^tA)=n$ ) . Thanks in advance .

Sure. We have $A^tA=D$ where $D^{-1}$ is straightforward, so $Ax=b$ implies $A^tAx=A^tb$ and $x=D^{-1}A^tb$ right away.
• Nice one , but can we do it without even doing $A^t$ ? – user228168 May 18 '15 at 4:38
Cramer's rule is not preferred for the high computational cost, involving $n+1$ determinants of $n \times n$ matrix to calculate.
If, in particular, the system is a square one, you can also perform the $LU$ factorization to obtain $PA = LU$ and use the so-called backward-and-forward substitution.
Moreover, if $D = A^tA$ is diagonal and full rank, we can solve directly $Dx = A^tb$ to obtain $x = D^{-1}(A^tb)$, where $D^{-1}c$ can easily be computed as $$D^{-1}c = (\frac{c_1}{d_1}, \frac{c_2}{d_2}, \ldots, \frac{c_n}{d_n})^t$$