Linear Equation Calculator
Solve linear equations for x with step-by-step working and a check, or analyze and graph a line in x and y.
One solution
The x-terms do not cancel, so the equation has exactly one solution.
Solution verified
Substitute x = 4 into the original equation:
Left side: 3(4) + 7 = 19
Right side: 4 + 15 = 19
19 = 19 ✓
Step-by-step solution
Step 1 — Start with the equation
3x + 7 = x + 15
Step 2 — Subtract x from both sides
3x + 7 − x = x + 15 − x
2x + 7 = 15
Step 3 — Subtract 7 from both sides
2x + 7 − 7 = 15 − 7
2x = 8
Step 4 — Divide both sides by 2
2x ÷ 2 = 8 ÷ 2
x = 4
Answers are calculated with exact fractions, so 3x = 7 gives x = 7/3, not a rounded decimal. Related tools: find a line through two points with the Slope Calculator, solve two equations at once with the System of Equations Calculator, handle x² with the Quadratic Formula Calculator, or solve < and > with the Inequality Calculator.
This linear equation calculator solves equations in x the way you would on paper. Type the equation as you see it, for example 3x + 7 = x + 15, 2(x + 3) = 14, x/3 + 2 = 6, or 1.5x + 2.5 = 8.5, and it shows the answer as an exact fraction and a decimal, every step with the operation applied to both sides, and a check that substitutes the answer back into your original equation.
It also tells you when an equation has no solution or infinitely many. Enter an equation with y, such as 2x + y = 6, y = 5, or x = 4, and it analyzes the line instead: slope, intercepts, angle, direction, standard, slope-intercept, and point-slope forms, and a graph drawn to scale. A second mode compares two lines to find their intersection or show that they are parallel, perpendicular, or the same line.
Worked Calculation Examples
| Scenario | Result | Calculation Step |
|---|---|---|
| 3x + 7 = x + 15 | x = 4 | Subtract x from both sides: 2x + 7 = 15. Subtract 7: 2x = 8. Divide by 2: x = 4. Check: 3(4) + 7 = 19 and 4 + 15 = 19. |
| 2(x + 3) = 14 | x = 4 | Expand the parentheses: 2x + 6 = 14. Subtract 6: 2x = 8. Divide by 2: x = 4. |
| x/3 + 2 = 6 | x = 12 | Multiply both sides by 3 to clear the fraction: x + 6 = 18. Subtract 6: x = 12. |
| 3x = 7 | x = 7/3 ≈ 2.333333 | Divide both sides by 3. The exact answer is the fraction 7/3; 2.333333 is a rounded decimal. |
| 2x + 5 = 2x + 8 | No solution | Subtracting 2x from both sides leaves 5 = 8, which is false, so no value of x works. |
| 2x + y = 6 | y = −2x + 6 | Subtract 2x from both sides. The line has slope −2, y-intercept (0, 6), and x-intercept (3, 0). |
How to Solve a Linear Equation
Do the same thing to both sides until x is alone. First simplify each side: expand parentheses and combine like terms, and multiply both sides by the common denominator to clear fractions. Then move the x-terms to one side and the numbers to the other by adding or subtracting, and finally divide by the number in front of x. For 3x + 7 = x + 15: subtract x (2x + 7 = 15), subtract 7 (2x = 8), divide by 2 (x = 4). Substituting x = 4 back gives 19 = 19, which confirms the answer.
No Solution and Infinitely Many Solutions
If the x-terms cancel, the equation no longer depends on x. When what is left is false, like 2x + 5 = 2x + 8 becoming 5 = 8, no value of x works: there is no solution. When it is always true, like 2x + 5 = 2x + 5 becoming 5 = 5, every value of x works: there are infinitely many solutions.
Linear Equations as Lines
An equation in x and y, such as 2x + y = 6, is satisfied by infinitely many points (x, y), and together they form a straight line. Solving for y gives slope-intercept form, y = mx + b, where m is the slope and b is the y-intercept: here y = −2x + 6. Standard form is Ax + By = C, and point-slope form is y − y₁ = m(x − x₁). Two special cases: y = 5 is a horizontal line with slope 0, and x = 4 is a vertical line whose slope is undefined.
How to Use the Linear Equation Calculator
- Type your equation, such as 3x + 7 = x + 15, 2(x + 3) = 14, or x/3 + 2 = 6. Spaces are optional, and 2*x works as well as 2x.
- Press Solve, or tap one of the examples. The result shows x as an exact fraction and a decimal, or tells you the equation has no solution or infinitely many.
- Follow the step-by-step solution: each step names the operation applied to both sides, using your own numbers.
- Check the verification, which substitutes the answer back into both sides of your original equation.
- Enter an equation with y, such as 2x + y = 6, x = 4, or y = 5, to get the graph, slope, intercepts, angle, and all three equation forms. Use Compare two lines to find where two lines intersect, or whether they are parallel, perpendicular, or the same line.
Frequently Asked Questions
How do you solve a linear equation with x on both sides?
Subtract one of the x-terms from both sides so x appears on one side only, move the constants to the other side, then divide by the coefficient of x. For 3x + 7 = x + 15: 2x + 7 = 15, then 2x = 8, so x = 4.
How do you solve a linear equation with parentheses?
Expand the parentheses first using the distributive property, then solve as usual. 2(x + 3) = 14 becomes 2x + 6 = 14, so 2x = 8 and x = 4.
How do you solve a linear equation with fractions?
Multiply both sides by the least common denominator to clear the fractions. For x/3 + 2 = 6, multiply by 3: x + 6 = 18, so x = 12.
What does it mean when a linear equation has no solution?
The x-terms cancel and leave a false statement, such as 5 = 8. No value of x can make both sides equal. Graphically, the two sides are parallel lines that never meet.
What does it mean when a linear equation has infinitely many solutions?
The x-terms cancel and leave a true statement, such as 5 = 5. Both sides are the same expression, so every value of x satisfies the equation.
How do I check my answer?
Substitute the value back into the original equation and simplify each side. If both sides give the same number, the answer is correct. For x = 4 in 3x + 7 = x + 15, both sides equal 19.
Why is my answer a fraction?
Many linear equations have fractional solutions: 3x = 7 gives x = 7/3 exactly. The calculator shows the exact fraction first and a rounded decimal (≈ 2.333333) second, so no precision is lost.
How do I find the slope and intercepts of 2x + y = 6?
Solve for y: y = −2x + 6, so the slope is −2 and the y-intercept is (0, 6). For the x-intercept, set y = 0: 2x = 6, so x = 3, the point (3, 0).
What is the slope of x = 4?
x = 4 is a vertical line, and its slope is undefined because the run (change in x) is 0 and division by 0 is undefined. It makes a 90° angle with the x-axis. By contrast, y = 5 is horizontal with slope 0.
How do I know if two lines are parallel, perpendicular, or intersecting?
Compare their slopes. Equal slopes with different intercepts mean parallel lines; equal slopes and intercepts mean the same line. Different slopes mean the lines intersect at one point, and if the slopes multiply to −1 (or one line is horizontal and the other vertical), they are perpendicular.
Related Calculators
Slope Calculator
Find the slope, equation, intercepts, angle, distance, and midpoint of a line from two points, an equation, or a point and slope, with a graph.
System of Equations Calculator
Solve System of Equations problems online with fast math inputs and results.
Quadratic Formula Calculator
Solve ax^2 + bx + c = 0 quadratic equations.
Inequality Calculator
Solve linear, quadratic, absolute value, and compound inequalities with steps, a number line, and interval notation.
Distance Formula Calculator
Find the distance between two points in 2D or 3D with the distance formula, showing Δx, Δy, Δz, every substitution step, the exact answer and a graph.
Polynomial Root Calculator
Find all real and complex roots of a polynomial, with exact answers, multiplicities, factored form, a graph, and step-by-step working.
Last updated: September 27, 2026.