Cramer's rule

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In linear algebra, Cramer's rule is an explicit formula for the solution of a system of linear equations with as many equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the vector of right hand sides of the equations. It is named after Gabriel Cramer (1704–1752), who published the rule for an arbitrary number of unknowns in 1750,[1] although Colin Maclaurin also published special cases of the rule in 1748[2] (and possibly knew of it as early as 1729).[3][4][5]

General case[edit]

Consider a system of n linear equations for n unknowns, represented in matrix multiplication form as follows:

 Ax = b\,
(1)\,

where the n by n matrix  A has a nonzero determinant, and the vector  x = (x_1, \ldots, x_n)^\mathrm{T} is the column vector of the variables.

Then the theorem states that in this case the system has a unique solution, whose individual values for the unknowns are given by:

 x_i = \frac{\det(A_i)}{\det(A)} \qquad i = 1, \ldots, n \,

where  A_i is the matrix formed by replacing the ith column of  A by the column vector  b .

The rule holds for systems of equations with coefficients and unknowns in any field, not just in the real numbers. It has recently been shown that Cramer's rule can be implemented in O(n3) time,[6] which is comparable to more common methods of solving systems of linear equations, such as Gaussian elimination (consistently requiring 2.5 times as many arithmetic operations for all matrix sizes, while exhibiting comparable numeric stability in most cases).

Proof[edit]

The proof for Cramer's rule uses just two properties of determinants: linearity with respect to any given column (taking for that column a linear combination of column vectors produces as determinant the corresponding linear combination of their determinants), and the fact that the determinant is zero whenever two columns are equal (which is implied by the basic property that the determinant is alternating in the columns).

Fix the index j of a column. Linearity means that if we consider only column j as variable (fixing the others arbitrarily), the resulting function RnR (assuming matrix entries are in R) can be given by a matrix, with one row and n columns, that acts on column j. In fact this is precisely what Laplace expansion does, writing det(A) = C1a1,j + … + Cnan,j for certain coefficients C1,…,Cn that depend on the columns of A other than column j (the precise expression for these cofactors is not important here). The value det(A) is then the result of applying the one-line matrix L(j) = (C1 C2 … Cn) to column j of A. If L(j) is applied to any other column k of A, then the result is the determinant of the matrix obtained from A by replacing column j by a copy of column k, so the resulting determinant is 0 (the case of two equal columns).

Now consider a system of n linear equations in n unknowns x_1, x_2,\ldots,x_n, whose coefficient matrix is A, with det(A) assumed to be nonzero:

\begin{matrix}a_{11}x_1+a_{12}x_2+\cdots+a_{1n}x_n&=&b_1\\a_{21}x_1+a_{22}x_2+\cdots+a_{2n}x_n&=&b_2\\\vdots&\vdots&\vdots\\a_{n1}x_1+a_{n2}x_2+\cdots+a_{nn}x_n&=&b_n.\end{matrix}

If one combines these equations by taking C1 times the first equation, plus C2 times the second, and so forth until Cn times the last, then the coefficient of xj will become C1a1,j + … + Cnan,j = det(A), while the coefficients of all other unknowns become 0; the left hand side becomes simply det(A)xj. The right hand side is C1b1 + … + Cnbn, which is L(j) applied to the column vector b of the right hand sides bi. In fact what has been done here is multiply the matrix equation Ax = b on the left by L(j). Dividing by the nonzero number det(A) one finds the following equation, necessary to satisfy the system:

x_j=\frac{L_{(j)}\cdot\mathbf{b}}{\det(A)}.

But by construction the numerator is the determinant of the matrix obtained from A by replacing column j by b, so we get the expression of Cramer's rule as a necessary condition for a solution. The same procedure can be repeated for other values of j to find values for the other unknowns.

The only point that remains to prove is that these values for the unknowns, the only possible ones, do indeed together form a solution. But if the matrix A is invertible with inverse A−1, then x = A−1b will be a solution, thus showing its existence. To see that A is invertible when det(A) is nonzero, consider the n by n matrix M obtained by stacking the one-line matrices L(j) on top of each other for j = 1, 2, …, n (this gives the adjugate matrix for A). It was shown that L(j)A = (0 … 0 det(A) 0 … 0) where det(A) appears at the position j; from this it follows that MA = det(A)In. Therefore

\frac1{\det(A)}M=A^{-1},

completing the proof.

Finding inverse matrix[edit]

Let A be an n×n matrix. Then

\mathrm{Adj}(A)A = \mathrm{det}(A)I\,

where Adj(A) denotes the adjugate matrix of A, det(A) is the determinant, and I is the identity matrix. If det(A) is invertible in R, then the inverse matrix of A is

A^{-1} = \frac{1}{\operatorname{det}(A)} \operatorname{Adj}(A).

If R is a field (such as the field of real numbers), then this gives a formula for the inverse of A, provided det(A) ≠ 0. In fact, this formula will work whenever R is a commutative ring, provided that det(A) is a unit. If det(A) is not a unit, then A is not invertible.

Applications[edit]

Explicit formulas for small systems[edit]

Consider the linear system \left\{\begin{matrix}ax+by&={\color{red}e}\\ cx + dy&= {\color{red}f}\end{matrix}\right.\ which in matrix format is \begin{bmatrix} a & b \\ c & d \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix}=\begin{bmatrix} {\color{red}e} \\ {\color{red}f} \end{bmatrix}.

Assume ad − bc nonzero. Then, x and y can be found with Cramer's rule as

x = \begin{vmatrix} {\color{red}{e}} & b \\ {\color{red}{f}} & d \end{vmatrix}/\begin{vmatrix} a & b \\ c & d \end{vmatrix}  = { {\color{red}e}d - b{\color{red}f} \over ad - bc}

and

y = \begin{vmatrix} a & {\color{red}{e}} \\ c & {\color{red}{f}} \end{vmatrix}/\begin{vmatrix} a & b \\ c & d \end{vmatrix}  = { a{\color{red}f} - {\color{red}e}c \over ad - bc}.

The rules for 3×3 are similar. Given \left\{\begin{matrix}ax + by + cz&= {\color{red}j}\\dx + ey + fz&= {\color{red}k}\\gx + hy + iz&= {\color{red}l}\end{matrix}\right. which in matrix format is \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix}\begin{bmatrix} x \\ y \\ z \end{bmatrix}=\begin{bmatrix} {\color{red}j} \\ {\color{red}k} \\ {\color{red}l} \end{bmatrix}.

Then the values of x, y and z can be found as follows:

x = \frac { \begin{vmatrix} {\color{red}j} & b & c \\ {\color{red}k} & e & f \\ {\color{red}l} & h & i \end{vmatrix} } { \begin{vmatrix} a & b & c \\ d & e & f \\ g & h & i \end{vmatrix} }, \quad y = \frac { \begin{vmatrix} a & {\color{red}j} & c \\ d & {\color{red}k} & f \\ g & {\color{red}l} & i \end{vmatrix} } { \begin{vmatrix} a & b & c \\ d & e & f \\ g & h & i \end{vmatrix} },\text{ and }z = \frac { \begin{vmatrix} a & b & {\color{red}j} \\ d & e & {\color{red}k} \\ g & h & {\color{red}l} \end{vmatrix} } { \begin{vmatrix} a & b & c \\ d & e & f \\ g & h & i \end{vmatrix} }.

Differential geometry[edit]

Cramer's rule is also extremely useful for solving problems in differential geometry. Consider the two equations F(x, y, u, v) = 0\, and G(x, y, u, v) = 0\,. When u and v are independent variables, we can define x = X(u, v)\, and y = Y(u, v).\,

Finding an equation for \dfrac{\partial x}{\partial u} is a trivial application of Cramer's rule.

First, calculate the first derivatives of F, G, x, and y:


\begin{align}
dF & = \frac{\partial F}{\partial x} \, dx + \frac{\partial F}{\partial y} \, dy +\frac{\partial F}{\partial u} \, du +\frac{\partial F}{\partial v} \, dv = 0 \\[6pt]
dG & = \frac{\partial G}{\partial x} \, dx + \frac{\partial G}{\partial y} \, dy +\frac{\partial G}{\partial u} \, du +\frac{\partial G}{\partial v} \, dv = 0 \\[6pt]
dx & = \frac{\partial X}{\partial u} \, du + \frac{\partial X}{\partial v} \, dv \\[6pt]
dy & = \frac{\partial Y}{\partial u} \, du + \frac{\partial Y}{\partial v} \, dv.
\end{align}

Substituting dx, dy into dF and dG, we have:


\begin{align}
dF & = \left(\frac{\partial F}{\partial x} \frac{\partial x}{\partial u} +\frac{\partial F}{\partial y} \frac{\partial y}{\partial u} +\frac{\partial F}{\partial u} \right) \, du + \left(\frac{\partial F}{\partial x} \frac{\partial x}{\partial v} +\frac{\partial F}{\partial y} \frac{\partial y}{\partial v} +\frac{\partial F}{\partial v} \right) \, dv = 0 \\[6pt]
dG & = \left(\frac{\partial G}{\partial x} \frac{\partial x}{\partial u} +\frac{\partial G}{\partial y} \frac{\partial y}{\partial u} +\frac{\partial G}{\partial u} \right) \, du + \left(\frac{\partial G}{\partial x} \frac{\partial x}{\partial v} +\frac{\partial G}{\partial y} \frac{\partial y}{\partial v} +\frac{\partial G}{\partial v} \right) \, dv = 0.
\end{align}

Since u, v are both independent, the coefficients of du, dv must be zero. So we can write out equations for the coefficients:


\begin{align}
\frac{\partial F}{\partial x} \frac{\partial x}{\partial u} +\frac{\partial F}{\partial y} \frac{\partial y}{\partial u} & = -\frac{\partial F}{\partial u} \\[6pt]
\frac{\partial G}{\partial x} \frac{\partial x}{\partial u} +\frac{\partial G}{\partial y} \frac{\partial y}{\partial u} & = -\frac{\partial G}{\partial u} \\[6pt]
\frac{\partial F}{\partial x} \frac{\partial x}{\partial v} +\frac{\partial F}{\partial y} \frac{\partial y}{\partial v} & = -\frac{\partial F}{\partial v} \\[6pt]
\frac{\partial G}{\partial x} \frac{\partial x}{\partial v} +\frac{\partial G}{\partial y} \frac{\partial y}{\partial v} & = -\frac{\partial G}{\partial v}.
\end{align}

Now, by Cramer's rule, we see that:


\frac{\partial x}{\partial u} = \frac{\begin{vmatrix} -\frac{\partial F}{\partial u} & \frac{\partial F}{\partial y} \\ -\frac{\partial G}{\partial u} & \frac{\partial G}{\partial y}\end{vmatrix}}{\begin{vmatrix}\frac{\partial F}{\partial x} & \frac{\partial F}{\partial y} \\ \frac{\partial G}{\partial x} & \frac{\partial G}{\partial y}\end{vmatrix}}.

This is now a formula in terms of two Jacobians:

\frac{\partial x}{\partial u} = - \frac{\left(\frac{\partial\left(F, G\right)}{\partial\left(u, y\right)}\right)}{\left(\frac{\partial\left(F, G\right)}{\partial\left(x, y\right)}\right)}.

Similar formulae can be derived for \frac{\partial x}{\partial v}, \frac{\partial y}{\partial u}, \frac{\partial y}{\partial v}.

Integer programming[edit]

Cramer's rule can be used to prove that an integer programming problem whose constraint matrix is totally unimodular and whose right-hand side is integer, has integer basic solutions. This makes the integer program substantially easier to solve.

Ordinary differential equations[edit]

Cramer's rule is used to derive the general solution to an inhomogeneous linear differential equation by the method of variation of parameters.

Geometric interpretation[edit]

Geometric interpretation of Cramer's rule. The areas of the second and third shaded parallelograms are the same and the second is x_1 times the first. From this equality Cramer's rule follows.

Cramer's rule has a geometric interpretation that can be considered also a proof or simply giving insight about its geometric nature. These geometric arguments work in general and not only in the case of two equations with two unknowns presented here.

Given the system of equations

\begin{matrix}a_{11}x_1+a_{12}x_2&=b_1\\a_{21}x_1+a_{22}x_2&=b_2\end{matrix}

it can be considered as an equation between vectors

x_1\binom{a_{11}}{a_{21}}+x_2\binom{a_{12}}{a_{22}}=\binom{b_1}{b_2}.

The area of the parallelogram determined by \binom{a_{11}}{a_{21}} and \binom{a_{12}}{a_{22}} is given by the determinant of the system of equations:

\left|\begin{matrix}a_{11}&a_{12}\\a_{21}&a_{22}\end{matrix}\right|.

In general, when there are more variables and equations, the determinant of n vectors of length n will give the volume of the parallelepiped determined by those vectors in the n-th dimensional Euclidean space.

Therefore the area of the parallelogram determined by x_1\binom{a_{11}}{a_{21}} and \binom{a_{12}}{a_{22}} has to be x_1 times the area of the first one since one of the sides has been multiplied by this factor. Now, this last parallelogram, by Cavalieri's principle, has the same area as the parallelogram determined by \binom{b_1}{b_2}=x_1\binom{a_{11}}{a_{21}}+x_2\binom{a_{12}}{a_{22}} and \binom{a_{12}}{a_{22}}.

Equating the areas of this last and the second parallelogram gives the equation

\left|\begin{matrix}b_1&a_{12}\\b_2&a_{22}\end{matrix}\right|=\left|\begin{matrix}a_{11}x_1&a_{12}\\a_{21}x_1&a_{22}\end{matrix}\right|=x_1\left|\begin{matrix}a_{11}&a_{12}\\a_{21}&a_{22}\end{matrix}\right|

from which Cramer's rule follows.

A short proof[edit]

A short proof of Cramer's rule [7] can be given by noticing that x_1 is the determinant of the matrix

X_1=\begin{bmatrix}
x_1 & 0 & 0 & \dots & 0\\
x_2 & 1 & 0 & \dots & 0\\
x_3 & 0 & 1 & \dots & 0\\
\vdots & \vdots & \vdots & \ddots &\vdots \\
x_n & 0 & 0 & \dots & 1
\end{bmatrix}

On the other hand, assuming that our original matrix A is invertible, this matrix X_1 has columns A^{-1}  b , A^{-1}  v_2 , \ldots, A^{-1}  v_n , where v_k is the k th column of the matrix A. Recall that the matrix A_1 has columns   b ,  v_2, \ldots,   v_n . Hence we have  x_1= \det (X_1) = \det (A^{-1}) \det (A_1)= \frac{\det (A_1)}{\det (A)}, as wanted. The proof for other x_j is similar.

Proof using Clifford algebra[edit]

Consider the system of three scalar equations in three unknown scalars x_{1} ,x_{2} ,x_{3}

\begin{array}{rcl}
  a_{11} x_{1} +a_{12} x_{2} +a_{13} x_{3} & = & c_{1}\\
  a_{21} x_{1} +a_{22} x_{2} +a_{23} x_{3} & = & c_{2}\\
  a_{31} x_{1} +a_{32} x_{2} +a_{33} x_{3} & = & c_{3}\end{array}

and assign an orthonormal vector basis \mathbf{e}_{1} ,\mathbf{e}_{2} ,\mathbf{e}_{3} for \mathcal{G}_{3}  as

\begin{array}{rcl}
  a_{11} \mathbf{e}_{1} x_{1} +a_{12} \mathbf{e}_{1} x_{2} +a_{13}
  \mathbf{e}_{1} x_{3} & = & c_{1} \mathbf{e}_{1}\\
  a_{21} \mathbf{e}_{2} x_{1} +a_{22} \mathbf{e}_{2} x_{2} +a_{23}
  \mathbf{e}_{2} x_{3} & = & c_{2} \mathbf{e}_{2}\\
  a_{31} \mathbf{e}_{3} x_{1} +a_{32} \mathbf{e}_{3} x_{2} +a_{33}
  \mathbf{e}_{3} x_{3} & = & c_{3} \mathbf{e}_{3} .\end{array}

Let the vectors

\begin{array}{rcl}
  \mathbf{a}_{1} & = & a_{11} \mathbf{e}_{1} +a_{21} \mathbf{e}_{2} +a_{31}
  \mathbf{e}_{3}\\
  \mathbf{a}_{2} & = & a_{12} \mathbf{e}_{1} +a_{22} \mathbf{e}_{2} +a_{32}
  \mathbf{e}_{3}\\
  \mathbf{a}_{3} & = & a_{13} \mathbf{e}_{1} +a_{23} \mathbf{e}_{2} +a_{33}
  \mathbf{e}_{3} .\end{array}

Adding the system of equations, it is seen that

\begin{array}{rcl}
  \mathbf{c} & = & c_{1} \mathbf{e}_{1} +c_{2} \mathbf{e}_{2} +c_{3}
  \mathbf{e}_{3}\\
  & = & x_{1} \mathbf{a}_{1} +x_{2} \mathbf{a}_{2} +x_{3} \mathbf{a}_{3} .\end{array}

Using outer products, each unknown scalar x_{k} can be solved as

\begin{array}{rcl}
  \mathbf{c} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3} & = & x_{1}
  \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3}\\
  \mathbf{c} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{3} & = & x_{2}
  \mathbf{a}_{2} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{3}\\
  \mathbf{c} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{2} & = & x_{3}
  \mathbf{a}_{3} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{2}\\
  x_{1} & = & \frac{\mathbf{c} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3}}{\mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3}}\\
  x_{2} & = & \frac{\mathbf{c} \wedge \mathbf{a}_{1} \wedge
  \mathbf{a}_{3}}{\mathbf{a}_{2} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{3}}
  = \frac{\mathbf{a}_{1} \wedge \mathbf{c} \wedge
  \mathbf{a}_{3}}{\mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3}}\\
  x_{3} & = & \frac{\mathbf{c} \wedge \mathbf{a}_{1} \wedge
  \mathbf{a}_{2}}{\mathbf{a}_{3} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{2}}
  = \frac{\mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{c}}{\mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3}} .\end{array}

For n equations in n unknowns, the solution for the kth unknown x_{k} generalizes to

\begin{array}{rcl}
  x_{k} & = & \frac{\mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{c} )_{k}
  \wedge \cdots \wedge \mathbf{a}_{n}}{\mathbf{a}_{1} \wedge \cdots \wedge
  \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n}}\\
  & = & ( \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{c} )_{k} \wedge
  \cdots \wedge \mathbf{a}_{n} ) ( \mathbf{a}_{1} \wedge \cdots \wedge
  \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n} )^{-1}\\
  & = & \frac{( \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{c} )_{k} \wedge
  \cdots \wedge \mathbf{a}_{n} ) ( \mathbf{a}_{1} \wedge \cdots \wedge
  \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n} )}{( \mathbf{a}_{1}
  \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n} ) (
  \mathbf{a}_{1} \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge
  \mathbf{a}_{n} )}\\
  & = & \frac{( \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{c} )_{k} \wedge
  \cdots \wedge \mathbf{a}_{n} ) \cdot ( \mathbf{a}_{1} \wedge \cdots \wedge
  \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n} )}{( -1 )^{n ( n-1 ) /2}
  ( \mathbf{a}_{n} \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge
  \mathbf{a}_{1} ) \cdot ( \mathbf{a}_{1} \wedge \cdots \wedge \mathbf{a}_{k}
  \wedge \cdots \wedge \mathbf{a}_{n} )}\\
  & = & \frac{( \mathbf{a}_{n} \wedge \cdots \wedge ( \mathbf{c} )_{k} \wedge
  \cdots \wedge \mathbf{a}_{1} ) \cdot ( \mathbf{a}_{1} \wedge \cdots \wedge
  \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n} )}{( \mathbf{a}_{n}
  \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{1} )
  \cdot ( \mathbf{a}_{1} \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots
  \wedge \mathbf{a}_{n} )} .\end{array}

If the \mathbf{a}_{k} are linearly independent, then the x_{k} can be expressed in determinant form identical to Cramer’s Rule as

\begin{array}{rcl}
  x_{k} & = & \frac{( \mathbf{a}_{n} \wedge \cdots \wedge ( \mathbf{c} )_{k}
  \wedge \cdots \wedge \mathbf{a}_{1} ) \cdot ( \mathbf{a}_{1} \wedge \cdots
  \wedge \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n} )}{(
  \mathbf{a}_{n} \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge
  \mathbf{a}_{1} ) \cdot ( \mathbf{a}_{1} \wedge \cdots \wedge \mathbf{a}_{k}
  \wedge \cdots \wedge \mathbf{a}_{n} )}\\
  & = & \frac{\left|\begin{array}{ccccc}
    \mathbf{a}_{1} \cdot \mathbf{a}_{1} & \cdots & \mathbf{a}_{1} \cdot (
    \mathbf{c} )_{k} & \cdots & \mathbf{a}_{1} \cdot \mathbf{a}_{n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    \mathbf{a}_{k} \cdot \mathbf{a}_{1} & \cdots & \mathbf{a}_{k} \cdot (
    \mathbf{c} )_{k} & \cdots & \mathbf{a}_{k} \cdot \mathbf{a}_{n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    \mathbf{a}_{n} \cdot \mathbf{a}_{1} & \cdots & \mathbf{a}_{n} \cdot (
    \mathbf{c} )_{k} & \cdots & \mathbf{a}_{n} \cdot \mathbf{a}_{n}
  \end{array}\right|}{\left|\begin{array}{ccccc}
    \mathbf{a}_{1} \cdot \mathbf{a}_{1} & \cdots & \mathbf{a}_{1} \cdot
    \mathbf{a}_{k} & \cdots & \mathbf{a}_{1} \cdot \mathbf{a}_{n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    \mathbf{a}_{k} \cdot \mathbf{a}_{1} & \cdots & \mathbf{a}_{k} \cdot
    \mathbf{a}_{k} & \cdots & \mathbf{a}_{k} \cdot \mathbf{a}_{n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    \mathbf{a}_{n} \cdot \mathbf{a}_{1} & \cdots & \mathbf{a}_{n} \cdot
    \mathbf{a}_{k} & \cdots & \mathbf{a}_{n} \cdot \mathbf{a}_{n}
  \end{array}\right|} = \frac{\left|\begin{array}{c}
    \mathbf{a}_{1}\\
    \vdots\\
    \mathbf{a}_{k}\\
    \vdots\\
    \mathbf{a}_{n}
  \end{array}\right| \left|\begin{array}{ccccc}
    \mathbf{a}_{1} & \cdots & ( \mathbf{c} )_{k} & \cdots & \mathbf{a}_{n}
  \end{array}\right|}{\left|\begin{array}{c}
    \mathbf{a}_{1}\\
    \vdots\\
    \mathbf{a}_{k}\\
    \vdots\\
    \mathbf{a}_{n}
  \end{array}\right| \left|\begin{array}{ccccc}
    \mathbf{a}_{1} & \cdots & \mathbf{a}_{k} & \cdots & \mathbf{a}_{n}
  \end{array}\right|}\\
  & = & \frac{\left|\begin{array}{ccccc}
    \mathbf{a}_{1} & \cdots & ( \mathbf{c} )_{k} & \cdots & \mathbf{a}_{n}
  \end{array}\right|}{\left|\begin{array}{ccccc}
    \mathbf{a}_{1} & \cdots & \mathbf{a}_{k} & \cdots & \mathbf{a}_{n}
  \end{array}\right|} = \frac{\left|\begin{array}{ccccc}
    a_{11} & \ldots & c_{1} & \cdots & a_{1n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    a_{k1} & \cdots & c_{k} & \cdots & a_{k n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    a_{n1} & \cdots & c_{n} & \cdots & a_{n n}
  \end{array}\right|}{\left|\begin{array}{ccccc}
    a_{11} & \ldots & a_{1k} & \cdots & a_{1n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    a_{k1} & \cdots & a_{k k} & \cdots & a_{k n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    a_{n1} & \cdots & a_{n k} & \cdots & a_{n n}
  \end{array}\right|}\end{array}

where ( \mathbf{c} )_{k} denotes the substitution of vector \mathbf{a}_{k} with vector \mathbf{c} in the kth numerator position.

Systems of vector equations: Cramer’s Rule extended.[edit]

Consider the system of n vector equations in n unknown vectors \mathbf{x}_{1} ,\mathbf{x}_{2} ,\mathbf{x}_{3} , \ldots ,\mathbf{x}_{k} , \ldots ,\mathbf{x}_{n}

\begin{array}{rcl}
  a_{11} \mathbf{x}_{1} +a_{12} \mathbf{x}_{2} +a_{13} \mathbf{x}_{3} + \cdots
  +a_{1k} \mathbf{x}_{k} + \cdots +a_{1n} \mathbf{x}_{n} & = &
  \mathbf{c}_{1}\\
  a_{21} \mathbf{x}_{1} +a_{22} \mathbf{x}_{2} +a_{23} \mathbf{x}_{3} + \cdots
  +a_{2k} \mathbf{x}_{k} + \cdots +a_{2n} \mathbf{x}_{n} & = &
  \mathbf{c}_{2}\\
  a_{31} \mathbf{x}_{1} +a_{32} \mathbf{x}_{2} +a_{33} \mathbf{x}_{3} + \cdots
  +a_{3k} \mathbf{x}_{k} + \cdots +a_{3n} \mathbf{x}_{n} & = &
  \mathbf{c}_{3}\\
  & \vdots & \\
  a_{k1} \mathbf{x}_{1} +a_{k2} \mathbf{x}_{2} +a_{k3} \mathbf{x}_{3} + \cdots
  +a_{k k} \mathbf{x}_{k} + \cdots +a_{k n} \mathbf{x}_{n} & = &
  \mathbf{c}_{k}\\
  & \vdots & \\
  a_{n1} \mathbf{x}_{1} +a_{n2} \mathbf{x}_{2} +a_{n3} \mathbf{x}_{3} + \cdots
  +a_{n k} \mathbf{x}_{k} + \cdots +a_{n n} \mathbf{x}_{n} & = &
  \mathbf{c}_{n}\end{array}

where we want to solve for each unknown vector \mathbf{x}_{k} in terms of the given scalar constants a_{r c} and vector constants \mathbf{c}_{k}.

Solving for unknown vectors.[edit]

Using the Clifford geometric algebra of Euclidean vectors, the vectors \mathbf{x}_{k} and \mathbf{c}_{k} are in a vector space having d dimensions spanned by a basis of d orthonormal base vectors \mathbf{e}_{1} ,\mathbf{e}_{2} ,\mathbf{e}_{3} , \ldots ,\mathbf{e}_{d}. This d-dimensional space can be extended to be a subspace of a larger ( d+n )-dimensional space \mathbf{e}_{1} ,\mathbf{e}_{2} ,\mathbf{e}_{3} , \ldots ,\mathbf{e}_{d} , \ldots ,\mathbf{e}_{d+k} , \ldots ,\mathbf{e}_{d+n}.

Multiply the kth equation by the ( d+k )th orthonormal base unit \mathbf{e}_{d+k}, using outer product on the right, as

\begin{array}{rcl}
  ( a_{11} \mathbf{x}_{1} +a_{12} \mathbf{x}_{2} +a_{13} \mathbf{x}_{3} +
  \cdots +a_{1k} \mathbf{x}_{k} + \cdots +a_{1n} \mathbf{x}_{n} ) \wedge
  \mathbf{e}_{d+1} & = & \mathbf{c}_{1} \wedge \mathbf{e}_{d+1}\\
  ( a_{21} \mathbf{x}_{1} +a_{22} \mathbf{x}_{2} +a_{23} \mathbf{x}_{3} +
  \cdots +a_{2k} \mathbf{x}_{k} + \cdots +a_{2n} \mathbf{x}_{n} ) \wedge
  \mathbf{e}_{d+2} & = & \mathbf{c}_{2} \wedge \mathbf{e}_{d+2}\\
  ( a_{31} \mathbf{x}_{1} +a_{32} \mathbf{x}_{2} +a_{33} \mathbf{x}_{3} +
  \cdots +a_{3k} \mathbf{x}_{k} + \cdots +a_{3n} \mathbf{x}_{n} ) \wedge
  \mathbf{e}_{d+3} & = & \mathbf{c}_{3} \wedge \mathbf{e}_{d+3}\\
  & \vdots & \\
  ( a_{k1} \mathbf{x}_{1} +a_{k2} \mathbf{x}_{2} +a_{k3} \mathbf{x}_{3} +
  \cdots +a_{k k} \mathbf{x}_{k} + \cdots +a_{k n} \mathbf{x}_{n} ) \wedge
  \mathbf{e}_{d+k} & = & \mathbf{c}_{k} \wedge \mathbf{e}_{d+k}\\
  & \vdots & \\
  ( a_{n1} \mathbf{x}_{1} +a_{n2} \mathbf{x}_{2} +a_{n3} \mathbf{x}_{3} +
  \cdots +a_{n k} \mathbf{x}_{k} + \cdots +a_{n n} \mathbf{x}_{n} ) \wedge
  \mathbf{e}_{d+n} & = & \mathbf{c}_{n} \wedge \mathbf{e}_{d+n} .\end{array}

The original system of equations in grade-1 vectors is now transformed into a system of equations in grade-2 vectors, and no parallel components have been deleted by the outer products since they multiply on perpendicular extended base units.

Let the vectors

\begin{array}{rcl}
  \mathbf{a}_{1} & = & a_{11} \mathbf{e}_{d+1} +a_{21} \mathbf{e}_{d+2}
  +a_{31} \mathbf{e}_{d+3} + \cdots +a_{k1} \mathbf{e}_{d+k} + \cdots +a_{n1}
  \mathbf{e}_{d+n}\\
  \mathbf{a}_{2} & = & a_{12} \mathbf{e}_{d+1} +a_{22} \mathbf{e}_{d+2}
  +a_{32} \mathbf{e}_{d+3} + \cdots +a_{k2} \mathbf{e}_{d+k} + \cdots +a_{n2}
  \mathbf{e}_{d+n}\\
  \mathbf{a}_{3} & = & a_{13} \mathbf{e}_{d+1} +a_{23} \mathbf{e}_{d+2}
  +a_{33} \mathbf{e}_{d+3} + \cdots +a_{k3} \mathbf{e}_{d+k} + \cdots +a_{n3}
  \mathbf{e}_{d+n}\\
  & \vdots & \\
  \mathbf{a}_{k} & = & a_{1k} \mathbf{e}_{d+1} +a_{2k} \mathbf{e}_{d+2}
  +a_{3k} \mathbf{e}_{d+3} + \cdots +a_{k k} \mathbf{e}_{d+k} + \cdots +a_{n
  k} \mathbf{e}_{d+n}\\
  & \vdots & \\
  \mathbf{a}_{n} & = & a_{1n} \mathbf{e}_{d+1} +a_{2n} \mathbf{e}_{d+2}
  +a_{3n} \mathbf{e}_{d+3} + \cdots +a_{k n} \mathbf{e}_{d+k} + \cdots +a_{n
  n} \mathbf{e}_{d+n} .\end{array}

Adding the transformed system of equations gives

\begin{array}{rcl}
  \mathbf{C} & = & \mathbf{c}_{1} \wedge \mathbf{e}_{d+1} +\mathbf{c}_{2}
  \wedge \mathbf{e}_{d+2} +\mathbf{c}_{3} \wedge \mathbf{e}_{d+3} + \cdots
  +\mathbf{c}_{k} \wedge \mathbf{e}_{d+k} + \cdots +\mathbf{c}_{n} \wedge
  \mathbf{e}_{d+n}\\
  & = & \mathbf{C}_{1} +\mathbf{C}_{2} +\mathbf{C}_{3} + \cdots
  +\mathbf{C}_{k} + \cdots +\mathbf{C}_{n}\\
  & = & \mathbf{x}_{1} \wedge \mathbf{a}_{1} +\mathbf{x}_{2} \wedge
  \mathbf{a}_{2} +\mathbf{x}_{3} \wedge \mathbf{a}_{3} + \cdots
  +\mathbf{x}_{k} \wedge \mathbf{a}_{k} + \cdots +\mathbf{x}_{n} \wedge
  \mathbf{a}_{n}\end{array}

which is a 2-vector equation. These outer (wedge) products are equal to geometric products since the factors are perpendicular.

For n=3, \mathbf{x}_{1}, \mathbf{x}_{2}, and \mathbf{x}_{3} are solved by multiplying \mathbf{a}_{2} \wedge \mathbf{a}_{3}, \mathbf{a}_{1} \wedge \mathbf{a}_{3}, and \mathbf{a}_{1} \wedge \mathbf{a}_{2}, respectively, on the right with outer products

\begin{array}{rcl}
  \mathbf{C} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3} & = & \mathbf{x}_{1}
  \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3}
  =\mathbf{x}_{1} ( \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3}
  )\\
  \mathbf{C} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{3} & = & \mathbf{x}_{2}
  \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{3}
  =\mathbf{x}_{2} ( \mathbf{a}_{2} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{3}
  )\\
  \mathbf{C} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{2} & = & \mathbf{x}_{3}
  \wedge \mathbf{a}_{3} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{2}
  =\mathbf{x}_{2} ( \mathbf{a}_{3} \wedge \mathbf{a}_{1} \wedge \mathbf{a}_{2}
  )\\
  \mathbf{x}_{1} & = & ( \mathbf{C} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3} ) ( \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3} )^{-1}\\
  & = & \frac{( \mathbf{C} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3} )
  \cdot ( ( -1 )^{1-1} \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3} )^{}}{( \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3} )^{2}}\\
  \mathbf{x}_{2} & = & ( \mathbf{C} \wedge \mathbf{a}_{1} \wedge
  \mathbf{a}_{3} ) ( \mathbf{a}_{2} \wedge \mathbf{a}_{1} \wedge
  \mathbf{a}_{3} )^{-1}\\
  & = & \frac{( \mathbf{a}_{1} \wedge \mathbf{C} \wedge \mathbf{a}_{3} )
  \cdot ( ( -1 )^{2-1} \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3} )^{}}{( \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3} )^{2}}\\
  \mathbf{x}_{3} & = & ( \mathbf{C} \wedge \mathbf{a}_{1} \wedge
  \mathbf{a}_{2} ) ( \mathbf{a}_{3} \wedge \mathbf{a}_{1} \wedge
  \mathbf{a}_{2} )^{-1}\\
  & = & \frac{( \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge \mathbf{C} )
  \cdot ( ( -1 )^{3-1} \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3} )^{}}{( \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge
  \mathbf{a}_{3} )^{2} .}\end{array}

In the solution of \mathbf{x}_{1}, and similarly for \mathbf{x}_{2} and \mathbf{x}_{3}, \mathbf{C} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3} is a 4-blade having 3 of its 4 dimensions in the extended dimensions \mathbf{e}_{d+k}, and the remaining one dimension is in the solution space of the vectors \mathbf{x}_{k} and \mathbf{c}_{k}. The 3-blade \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3} is in the problem space, or the extended dimensions. The inner product ( \mathbf{C} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3} ) \cdot ( \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3} ) reduces, or contracts, to a 1-vector in the d-dimensional solution space. The divisor ( \mathbf{a}_{1} \wedge \mathbf{a}_{2} \wedge \mathbf{a}_{3} )^{2}, the square of a blade, is a scalar product that can be computed by a determinant. Since \mathbf{C} is a 2-vector, it commutes \mathbf{C} \wedge \mathbf{a}_{k} =\mathbf{a}_{k} \wedge \mathbf{C} with the vectors \mathbf{a}_{k} without sign change and is conveniently shifted into the vacant kth spot. A sign change ( -1 )^{k-1} occurs in every even( + ) kth solution \mathbf{x}_{+}, such as \mathbf{x}_{2}, due to commuting or shifting \mathbf{a}_{k} right an odd number of times, in the dividend blade \mathbf{a}_{1} \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n}, into its kth spot.

In general, \mathbf{x}_{k} is solved as

\begin{array}{rcl}
  \mathbf{x}_{k} & = & ( \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{C}
  )_{k} \wedge \cdots \wedge \mathbf{a}_{n} ) \cdot ( ( -1 )^{k-1}
  \mathbf{a}_{1} \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge
  \mathbf{a}_{n} )^{-1}\\
  & = & \frac{( \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{C} )_{k} \wedge
  \cdots \wedge \mathbf{a}_{n} ) \cdot ( ( -1 )^{k-1} \mathbf{a}_{1} \wedge
  \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n} )^{}}{(
  \mathbf{a}_{1} \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge
  \mathbf{a}_{n} )^{2}}\\
  & = & \frac{( -1 )^{k-1} ( \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{C}
  )_{k} \wedge \cdots \wedge \mathbf{a}_{n} ) \cdot ( \mathbf{a}_{1} \wedge
  \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n} )^{}}{( -1
  )^{n ( n-1 ) /2} ( \mathbf{a}_{n} \wedge \cdots \wedge \mathbf{a}_{k} \wedge
  \cdots \wedge \mathbf{a}_{1} ) \cdot ( \mathbf{a}_{1} \wedge \cdots \wedge
  \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{n} )}\\
  & = & \frac{( -1 )^{k-1} ( \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{C}
  )_{k} \wedge \cdots \wedge \mathbf{a}_{n} ) \cdot ( \mathbf{a}_{n} \wedge
  \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{1} )^{}}{(
  \mathbf{a}_{n} \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge
  \mathbf{a}_{1} ) \cdot ( \mathbf{a}_{1} \wedge \cdots \wedge \mathbf{a}_{k}
  \wedge \cdots \wedge \mathbf{a}_{n} )}\\
  & = & \frac{( \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{C} )_{k} \wedge
  \cdots \wedge \mathbf{a}_{n} ) \cdot ( \mathbf{a}_{n} \wedge \cdots \wedge
  \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{1} )^{}}{( -1 )^{k-1}
  \left|\begin{array}{ccccc}
    \mathbf{a}_{1} \cdot \mathbf{a}_{1} & \cdots & \mathbf{a}_{1} \cdot
    \mathbf{a}_{k} & \cdots & \mathbf{a}_{1} \cdot \mathbf{a}_{n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    \mathbf{a}_{k} \cdot \mathbf{a}_{1} & \cdots & \mathbf{a}_{k} \cdot
    \mathbf{a}_{k} & \cdots & \mathbf{a}_{k} \cdot \mathbf{a}_{n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    \mathbf{a}_{n} \cdot \mathbf{a}_{1} & \cdots & \mathbf{a}_{n} \cdot
    \mathbf{a}_{k} & \cdots & \mathbf{a}_{n} \cdot \mathbf{a}_{n}
  \end{array}\right|}\\
  & = & \frac{( \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{C} )_{k} \wedge
  \cdots \wedge \mathbf{a}_{n} ) \cdot ( \mathbf{a}_{n} \wedge \cdots \wedge
  \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{1} )^{}}{( -1 )^{k-1}
  \left|\begin{array}{ccccc}
    \mathbf{a}_{1} & \cdots & \mathbf{a}_{k} & \cdots & \mathbf{a}_{n}
  \end{array}\right|^{2}}\end{array}

where ( \mathbf{C} )_{k} denotes replacing the kth element \mathbf{a}_{k} with \mathbf{C}. The factor ( -1 )^{k-1} accounts for shifting the kth vector \mathbf{a}_{k} by k-1 places. The ( n+1 )-blade \mathbf{a}_{1} \wedge \cdots \wedge ( \mathbf{C} )_{k} \wedge \cdots \wedge \mathbf{a}_{n} is multiplied by inner product with the reversed n-blade \mathbf{a}_{n} \wedge \cdots \wedge \mathbf{a}_{k} \wedge \cdots \wedge \mathbf{a}_{1}, producing a 1-vector in the d-dimensional solution space.

Using this formula, for solving a system of n vector equations having n unknown vectors \mathbf{x}_{1} , \ldots ,\mathbf{x}_{k} , \ldots ,\mathbf{x}_{n} in a d-dimensional space, requires extending the space to ( d+n ) dimensions. The extended n dimensions are essentially used to hold the system of n equations represented by the scalar constants 1-vectors \mathbf{a}_{k} and the vector constants 1-vectors \mathbf{c}_{k}. The n vector constants \mathbf{c}_{k} are grade-increased to 2-vectors or grade-2 vectors \mathbf{c}_{k} \wedge \mathbf{e}_{d+k} =\mathbf{C}_{k} that are partly in the extended space. Notice the similarity of form to Cramer’s Rule for systems of scalar equations; a basis is added in both cases. The advantage of this formula is that it avoids scalar coordinates and the results are directly in terms of vectors.

The system of vector equations can also be solved in terms of coordinates, without using the geometric algebra formula above, by the usual process of expanding all the vectors in the system into their coordinate vector components. In each expanded equation, the parallel (like) components are summed into d groups that form d independent systems of n unknown coordinates in n equations. Each system solves for one dimension of coordinates. After solving the d systems, the solved vectors can be reassembled from the solved coordinates. It seems that few books explicitly discuss this process for systems of vector equations. This process is the application of the abstract concept of linear independence as it applies to linearly independent dimensions of vector components or unit vectors. The linear independence concept extends to multivectors in geometric algebra, where each unique unit blade is linearly independent of the others for the purpose of solving equations or systems of equations. An equation containing a sum of d linearly independent terms can be rewritten as d separate independent equations, each in the terms of one dimension.

Solving for unknown scalars.[edit]

It is also noticed that, instead of solving for unknown vectors \mathbf{x}_{k}, the \mathbf{x}_{k} may be known vectors and the vectors \mathbf{a}_{k} may be unknown. The vectors \mathbf{a}_{1}, \mathbf{a}_{2}, and \mathbf{a}_{3} could be solved as

\begin{array}{rcl}
  -\mathbf{C} \wedge \mathbf{x}_{2} \wedge \mathbf{x}_{3} & = & \mathbf{a}_{1}
  \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge \mathbf{x}_{3}
  =\mathbf{a}_{1} ( \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge \mathbf{x}_{3}
  )\\
  -\mathbf{C} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{3} & = & \mathbf{a}_{2}
  \wedge \mathbf{x}_{2} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{3}
  =\mathbf{a}_{2} ( \mathbf{x}_{2} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{3}
  )\\
  -\mathbf{C} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{2} & = & \mathbf{a}_{3}
  \wedge \mathbf{x}_{3} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{2}
  =\mathbf{a}_{3} ( \mathbf{x}_{3} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{2}
  )\\
  \mathbf{a}_{1} & = & ( -\mathbf{C} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3} ) ( \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3} )^{-1}\\
  & = & \frac{( -\mathbf{C} \wedge \mathbf{x}_{2} \wedge \mathbf{x}_{3} )
  \cdot ( ( -1 )^{1-1} \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3} )^{}}{( \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3} )^{2}}\\
  \mathbf{a}_{2} & = & ( -\mathbf{C} \wedge \mathbf{x}_{1} \wedge
  \mathbf{x}_{3} ) ( \mathbf{x}_{2} \wedge \mathbf{x}_{1} \wedge
  \mathbf{x}_{3} )^{-1}\\
  & = & \frac{( -\mathbf{x}_{1} \wedge \mathbf{C} \wedge \mathbf{x}_{3} )
  \cdot ( ( -1 )^{2-1} \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3} )^{}}{( \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3} )^{2}}\\
  \mathbf{a}_{3} & = & ( -\mathbf{C} \wedge \mathbf{x}_{1} \wedge
  \mathbf{x}_{2} ) ( \mathbf{x}_{3} \wedge \mathbf{x}_{1} \wedge
  \mathbf{x}_{2} )^{-1}\\
  & = & \frac{( -\mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge \mathbf{C} )
  \cdot ( ( -1 )^{3-1} \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3} )^{}}{( \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3} )^{2} .}\end{array}

In general, vector \mathbf{a}_{k} may be solved as

\begin{array}{rcl}
  \mathbf{a}_{k} & = & ( -\mathbf{x}_{1} \wedge \cdots \wedge ( \mathbf{C}
  )_{k} \wedge \cdots \wedge \mathbf{x}_{n} ) \cdot ( ( -1 )^{k-1}
  \mathbf{x}_{1} \wedge \cdots \wedge \mathbf{x}_{k} \wedge \cdots \wedge
  \mathbf{x}_{n} )^{-1}\\
  & = & \frac{( -\mathbf{x}_{1} \wedge \cdots \wedge ( \mathbf{C} )_{k}
  \wedge \cdots \wedge \mathbf{x}_{n} ) \cdot ( ( -1 )^{k-1} \mathbf{x}_{1}
  \wedge \cdots \wedge \mathbf{x}_{k} \wedge \cdots \wedge \mathbf{x}_{n}
  )^{}}{( \mathbf{x}_{1} \wedge \cdots \wedge \mathbf{x}_{k} \wedge \cdots
  \wedge \mathbf{x}_{n} )^{2}}\\
  & = & \frac{( -1 )^{k} ( \mathbf{x}_{1} \wedge \cdots \wedge ( \mathbf{C}
  )_{k} \wedge \cdots \wedge \mathbf{x}_{n} ) \cdot ( \mathbf{x}_{1} \wedge
  \cdots \wedge \mathbf{x}_{k} \wedge \cdots \wedge \mathbf{x}_{n} )^{}}{( -1
  )^{n ( n-1 ) /2} ( \mathbf{x}_{n} \wedge \cdots \wedge \mathbf{x}_{k} \wedge
  \cdots \wedge \mathbf{x}_{1} ) \cdot ( \mathbf{x}_{1} \wedge \cdots \wedge
  \mathbf{x}_{k} \wedge \cdots \wedge \mathbf{x}_{n} )}\\
  & = & \frac{( -1 )^{k} ( \mathbf{x}_{1} \wedge \cdots \wedge ( \mathbf{C}
  )_{k} \wedge \cdots \wedge \mathbf{x}_{n} ) \cdot ( \mathbf{x}_{n} \wedge
  \cdots \wedge \mathbf{x}_{k} \wedge \cdots \wedge \mathbf{x}_{1} )^{}}{(
  \mathbf{x}_{n} \wedge \cdots \wedge \mathbf{x}_{k} \wedge \cdots \wedge
  \mathbf{x}_{1} ) \cdot ( \mathbf{x}_{1} \wedge \cdots \wedge \mathbf{x}_{k}
  \wedge \cdots \wedge \mathbf{x}_{n} )}\\
  & = & \frac{( \mathbf{x}_{1} \wedge \cdots \wedge ( \mathbf{C} )_{k} \wedge
  \cdots \wedge \mathbf{x}_{n} ) \cdot ( \mathbf{x}_{n} \wedge \cdots \wedge
  \mathbf{x}_{k} \wedge \cdots \wedge \mathbf{x}_{1} )^{}}{( -1 )^{k}
  \left|\begin{array}{ccccc}
    \mathbf{x}_{1} \cdot \mathbf{x}_{1} & \cdots & \mathbf{x}_{1} \cdot
    \mathbf{x}_{k} & \cdots & \mathbf{x}_{1} \cdot \mathbf{x}_{n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    \mathbf{x}_{k} \cdot \mathbf{x}_{1} & \cdots & \mathbf{x}_{k} \cdot
    \mathbf{x}_{k} & \cdots & \mathbf{x}_{k} \cdot \mathbf{x}_{n}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    \mathbf{x}_{n} \cdot \mathbf{x}_{1} & \cdots & \mathbf{x}_{n} \cdot
    \mathbf{x}_{k} & \cdots & \mathbf{x}_{n} \cdot \mathbf{x}_{n}
  \end{array}\right|}\\
  & = & \frac{( \mathbf{x}_{1} \wedge \cdots \wedge ( \mathbf{C} )_{k} \wedge
  \cdots \wedge \mathbf{x}_{n} ) \cdot ( \mathbf{x}_{n} \wedge \cdots \wedge
  \mathbf{x}_{k} \wedge \cdots \wedge \mathbf{x}_{1} )^{}}{( -1 )^{k}
  \left|\begin{array}{ccccc}
    \mathbf{x}_{1} & \cdots & \mathbf{x}_{k} & \cdots & \mathbf{x}_{n}
  \end{array}\right|^{2}}\end{array}

and represents transforming or projecting the system, or each vector \mathbf{c}_{k}, onto the basis of vectors \mathbf{x}_{1} , \ldots ,\mathbf{x}_{k} , \ldots ,\mathbf{x}_{n} which need not be orthonormal. However, solving for the vectors \mathbf{a}_{k} by this formula is unnecessary, and unnecessarily requires n vectors \mathbf{c}_{1} , \ldots ,\mathbf{c}_{k} , \ldots ,\mathbf{c}_{n} at a time. Solving each equation is independent in this case. This has been shown to clarify the usage, as far as what not to do, unless one has an unusual need to solve a particular vector \mathbf{a}_{k}. Instead, the following can be done in the case of projecting vectors \mathbf{c}_{k} onto a new arbitrary basis \mathbf{x}_{k}.

Projecting a vector onto an arbitrary basis.[edit]

Projecting any vector \mathbf{c} onto a new arbitrary basis \mathbf{x}_{1} , \ldots ,\mathbf{x}_{k} , \ldots ,\mathbf{x}_{n} as

\begin{array}{rcl}
  \mathbf{c} & = & c_{1} \mathbf{e}_{1} + \cdots +c_{k} \mathbf{e}_{k} +
  \cdots +c_{n} \mathbf{e}_{n}\\
  & = & a_{1} \mathbf{x}_{1} + \cdots +a_{k} \mathbf{x}_{k} + \cdots +a_{n}
  \mathbf{x}_{n}\end{array}

where each \mathbf{x}_{k} is written in the form

\begin{array}{rcl}
  \mathbf{x}_{k} & = & x_{k1} \mathbf{e}_{1} +x_{k2} \mathbf{e}_{2} + \cdots
  +x_{k k} \mathbf{e}_{k} + \cdots +x_{k n} \mathbf{e}_{n}\end{array}

is a system of n scalar equations in n unknown coordinates a_{k}

\begin{array}{rcl}
  a_{1} x_{11} + \cdots +a_{k} x_{k1} + \cdots +a_{n} x_{n1} & = & c_{1}\\
  & \vdots & \\
  a_{1} x_{1k} + \cdots +a_{k} x_{k k} + \cdots +a_{n} x_{n k} & = & c_{k}\\
  & \vdots & \\
  a_{1} x_{1n} + \cdots +a_{k} x_{k n} + \cdots +a_{n} x_{n n} & = & c_{n}\end{array}

and can be solved using the ordinary Cramer’s rule for systems of scalar equations, where the step of adding a basis can be considered as already done. For n=3, the solutions for the scalars a_{k} are

\begin{array}{rcl}
  \mathbf{c} \wedge \mathbf{x}_{2} \wedge \mathbf{x}_{3} & = & a_{1}
  \mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge \mathbf{x}_{3}\\
  \mathbf{c} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{3} & = & a_{2}
  \mathbf{x}_{2} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{3}\\
  \mathbf{c} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{2} & = & a_{3}
  \mathbf{x}_{3} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{2}\\
  a_{1} & = & \frac{\mathbf{c} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3}}{\mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3}}\\
  a_{2} & = & \frac{\mathbf{c} \wedge \mathbf{x}_{1} \wedge
  \mathbf{x}_{3}}{\mathbf{x}_{2} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{3}}
  = \frac{\mathbf{x}_{1} \wedge \mathbf{c} \wedge
  \mathbf{x}_{3}}{\mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{x}_{3}}\\
  a_{3} & = & \frac{\mathbf{c} \wedge \mathbf{x}_{1} \wedge
  \mathbf{x}_{2}}{\mathbf{x}_{3} \wedge \mathbf{x}_{1} \wedge \mathbf{x}_{2}}
  = \frac{\mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge
  \mathbf{c}}{\mathbf{x}_{1} \wedge \mathbf{x}_{2} \wedge \mathbf{x}_{3}} .\end{array}

For n basis vectors (n equations in n unknowns), the solution for the kth unknown scalar coordinate a_{k} generalizes to

\begin{array}{rcl}
  a_{k} & = & \frac{\mathbf{x}_{1} \wedge \cdots \wedge ( \mathbf{c} )_{k}
  \wedge \cdots \wedge \mathbf{x}_{n}}{\mathbf{x}_{1} \wedge \cdots \wedge
  \mathbf{x}_{k} \wedge \cdots \wedge \mathbf{x}_{n}}\\
  & = & \frac{\left|\begin{array}{ccccc}
    x_{11} & \ldots & c_{1} & \cdots & x_{n1}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    x_{1k} & \cdots & c_{k} & \cdots & x_{n k}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    x_{1n} & \cdots & c_{n} & \cdots & x_{n n}
  \end{array}\right|}{\left|\begin{array}{ccccc}
    x_{11} & \ldots & x_{k1} & \cdots & x_{n1}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    x_{1k} & \cdots & x_{k k} & \cdots & x_{n k}\\
    \vdots & \ddots & \vdots & \ddots & \vdots\\
    x_{1n} & \cdots & x_{k n} & \cdots & x_{n n}
  \end{array}\right|}\end{array}

the formula for Cramer’s rule.

Projecting a vector onto an orthogonal basis.[edit]

Projections onto arbitrary bases \mathbf{x}_{k}, as solved using Cramer’s rule as just above, treats projections onto orthogonal bases as only a special case. Projections onto mutually orthogonal bases can be achieved using the ordinary projection operation

\begin{array}{rcl}
  a_{k} & = & \mathbf{c} \cdot \frac{\mathbf{x}_{k}}{| \mathbf{x}_{k} |^{2}} =
  \frac{\mathbf{c} \cdot \mathbf{x}_{k}}{\mathbf{x}_{k} \cdot \mathbf{x}_{k}}
  = \frac{\mathbf{c}^{||\mathbf{x}_{k}} \cdot \mathbf{x}_{k}}{\mathbf{x}_{k}
  \cdot \mathbf{x}_{k}}\end{array}

which is correct only if the \mathbf{x}_{k} are mutually orthogonal. If the bases \mathbf{x}_{1} , \ldots ,\mathbf{x}_{k} , \ldots ,\mathbf{x}_{n} are constrained to be mutually perpendicular (orthogonal), then the formula for Cramer’s rule becomes

\begin{array}{rcl}
  a_{k} & = & \frac{\mathbf{x}_{1} \wedge \cdots \wedge (
  \mathbf{c}^{||\mathbf{x}_{k}} +\mathbf{c}^{\bot \mathbf{x}_{k}} )_{k} \wedge
  \cdots \wedge \mathbf{x}_{n}}{\mathbf{x}_{1} \wedge \cdots \wedge
  \mathbf{x}_{k} \wedge \cdots \wedge \mathbf{x}_{n}}\\
  & = & \frac{\mathbf{x}_{1} \cdots ( \mathbf{c}^{||\mathbf{x}_{k}} )_{k}
  \cdots \mathbf{x}_{n}}{\mathbf{x}_{1} \cdots \mathbf{x}_{k} \cdots
  \mathbf{x}_{n}} = \frac{\mathbf{c}^{||\mathbf{x}_{k}} \mathbf{x}_{1} \cdots
  ( )_{k} \cdots \mathbf{x}_{n}}{\mathbf{x}_{k} \mathbf{x}_{1} \cdots ( )_{k}
  \cdots \mathbf{x}_{n}}\\
  & = & \frac{\mathbf{c}^{||\mathbf{x}_{k}}}{\mathbf{x}_{k}} =
  \frac{\mathbf{c}^{||\mathbf{x}_{k}} \mathbf{x}_{k}}{\mathbf{x}_{k}
  \mathbf{x}_{k}} = \frac{\mathbf{c} \cdot \mathbf{x}_{k}}{\mathbf{x}_{k}
  \cdot \mathbf{x}_{k}}\end{array}

where \mathbf{c} has been written as a sum of vector components parallel and perpendicular to \mathbf{x}_{k}. For any two perpendicular vectors \mathbf{x}_{j},\mathbf{x}_{k}, their outer product \mathbf{x}_{j} \wedge \mathbf{x}_{k} =\mathbf{x}_{j} \mathbf{x}_{k} equals their geometric product. The vector component \mathbf{c}^{\bot \mathbf{x}_{k}} must be parallel to the other \mathbf{x}_{j \neq k}, therefore its outermorphism is zero. The result is Cramer’s rule reduced to orthogonal projection of vector \mathbf{c} onto base \mathbf{x}_{k} such that \mathbf{c}^{||\mathbf{x}_{k}} =a_{k} \mathbf{x}_{k}.

In general, the bases \mathbf{x}_{1} , \ldots ,\mathbf{x}_{k} , \ldots ,\mathbf{x}_{n} are not necessarily mutually orthogonal and the projection to use is Cramer’s rule, generalized projection, not the dot product specific to orthogonal projection.

Solving a system of vector equations using SymPy.[edit]

The free software SymPy, for symbolic mathematics using python, includes a Geometric Algebra Module and interactive calculator console isympy. The isympy console can be used to solve systems of vector equations using the formulas of this article. A simple example of console interaction follows to solve the system

\begin{array}{rcl}
  3\mathbf{v}_{1} +4\mathbf{v}_{2} +5\mathbf{v}_{3} & = & \mathbf{c}_{1}
  =9\mathbf{e}_{1} +2\mathbf{e}_{2} +3\mathbf{e}_{3}\\
  2\mathbf{v}_{1} +3\mathbf{v}_{2} +7\mathbf{v}_{3} & = & \mathbf{c}_{2}
  =6\mathbf{e}_{1} +5\mathbf{e}_{2} +8\mathbf{e}_{3}\\
  9\mathbf{v}_{1} +6\mathbf{v}_{2} +9\mathbf{v}_{3} & = & \mathbf{c}_{3}
  =2\mathbf{e}_{1} +4\mathbf{e}_{2} +7\mathbf{e}_{3} .\end{array}
$isympy
>>> from sympy.galgebra.ga import *
>>> (e1,e2,e3,e4,e5,e6) = MV.setup('e*1|2|3|4|5|6',metric='[1,1,1,1,1,1]')
>>> (v1,v2,v3) = symbols('v1 v2 v3')
>>> (c1,c2,c3,C) = symbols('c1 c2 c3 C')
>>> (a1,a2,a3) = symbols('a1 a2 a3')
>>> a1 = 3*e4 + 2*e5 + 9*e6
>>> a2 = 4*e4 + 3*e5 + 6*e6
>>> a3 = 5*e4 + 7*e5 + 9*e6
>>> c1 = 9*e1 + 2*e2 + 3*e3
>>> c2 = 6*e1 + 5*e2 + 8*e3
>>> c3 = 2*e1 + 4*e2 + 7*e3
>>> C = (c1^e4) + (c2^e5) + (c3^e6)
>>> v1 = (C^a2^a3)|((-1)**(1-1)*MV.inv(a1^a2^a3))
>>> v2 = (a1^C^a3)|((-1)**(2-1)*MV.inv(a1^a2^a3))
>>> v3 = (a1^a2^C)|((-1)**(3-1)*MV.inv(a1^a2^a3))
>>> 3*v1 + 4*v2 + 5*v3
9*e_1 + 2*e_2 + 3*e_3
>>> 2*v1 + 3*v2 + 7*v3
6*e_1 + 5*e_2 + 8*e_3
>>> 9*v1 + 6*v2 + 9*v3
2*e_1 + 4*e_2 + 7*e_3

Incompatible and indeterminate cases[edit]

A system of equations is said to be incompatible when there are no solutions and it is called indeterminate when there is more than one solution. For linear equations, an indeterminate system will have infinitely many solutions (if it is over an infinite field), since the solutions can be expressed in terms of one or more parameters that can take arbitrary values.

Cramer's rule applies to the case where the coefficient determinant is nonzero. In the contrary case the system is either incompatible or indeterminate, based on the values of the determinants only for 2x2 systems.

For 3x3 or higher systems, the only thing one can say when the coefficient determinant equals zero is: if any of the "numerator" determinants are nonzero, then the system must be incompatible. However, the converse is false: having all determinants zero does not imply that the system is indeterminate. A simple example where all determinants vanish but the system is still incompatible is the 3x3 system x+y+z=1, x+y+z=2, x+y+z=3.

See also[edit]

Notes[edit]

  1. ^ Cramer, Gabriel (1750). "Introduction à l'Analyse des lignes Courbes algébriques" (in French). Geneva: Europeana. pp. 656–659. Retrieved 2012-05-18. 
  2. ^ MacLaurin, Colin (1748). A Treatise of Algebra, in Three Parts.. 
  3. ^ Boyer, Carl B. (1968). A History of Mathematics (2nd ed.). Wiley. p. 431. 
  4. ^ Katz, Victor (2004). A History of Mathematics (Brief ed.). Pearson Education. pp. 378–379. 
  5. ^ Hedman, Bruce A. (1999). "An Earlier Date for "Cramer's Rule"". Historia Mathematica. 4(26) (4): 365–368. doi:10.1006/hmat.1999.2247 
  6. ^ Ken Habgood, Itamar Arel (2012). "A condensation-based application of Cramerʼs rule for solving large-scale linear systems". Journal of Discrete Algorithms 10: 98–109. doi:10.1016/j.jda.2011.06.007. 
  7. ^ Robinson, Stephen M. (1970). "A Short Proof of Cramer's Rule". Mathematics Magazine 43: 94–95. 

External links[edit]