QR Factorization Calculator

The calculator will find the QR factorization of the given matrix $A$, i.e. such an orthogonal (or semi-orthogonal) matrix $Q$ and an upper triangular matrix $R$ that $A=QR$, with steps shown.

Related calculator: LU Decomposition Calculator

$\times$

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please write it in the comments below.

Find the QR factorization of $\left[\begin{array}{ccc}1 & 3 & 5\\1 & 3 & 1\\2 & -1 & 7\end{array}\right]$.

Solution

Orthonormalize the set of vectors formed by the columns of the given matrix: $\left\{\left[\begin{array}{c}\frac{\sqrt{6}}{6}\\\frac{\sqrt{6}}{6}\\\frac{\sqrt{6}}{3}\end{array}\right], \left[\begin{array}{c}\frac{\sqrt{3}}{3}\\\frac{\sqrt{3}}{3}\\- \frac{\sqrt{3}}{3}\end{array}\right], \left[\begin{array}{c}\frac{\sqrt{2}}{2}\\- \frac{\sqrt{2}}{2}\\0\end{array}\right]\right\}$ (for steps, see Gram-Schmidt calculator).

The columns of the matrix $Q$ are the orthonormalized vectors: $Q = \left[\begin{array}{ccc}\frac{\sqrt{6}}{6} & \frac{\sqrt{3}}{3} & \frac{\sqrt{2}}{2}\\\frac{\sqrt{6}}{6} & \frac{\sqrt{3}}{3} & - \frac{\sqrt{2}}{2}\\\frac{\sqrt{6}}{3} & - \frac{\sqrt{3}}{3} & 0\end{array}\right].$

Find the transpose of the matrix: $Q^{T} = \left[\begin{array}{ccc}\frac{\sqrt{6}}{6} & \frac{\sqrt{6}}{6} & \frac{\sqrt{6}}{3}\\\frac{\sqrt{3}}{3} & \frac{\sqrt{3}}{3} & - \frac{\sqrt{3}}{3}\\\frac{\sqrt{2}}{2} & - \frac{\sqrt{2}}{2} & 0\end{array}\right]$ (for steps, see matrix transpose calculator).

Finally, $R = \left[\begin{array}{ccc}\frac{\sqrt{6}}{6} & \frac{\sqrt{6}}{6} & \frac{\sqrt{6}}{3}\\\frac{\sqrt{3}}{3} & \frac{\sqrt{3}}{3} & - \frac{\sqrt{3}}{3}\\\frac{\sqrt{2}}{2} & - \frac{\sqrt{2}}{2} & 0\end{array}\right]\left[\begin{array}{ccc}1 & 3 & 5\\1 & 3 & 1\\2 & -1 & 7\end{array}\right] = \left[\begin{array}{ccc}\sqrt{6} & \frac{2 \sqrt{6}}{3} & \frac{10 \sqrt{6}}{3}\\0 & \frac{7 \sqrt{3}}{3} & - \frac{\sqrt{3}}{3}\\0 & 0 & 2 \sqrt{2}\end{array}\right]$ (for steps, see matrix multiplication calculator).

$Q = \left[\begin{array}{ccc}\frac{\sqrt{6}}{6} & \frac{\sqrt{3}}{3} & \frac{\sqrt{2}}{2}\\\frac{\sqrt{6}}{6} & \frac{\sqrt{3}}{3} & - \frac{\sqrt{2}}{2}\\\frac{\sqrt{6}}{3} & - \frac{\sqrt{3}}{3} & 0\end{array}\right]\approx \left[\begin{array}{ccc}0.408248290463863 & 0.577350269189626 & 0.707106781186548\\0.408248290463863 & 0.577350269189626 & -0.707106781186548\\0.816496580927726 & -0.577350269189626 & 0\end{array}\right]$A
$R = \left[\begin{array}{ccc}\sqrt{6} & \frac{2 \sqrt{6}}{3} & \frac{10 \sqrt{6}}{3}\\0 & \frac{7 \sqrt{3}}{3} & - \frac{\sqrt{3}}{3}\\0 & 0 & 2 \sqrt{2}\end{array}\right]\approx \left[\begin{array}{ccc}2.449489742783178 & 1.632993161855452 & 8.16496580927726\\0 & 4.04145188432738 & -0.577350269189626\\0 & 0 & 2.82842712474619\end{array}\right]$A