ArticleslgStudy

mathematics

Cramer's rule

Cramer's rule is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Cramer's rule rather than just read about it. In short: 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 column vector of right-sides of the equations.

Cramer's rule — main illustration
Cramer's rule — illustration

Key takeaways

  • Cramer's rule belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Cramer's rule to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Cramer's rule from memory before moving on to harder problems.

Reference excerpt

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 column vector of right-sides of the equations. It is named after Gabriel Cramer, who published the rule for an arbitrary number of unknowns in 1750, although Colin Maclaurin also published special cases of the rule in 1748, and possibly knew of it as early as 1729.

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

A𝐱=𝐛 where the n × n matrix A has a nonzero determinant, and the vector 𝐱=(x1,…,xn)𝖳 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:

xi=det⁡(Ai)det⁡(A)i=1,…,n where Ai is the matrix formed by replacing the i-th column of A by the column vector b. A more general version of Cramer's rule considers the matrix equation

AX=B where the n × n matrix A has a nonzero determinant, and X, B are n × m matrices. Given sequences 1≤i1<i2<⋯<ik≤n and 1≤j1<j2<⋯<jk≤m, let XI,J be the k × k submatrix of X with rows in I:=(i1,…,ik) and columns in J:=(j1,…,jk). Let AB(I,J) be the n × n matrix formed by replacing the is column of A by the js column of B, for all s=1,…,k. Then

det⁡XI,J=det⁡(AB(I,J))det⁡(A). In the case k=1, this reduces to the normal Cramer's rule. The rule holds for systems of equations with coefficients and unknowns in any field, not just in the real numbers.

Proof The proof for Cramer's rule uses the following properties of the determinants: linearity with respect to any given column and the fact that the determinant is zero whenever two columns are equal, which is implied by the property that the sign of the determinant flips if you switch two columns. Fix the index j of a column, and consider that the entries of the other columns have fixed values. This makes the determinant a function of the entries of the jth column. Linearity with respect to this column means that this function has the form

Dj(a1,j,…,an,j)=C1,ja1,j+⋯,Cn,jan,j, where the Ci,j are coefficients that depend on the entries of A that are not in column j. So, one has

det⁡(A)=Dj(a1,j,…,an,j)=C1,ja1,j+⋯,Cn,jan,j (Laplace expansion provides a formula for computing the Ci,j but their expression is not important here.) If the function Dj 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 x1,…,xn, whose coefficient matrix is A, with det(A) assumed to be nonzero:

a11x1+a12x2+⋯+a1nxn=b1a21x1+a22x2+⋯+a2nxn=b2⋮an1x1+an2x2+⋯+annxn=bn. If one combines these equations by taking C1,j times the first equation, plus C2,j times the second, and so forth until Cn,j times the last, then for every k the resulting coefficient of xk becomes

Dj(a1,k,…,an,k). So, all coefficients become zero, except the coefficient of xj, which becomes det⁡(A). Similarly, the constant coefficient becomes Dj(b1,…,bn), and the resulting equation is thus

det⁡(A)xj=Dj(b1,…,bn), which gives the value of xj as

xj=1det⁡(A)Dj(b1,…,bn). As, by construction, the numerator is the determinant of the matrix obtained from A by replacing column j by b, we get the expression of Cramer's rule as a necessary condition for a solution. It remains to prove that these values for the unknowns form a solution. Let M be the n × n matrix that has the coefficients of Dj as jth row, for j=1,…,n (this is the adjugate matrix for A). Expressed in matrix terms, we have thus to prove that

𝐱=1det⁡(A)M𝐛 is a solution; that is, that

A(1det⁡(A)M)𝐛=𝐛. For that, it suffices to prove that

A(1det⁡(A)M)=In, where In is the identity matrix. The above properties of the functions Dj show that one has MA = det(A)In, and therefore,

(1det⁡(A)M)A=In. This completes the proof, since a left inverse of a square matrix is also a right-inverse (see Invertible matrix theorem). For other proofs, see below.

Finding inverse matrix

Let A be an n × n matrix with entries in a field F. Then

Aadj⁡(A)=adj⁡(A)A=det⁡(A)I where adj(A) denotes the adjugate matrix, det(A) is the determinant, and I is the identity matrix. If det(A) is nonzero, then the inverse matrix of A is

A−1=1det⁡(A)adj⁡(A). This gives a formula for the inverse of A, provided det(A) ≠ 0. In fact, this formula works whenever F is a commutative ring, provided that det(A) is a unit. If det(A) is not a unit, then A is not invertible over the ring (it may be invertible over a larger ring in which some non-unit elements of F may be invertible).

Applications

Explicit formulas for small systems Consider the linear system

{a1x+b1y=c1a2x+b2y=c2 which in matrix format is

[a1b1a2b2][xy]=[c1c2]. Assume a1b2 − b1a2 is nonzero. Then, with the help of determinants, x and y can be found with Cramer's rule as

x=|c1b1c2b2||a1b1a2b2|=c1b2−b1c2a1b2−b1a2,y=|a1c1a2c2||a1b1a2b2|=a1c2−c1a2a1b2−b1a2. The rules for 3 × 3 matrices are similar. Given

{a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3 which in matrix format is

[a1b1c1a2b2c2a3b3c3][xyz]=[d1d2d3]. Then the values of x, y and z can be found as follows:

x=|d1b1c1d2b2c2d3b3c3||a1b1c1a2b2c2a3b3c3|,y=|a1d1c1a2d2c2a3d3c3||a1b1c1a2b2c2a3b3c3|,z=|a1b1d1a2b2d2a3b3d3||a1b1c1a2b2c2a3b3c3|.

Differential geometry

Ricci calculus Cramer's rule is used in the Ricci calculus in various calculations involving the Christoffel symbols of the first and second kind. In particular, Cramer's rule can be used to prove that the divergence operator on a Riemannian manifold is invariant with respect to change of coordinates. We give a direct proof, suppressing the role of the Christoffel symbols. Let (M,g) be a Riemannian manifold equipped with local coordinates (x1,x2,…,xn). Let A=Ai∂∂xi be a vector field. We use the summation convention throughout.

Theorem. The divergence of A, div⁡A=1det⁡g∂∂xi(Aidet⁡g), is invariant under change of coordinates.

Computing derivatives implicitly 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). An equation for ∂x∂u can be found by applying Cramer's rule.

… excerpt ends here. Continue reading the full article.

Illustrations

Cramer's rule: Animated 3D illustration of Cramer's rule as a ratio of determinants
Animated 3D illustration of Cramer's rule as a ratio of determinants

Worked examples

Example 1 — a first encounter with Cramer's rule

Start with the simplest possible case. Write down what Cramer's rule claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Cramer's rule before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Cramer's rule ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Cramer's rule

In research
Cramer's rule appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Cramer's rule in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Cramer's rule is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1750 in science, Determinants, Theorems in linear algebra, so understanding it makes those chapters shorter.
In everyday life
Look for Cramer's rule outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Cramer's rule” →

How to study Cramer's rule in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Cramer's rule means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Cramer's rule out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Cramer's rule in simple terms?

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 obt…

Why does Cramer's rule matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Cramer's rule?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Cramer's rule.

Tags

  • 1750 in science
  • Determinants
  • Theorems in linear algebra

Keep exploring