How to Solve Three Simultaneous Equations

Solves three equations such as a₁x + b₁y + c₁z = d₁ for x, y and z with Cramer's rule: the determinant with one column replaced by the right-hand side, over the determinant of the coefficients. When that determinant is zero there is no unique solution.

Three unknowns, xx, yy and zz, need three equations. Cramer's rule builds the determinant of the coefficients and compares it with the determinant obtained by replacing one column with the right-hand side.

x=DxD,y=DyD,z=DzDx = \dfrac{D_x}{D}, \quad y = \dfrac{D_y}{D}, \quad z = \dfrac{D_z}{D}

DD is the determinant of the coefficients. DxD_x replaces the first column with the right-hand side, and DyD_y and DzD_z replace the second and third columns in the same way.

Example

Solve x+y+z=6x + y + z = 6, 2xy+z=32x - y + z = 3 and x+2yz=2x + 2y - z = 2. The determinant of the coefficients is D=7D = 7. Replacing the first column with 6, 3 and 2 gives Dx=7D_x = 7, so x=1x = 1. In the same way Dy=14D_y = 14 and Dz=21D_z = 21, giving y=2y = 2 and z=3z = 3. Putting these into all three equations confirms them.

When there is no unique solution

A determinant of 0 means the solution is not unique. One of the three equations can be built from the other two, so there are really only two equations worth of information. Either infinitely many solutions exist, or none at all.

Notes

Substitution and elimination give the same answer. Cramer's rule follows a fixed procedure, which suits a machine.

Enter each equation as aa, bb, cc and then the right-hand side dd.