e-Mathematics > Matrix Algebra

Cramer Rule

Adjugate Matrix. Let $ C_{ij}$ be the $ (i,j)$-cofactor of $ A$. Then we define the adjugate $\mathrm{adj}~A$” of $ A$ by

$\displaystyle \mathrm{adj}~A
= \begin{bmatrix}
C_{11} & C_{21} & \cdots & C_...
...ts & \vdots & & \vdots \\
C_{1n} & C_{2n} & \cdots & C_{nn}
\end{bmatrix}
$

Inverse Formula. By applying the Laplace expansions and the property (5) of determinants (that is, $ \det [ \mathbf{a}_1 
\ldots \mathbf{a}_k \ldots \mathbf{a}_{k} 
\ldots \mathbf{a}_n]
= 0$), we can find that

$\displaystyle (\mathrm{adj}~A)
\begin{bmatrix}
a_{11} & a_{12} & \cdots & a_...
...\\
\vdots & \vdots & & \vdots \\
0 & 0 & \cdots & \det A
\end{bmatrix}
$

If $ A$ is invertible (that is, $ \det A \neq 0$), the above equation immediately implies that

$\displaystyle A^{-1} = \frac{1}{\det A} \mathrm{adj}~A.
$

Matlab/Octave. The function adjoint(A) return the adjugate (also known as classical adjoint) of a square matrix $ A$.

EXAMPLE 3. Calculate the adjugate and find the inverse of $A = \begin{bmatrix}
2 & 1 & 3 \\
1 &-1 & 1 \\
1 & 4 &-2
\end{bmatrix}$

Cramer Rule. Furthermore, we can express the solution to the matrix equation  $ A \mathbf{x} = \mathbf{b}$ by

$\displaystyle \mathbf{x}
= \frac{1}{\det A}
\begin{bmatrix}
C_{11} & C_{21}...
...
\det [ \mathbf{a}_1 \mathbf{a}_2  \ldots  \mathbf{b} ]
\end{bmatrix}
$

Let $ A_i(\mathbf{b})$ be the matrix produced by replacing the $ i$th column by $ \mathbf{b}$. Then the Cramer's rule gives the solution  $ \mathbf{x} = A^{-1} \mathbf{b}$ entry-wise in the following form:

$\displaystyle x_i = \frac{\det A_i(\mathbf{b})}{\det A}$    for $ i=1,\ldots,n$. $\displaystyle $

Matlab/Octave. Engineering problems often involves linear equations whose coefficients contain unspecified parameters, and Cramer's rule can be used to describe the solution. In Matlab (but not in Octave) you can create an unspecified parameter s using syms or sym().

> syms s t

> sym('s')
Afterward it calculates symbolically when s is used in matrix operations.

EXAMPLE 1. Find the solution to each of the following systems of linear equations:

  1. $\left\{\begin{array}{rrr}
3x_1 - 2x_2 & = & 6 \\
-5x_1 + 4x_2 & = & 8
\end{array}\right.$

  2. $\left\{\begin{array}{rrr}
3sx_1 - 2x_2 & = & 4 \\
-6x_1 + sx_2 & = & 1
\end{array}\right.$


© TTU Mathematics