Linear equation solver
Solve a system of linear equations with 2 or 3 variables, a single linear equation, or the equation of a line through two points.
Solution
Solution
-
- x
- -
- y
- -
- z
- -
Single linear equation
Solve ax + b = c for x.
- x
- -
Line through two points
Slope and y-intercept for the line y = mx + b that passes through both points.
- Slope (m)
- -
- Line equation
- -
How it works
A linear equation is an algebraic equation where every variable appears only to the first power, such as ax + b = c, or a system of such equations solved together. A system's graph is a set of straight lines (or planes with 3 variables), and the solution is where they all meet.
- Pick 2 or 3 variables
Each equation gets a row of coefficients.
- Enter the coefficients
Negative and decimal values are fine.
- Read the solution
Or see why there is none or infinitely many.
Cramer's rule
The calculator solves a system by Cramer's rule: divide the determinant of a modified coefficient matrix by the determinant of the original one.
x = det(A_x) / det(A), y = det(A_y) / det(A)
For 2x + 3y = 8 and 4x - y = 2: det(A) = (2)(-1) - (4)(3) = -14. Swapping the x-column for the right-hand side gives det(A_x) = (8)(-1) - (2)(3) = -14, so x = -14 / -14 = 1. Swapping the y-column gives det(A_y) = (2)(2) - (4)(8) = -28, so y = -28 / -14 = 2.
When there is no unique solution
If det(A) is 0, the equations cannot be solved by division. For 2 variables, the calculator then checks whether the equations describe the same line (infinitely many solutions) or two parallel lines that never meet (no solution). For 3 variables, a zero determinant means the 3 planes do not intersect in exactly one point; telling apart no solution from infinitely many needs comparing the equations directly rather than a single number.
A vertical line has no slope
The line through two points with the same x-coordinate is vertical: its equation is x = a constant, and slope (rise over run) is undefined because the run is 0. The calculator reports this directly instead of an error.
Frequently asked questions
How do you solve a system of two linear equations with two variables?
The calculator uses Cramer's rule (the determinant method). For 2x + 3y = 8 and 4x - y = 2, the determinant is D = (2)(-1) - (4)(3) = -14. Then x = (8 × -1 - 2 × 3) / -14 = 1 and y = (2 × 2 - 4 × 8) / -14 = 2. Check: 2(1) + 3(2) = 8, which matches.
Can this solve a system with 3 variables?
Yes. Switch to 3 variables and enter 3 equations of the form ax + by + cz = d. The calculator extends Cramer's rule to 3x3 determinants to solve for x, y and z at once. For example, x + y + z = 6, 2y + 5z = -4 and 2x + 5y - z = 27 solves to x = 5, y = 3, z = -2.
What does it mean when the solver reports no solution or infinitely many?
Both happen when the determinant is 0. With 2 variables, the calculator checks whether the two equations describe the exact same line, which gives infinitely many solutions, or two parallel lines that never meet, which gives no solution. For example, x + y = 3 and 2x + 2y = 6 are the same line, so every point on it satisfies both.
How does the calculator find the slope between two points?
Slope m = (y2 - y1) / (x2 - x1). For points (1, 2) and (3, 6): m = (6 - 2) / (3 - 1) = 2. Then the y-intercept b = y1 - m × x1 = 2 - 2(1) = 0, giving the line y = 2x. If x1 equals x2, the line is vertical and the calculator reports "x = " that shared value instead of a slope.
What happens if a = 0 in the single equation ax + b = c?
If a = 0, there is no x term left: the equation becomes b = c. If b equals c, every value of x is a solution. If b does not equal c, there is no solution. The calculator reports which of these applies instead of a misleading number.