Cramer's rule
Cramer’s rule is not in the body of the Introduction to the analysis of algebraic curves. On page 60, in the middle of a problem about curves passing through given points, Cramer arrives at five linear equations in five unknowns and sends the reader to the end of the book. There, in the first appendix, on pages 657 to 659, is the rule.
The notation
Cramer begins with a notation he has to explain, because a reader of 1750 would find it strange. The unknowns are $z, y, x, v, \ldots$, and the equations are
$$ \begin{aligned} A^1 &= Z^1 z + Y^1 y + X^1 x + V^1 v + \cdots \\ A^2 &= Z^2 z + Y^2 y + X^2 x + V^2 v + \cdots \\ A^3 &= Z^3 z + Y^3 y + X^3 x + V^3 v + \cdots \end{aligned} $$“where the letters $A^1, A^2, A^3, \ldots$ do not denote, as usual, the powers of $A$, but the first member, supposed known, of the first, second, third equation.” The raised numbers are indices, not exponents: $Z^2$ is the coefficient of $z$ in the second equation. Today we would write $a_{21}$.
With one equation and one unknown, $z = \frac{A^1}{Z^1}$. With two,
$$z = \frac{A^1 Y^2 - A^2 Y^1}{Z^1 Y^2 - Z^2 Y^1}, \qquad y = \frac{Z^1 A^2 - Z^2 A^1}{Z^1 Y^2 - Z^2 Y^1}.$$With three, each fraction has six terms above and six below, and Cramer writes them all out in full.
The general rule
Then comes the rule, which we translate from page 658:
The number of equations and of unknowns being n, one finds the value of each unknown by forming n fractions whose common denominator has as many terms as there are different arrangements of n different things. Each term is composed of the letters ZYXV etc., always written in the same order, but to which one distributes as exponents the first n digits, arranged in all possible ways.
— Gabriel Cramer, Introduction to the analysis of algebraic curves (1750)
For three unknowns, the letters $Z Y X$ receive the exponents $123, 132, 213, 231, 312, 321$, and the denominator has $1 \times 2 \times 3 = 6$ terms. What remains is to decide the sign of each, and here is Cramer’s original contribution:
When an exponent is followed in the same term, mediately or immediately, by an exponent smaller than itself, I shall call this a derangement. Let the number of derangements be counted for each term: if it is even or zero, the term will have the sign +; if it is odd, the term will have the sign −.
— Gabriel Cramer, Introduction to the analysis of algebraic curves (1750)
What Cramer calls a derangement (dérangement) is what is now called an inversion of a permutation: a pair of positions in which the larger number comes before the smaller. The term $Z^3 Y^1 X^2$ has two derangements, $3$ before $1$ and $3$ before $2$, and takes the sign $+$. The term $Z^3 Y^2 X^1$ has three, $3$ before $2$, $3$ before $1$ and $2$ before $1$, and takes the sign $-$.
The denominator formed in this way is what we now call the determinant of the system, $\Delta$. To obtain the numerator of $z$, says Cramer, it suffices to replace the letter $Z$ by the letter $A$ in every term of the denominator; for that of $y$, to replace $Y$ by $A$; and so on. In today’s language: the unknown $x_k$ is $\frac{\Delta_k}{\Delta}$, where $\Delta_k$ is the determinant of the matrix in which column $k$ has been replaced by the column of constant terms.
An example with three unknowns
Let us solve
$$ \begin{aligned} 2x + y - z &= 3 \\ x - y + 2z &= 5 \\ 3x + 2y + z &= 10. \end{aligned} $$The denominator has six terms, one for each arrangement of the row indices:
$$ \begin{aligned} \Delta &= 2 \cdot (-1) \cdot 1 - 2 \cdot 2 \cdot 2 - 1 \cdot 1 \cdot 1 \\ &\quad + 1 \cdot 2 \cdot 3 + (-1) \cdot 1 \cdot 2 - (-1) \cdot (-1) \cdot 3 \\ &= -2 - 8 - 1 + 6 - 2 - 3 = -10. \end{aligned} $$Replacing the column of $x$ by $3, 5, 10$, then that of $y$ and that of $z$, one finds in the same way $\Delta_x = -20$, $\Delta_y = -10$ and $\Delta_z = -20$. Hence
$$x = \frac{-20}{-10} = 2, \qquad y = \frac{-10}{-10} = 1, \qquad z = \frac{-20}{-10} = 2.$$Checking in the first equation: $4 + 1 - 2 = 3$.
Two lines
With two unknowns, each equation is a line in the plane, and the solution is the point where they cross. The denominator $\Delta = a d - b c$ of the equations $a x + b y = e$ and $c x + d y = f$ is zero exactly when the lines have the same slope: then there is no crossing point, or there are infinitely many. In the figure, change the coefficients and watch the three determinants:
Cramer ends the appendix by remarking that, “generally speaking, the problem is determinate”, but that there are cases in which the denominator vanishes and the problem becomes indeterminate or impossible. It was precisely one of these cases that led him to the paradox that bears his name.
Exercise: a system of two equations
Solve by Cramer’s rule the system $3x + 2y = 12$, $x - y = -1$.
$\Delta = 3 \cdot (-1) - 2 \cdot 1 = -5$, $\Delta_x = 12 \cdot (-1) - 2 \cdot (-1) = -10$ and $\Delta_y = 3 \cdot (-1) - 12 \cdot 1 = -15$. Hence $x = \frac{-10}{-5} = 2$ and $y = \frac{-15}{-5} = 3$. Checking: $6 + 6 = 12$ and $2 - 3 = -1$.
Exercise: counting derangements
With four unknowns $Z Y X V$, what sign does the term $Z^2 Y^4 X^1 V^3$ have? And $Z^4 Y^3 X^2 V^1$?
In $2413$ the derangements are $2$ before $1$, $4$ before $1$ and $4$ before $3$: three of them, an odd number, so the sign is $-$. In $4321$ each of the $\binom{4}{2} = 6$ pairs is inverted: six derangements, an even number, so the sign is $+$.
Sources: Gabriel Cramer, Introduction à l’analyse des lignes courbes algébriques (1750), pp. 59–60 and 657–659 · Carl B. Boyer, “Colin Maclaurin and Cramer’s Rule”, Scripta Mathematica 27 (1966) · Thomas Muir, The Theory of Determinants in the Historical Order of Development, vol. 1 (1906).
All topics on Gabriel Cramer · ← The life of Gabriel Cramer · Seki, Leibniz and Maclaurin: determinants before Cramer →