Home / Blog / Math & Scientific

Math & Scientific

Solve Two Linear Equations: Elimination and Substitution

Solve a two-variable linear system, verify both equations, distinguish dependent and inconsistent cases, and enter supported expressions in the local calculator.

Solve Two Linear Equations: Elimination and Substitution

Identify the equations before solving

A system asks for values that satisfy every equation at the same time. For the worked example 2x+y=5 and x−y=1, one pair must make both statements true. The local System of Equations Calculator supports two linear equations in x and y. Linear expressions can contain constants, additions, subtractions and constant multiples of the variables. Terms such as x², xy or a variable in a denominator fall outside that input model. Enter the actual equations rather than only a list of numbers whose variable order is unclear.

Eliminate one variable with a reversible operation

Add the two example equations. The positive y in the first and negative y in the second cancel, leaving 3x=6. Divide by three to obtain x=2. Substitute that value into x−y=1: 2−y=1, so y=1. The final solution is the ordered pair (2,1), with x first and y second. Elimination works here because adding the same equality information preserves the set of simultaneous solutions. Simply deleting a term from one equation without an equivalent operation would change the problem.

Check the pair in both original equations

For x=2 and y=1, the first left side is 2×2+1=5 and the second is 2−1=1. Both match their right sides, so the pair passes substitution. Checking only one equation would be insufficient: the pair (1,3) also satisfies 2x+y=5, but gives 1−3=−2 in the second equation. This is a useful way to catch an arithmetic sign error or a transposed result. Preserve the original equations while working so the verification does not accidentally use an already mistyped intermediate line.

Use substitution when one variable is easy to isolate

The same system can be solved by rewriting x−y=1 as y=x−1, then substituting into 2x+y=5. This gives 2x+(x−1)=5, followed by 3x=6. Parentheses protect the sign of a substituted expression. For example, replacing y in x−2y with x−1 gives x−2(x−1), which expands to −x+2. Writing x−2x−1 instead distributes the negative factor incorrectly. Comparing elimination with substitution on a small problem helps reveal whether a discrepancy comes from the method or an algebraic step.

Distinguish no solution from many solutions

Consider x+y=2 together with 2x+2y=4. The second is twice the first, so every point on the first line satisfies both: there are infinitely many solutions. Changing the second right side to 5 makes the equations inconsistent, because doubling the first still produces 4, not 5. The local calculator reports that these systems have no unique solution; it does not separately classify the two cases. Inspect the scaled constants yourself before interpreting that message. Neither case should be represented as one arbitrary pair of x and y values.

Enter and interpret the local result

Type 2x+y=5 and x-y=1 in the two fields and select Calculate. The result is x=2 and y=1 with a coefficient-form echo. Expressions such as 2*(x+y)/4=3 are also linear because multiplication and division involve constants. The calculator rejects unsupported nonlinear structure instead of inferring linearity from a few sampled values. Its numerical output uses finite-precision arithmetic. If two equations are extremely close to parallel, the tool may report that no unique solution can be distinguished at its numerical precision rather than display an unstable answer.

Keep the solution tied to its real meaning

If x and y represent quantities in a word problem, attach their units after solving and check any restrictions on those quantities. A negative solution might be mathematically correct for the entered equations but impossible for a count of tickets. Scaling an entire equation by a nonzero constant should preserve the solution: multiplying both example equations by one ten-millionth still gives (2,1), and the calculator handles that uniform scaling. Changing only one term is a different operation. Finish with both the verified pair and the original interpretation, so a correct algebraic result answers the intended question.

Use the System of Equations Calculator

Open System of Equations Calculator

Source and scope

MIT OpenCourseWare: matrix algebra reference