Linear equations in two variables

You already know how to solve 2x+3=112x + 3 = 11 — one letter, one number waiting to be found. But real situations rarely hand you just one unknown. "The cost of a notebook is twice the cost of a pen" ties two unknown prices together in a single sentence, and no amount of algebra pins either price down exactly — only their relationship. That relationship, written as x−2y=0x - 2y = 0, is a linear equation in two variables: an equation of degree one, connecting two letters instead of one. This article builds the general form ax+by+c=0ax + by + c = 0, shows how to force any messy-looking equation into that shape, and explains why a one-variable equation is secretly a special case of this bigger family. Getting this definition rock solid is what makes the next two topics — finding solutions, and graphing them as a straight line — click into place.

The core insight

A linear equation in two variables has the form ax+by+c=0ax + by + c = 0 with aa and bb not both zero, and because one equation cannot fix two unknowns at once, it is satisfied by infinitely many pairs (x,y)(x, y) rather than a single answer.

The core idea

What "linear" and "two variables" mean together. An equation is called linear when every variable appears only to the first power — no x2x^2, no y2y^2, and no product term like xyxy. When two such variables, conventionally xx and yy, are joined by addition, subtraction, and multiplication by constants, the result is a linear equation in two variables. The standard way to write any such equation is:

ax+by+c=0ax + by + c = 0

where: xx and yy are the two variables, aa and bb are their coefficients, cc is the constant term, and a,b,ca, b, c are real numbers with the single restriction that aa and bb are not both zero — at least one of them must be non-zero, or there would be no variable left in the equation at all.

Any linear relation can be forced into this shape. An equation like 2x=3y−72x = 3y - 7 does not look like ax+by+c=0ax + by + c = 0 at first glance, but moving every term to one side gives 2x−3y+7=02x - 3y + 7 = 0, so a=2a = 2, b=−3b = -3, c=7c = 7. This rearranging step — collect everything on one side, keep the right side zero — is the entire skill this topic is built on.

A one-variable equation is a hidden special case. Something like x+5=0x + 5 = 0 can be rewritten as 1⋅x+0⋅y+5=01\cdot x + 0\cdot y + 5 = 0: it is a two-variable equation where the coefficient of yy happens to be zero. This is exactly why the condition is "aa and bb not both zero" rather than "both non-zero" — an equation with b=0b = 0 (or a=0a = 0) is still perfectly valid, as long as the other coefficient survives.

Why one equation cannot fix two unknowns. With a single linear equation and two independent letters, choosing any value for xx still leaves an equation in yy alone to solve, and a different choice of xx gives a different yy. So instead of one definite answer, the equation is satisfied by an unending list of pairs (x,y)(x, y) — the idea that the next topic (finding and listing solutions) develops in full.

Figure
Diagram of the standard form of a linear equation in two variables labelling coefficient a coefficient b and constant term c
Standard form: a x + b y + c = 0 a·x + b·y + c = 0 coefficient of x coefficient of y constant term condition: a and b are not both zero x and y are the two unknowns; a, b, c are real numbers
Derivation AReducing any given equation to the standard form and reading off a, b, c

The goal is to show that no matter how a linear relationship between two unknowns is originally written — with terms on both sides, in a different order, or missing one variable altogether — it can always be rearranged into the single template ax+by+c=0ax + by + c = 0, and that this rearrangement is what lets us safely read off the values of aa, bb, and cc without ambiguity.

Step 1. Start from any linear relation joining two unknowns, written however it first appears — for instance an equation with terms on both sides of the equals sign, such as py+q=rxpy + q = rx, where p,q,rp, q, r are some known real numbers and x,yx, y are the unknowns.

Step 2. Move every term to one side so the other side becomes zero. Subtracting rxrx from both sides gives py+q−rx=0py + q - rx = 0, which still contains exactly the same information as the original equation — nothing has been added, removed, or multiplied in, only shifted across the equals sign.

Step 3. Reorder the terms so the xx-term comes first, matching the template ax+by+c=0ax + by + c = 0: −rx+py+q=0-rx + py + q = 0. Sign errors are the one place this step can go wrong, so each term must carry the sign it had immediately after Step 2.

Step 4. Compare term by term with ax+by+c=0ax + by + c = 0 to read off the coefficients: a=−ra = -r, b=pb = p, c=qc = q. Finally check the condition — since the original equation genuinely involved both xx and yy, at least one of pp and rr is non-zero, so aa and bb are not both zero, confirming this is a valid linear equation in two variables.

Worked example

Problem. The cost of a notebook is twice the cost of a pen. Write this as a linear equation in two variables in standard form, identify aa, bb, cc, and check whether the price pair notebook ₹20, pen ₹10 fits the equation.

Step 1. Choose letters for the two unknown prices. Let the cost of a notebook be ₹ x\text{₹}\,x and the cost of a pen be ₹ y\text{₹}\,y.

Step 2. Translate the sentence into an equation: "notebook cost is twice pen cost" becomes x=2yx = 2y.

Step 3. Rearrange into standard form by moving every term to one side: x−2y=0x - 2y = 0, i.e. x−2y+0=0x - 2y + 0 = 0. Comparing with ax+by+c=0ax + by + c = 0 gives a=1a = 1, b=−2b = -2, c=0c = 0; since a≠0a \ne 0, the condition on a,ba, b holds.

Step 4. Test the given pair. Substitute x=20,y=10x = 20, y = 10 into x−2yx - 2y: 20−2(10)=20−20=020 - 2(10) = 20 - 20 = 0, which matches the right-hand side, so (20,10)(20, 10) satisfies the equation — a sensible price pair, since ₹20 is indeed twice ₹10.

Answer: the standard form is x−2y+0=0x - 2y + 0 = 0 with a=1,b=−2,c=0a = 1, b = -2, c = 0, and (notebook ₹20, pen ₹10) is one of its solutions.

Competitive stretch

Would (notebook ₹15, pen ₹5) also work? Substitute: 15−2(5)=15−10=515 - 2(5) = 15 - 10 = 5, which is not 00, so this pair does not satisfy the equation — ₹15 is not twice ₹5. Only pairs where the notebook price is exactly double the pen price will work, and there are infinitely many such pairs, e.g. (10,5)(10, 5), (20,10)(20, 10), (30,15)(30, 15), all lying on the same relationship.

Common traps

  • Calling an equation "linear" just because it looks short: x2+2y=7x^2 + 2y = 7 has a squared term and is not linear, regardless of how simple it appears.
  • Forgetting that a one-variable equation such as 3x−9=03x - 9 = 0 is also a two-variable equation in disguise, 3x+0y−9=03x + 0y - 9 = 0 — questions sometimes test exactly this connection.
  • Misreading the condition on aa and bb: it only forbids both being zero at once, so 0x+5y−10=00x + 5y - 10 = 0 (i.e. 5y=105y = 10) is still perfectly valid.
  • Sloppy sign-flips while moving a term across the equals sign, which silently changes the value of aa, bb, or cc that gets read off.

Ask the tutor: Want to practice converting a few messy equations into standard form, or check whether a particular pair of numbers is a solution — ask the AI tutor to work through more examples with you.

Why does an equation with two unknowns not just have one clean answer like a one-variable equation does?

Because there is only one condition (the equation) trying to constrain two independent letters. Fixing xx to any value still leaves the equation free to be solved for yy, and a different choice of xx gives a different valid yy. So instead of a single pinned-down answer, you get a whole family of pairs (x,y)(x, y) that all satisfy the relationship — which is exactly what the next topic explores by actually listing and graphing them.

Is x + 5 = 0 a one-variable equation or a two-variable equation?

Both, depending on how you look at it. On its own it is a familiar one-variable equation with the single solution x=−5x = -5. But it can also be written as 1⋅x+0⋅y+5=01\cdot x + 0\cdot y + 5 = 0, which fits the two-variable template ax+by+c=0ax + by + c = 0 with b=0b = 0. So a one-variable linear equation is really a special case of the two-variable form, not a different kind of object altogether.

How do I know if an equation like 2x = 3y - 7 counts, since it does not look like ax + by + c = 0 at all?

Rearrange it first. Move every term to one side so the other side is zero: 2x−3y+7=02x - 3y + 7 = 0. Now it matches the template directly, with a=2a = 2, b=−3b = -3, c=7c = 7. Many equations that look unfamiliar are linear equations in two variables in disguise — the standard form is not a different kind of equation, just a tidy, comparable way of writing the same relationship.

Before this

Where this leads