Skip to content or footer

Cramer's rule

Cramer's rule is a method to solve a linear system of equations by means of determinants. However, Cramer's rule is not suitable for the practical calculation of the solution of a system of equations, since this is associated with significantly more computational effort than, for example, with the Gauss algorithm.

Nevertheless, Cramer's rule is useful in a certain way, because the solution of a system of equations depends continuously on the coefficients of the system of equations. In this way, one can obtain estimates for the individual components of the solution.

 

 

Procedure

Linear system of equations

ax1+bx2+cx3=b1dx1+ex2+fx3=b2gx1+hx2+ix3=b3\def\arraystretch{1.25} \begin{array}{ccccc}ax_1+bx_2+cx_3= b_1\\dx_1+ex_2+fx_3= b_2\\gx_1+hx_2+ix_3= b_3\end{array}

The linear system of equations is transformed into an extended coefficient matrix.

        (Ab)=(abcdefghib1b2b3)\def\arraystretch{1.25} \;\;\Rightarrow\;\;( A\left| b)\right.=\left(\begin{array}{ccc} a& b& c\\ d& e& f\\ g& h& i\end{array} \left| \begin{array}{c} b_1\\ b_2\\ b_3\end{array}\right.\right)

Calculation of x1,  x2,  x3x_1,\;x_2,\;x_3 :

A=(abcdefghi)det  A=det (abcdefghi)\def\arraystretch{1.25} \begin{array}{l}A=\begin{pmatrix}a& b & c\\ d & e & f\\ g & h & i \end{pmatrix}\Rightarrow\text{det}\;A=\text{det }\begin{pmatrix}a& b& c\\ d & e & f\\g & h & i \end{pmatrix}\end{array}

The determinant is calculated.

det(Ax1)=det (b1bcb2efb3hi)\text{det}(A_{x_1}) =\text{det }\begin{pmatrix}b_1 & b & c\\ b _2 & e& f\\ b _3& h & i\end{pmatrix}

The column of x1x _1 values is replaced by the result column and the determinant is calculated from it.

det(Ax2)=det (ab1cdb2fgb3i)\text{det}(A_{x_2}) =\text{det }\begin{pmatrix} a & b_1 & c\\ d & b _2 & f\\ g & b _3 & i\end{pmatrix}

The column of x2x_2 values is replaced by the result column and the determinant is calculated from it.

det(Ax3)=det (abb1deb2ghb3)\text{det}(A_{x_3}) =\text{det }\begin{pmatrix} a & b & b_1 \\ d & e &b _2 \\ g & h &b _3\end{pmatrix}

The column of x3x_3 values is replaced by the result column and the determinant is calculated from it.

If det(A) 0\det\left(A\right)\ \ne0, the solutions x1,  x2,  x3x_1,\;x_2,\;x_3 of the given linear system of equations are then obtained as follows:

x1=det(Ax1)det(A)x_1=\frac{\text{det}(A_{x_1})}{\det(A)}

x2=det(Ax2)det(A)x_2=\frac{\text{det}(A_{x_2})}{\det(A)}

x3=det(Ax3)det(A)x_3=\frac{\text{det}(A_{x_3})}{\det(A)}


This content is licensed under
CC BY-SA 4.0Info