Create your own
Lesson illustration

Solving One-Variable Linear Equations

Hello again. Last time, you simplified expressions by combining like terms while preserving signs. That skill now becomes part of a larger task: solving an equation. Instead of rewriting an expression in a shorter form, you will find the value of a variable that makes a statement true.

In this lesson, you will solve one-variable linear equations using balanced operations, inverse operations, and a consistent written method. These are foundational skills for later work with model formulas, gradients, and linear regression.


An equation is a claim that must stay true

An equation says that the expression on its left has the same value as the expression on its right. For example,

is not yet a statement that is always true. It becomes true only for particular values of . A solution is a value that makes the equation true.

Try :

This is true, so is a solution.

A one-variable linear equation contains one unknown variable, such as , and that variable is only raised to the first power. Many can be written in a form like

where , , , and are known numbers.

The governing idea is simple: an equation behaves like a balanced scale. If you change only one side, the equality may stop being true. If you do the same operation to both sides, equality is preserved.

For any number , if

then each of these remains valid:

and, provided ,

Watch the opening examples from Math Antics before continuing. The balance-scale picture is worth keeping in mind whenever you write a solution.

Algebra Basics: Solving Basic Equations Part 1 - Math Antics

Watch “Algebra Basics: Solving Basic Equations Part 1” by mathantics. It introduces the goal of isolating an unknown and makes the balancing rule visually concrete.

Watch the balance principle to see why every change must be duplicated on both sides. Then watch a one step solve, focusing on how subtraction undoes addition and how substitution checks the result.


Isolate the variable by undoing operations

To solve an equation, aim to end with the variable alone:

The operations attached to must be undone with their inverse operations.

Operation currently affecting Inverse operation
Add Subtract
Subtract Add
Multiply by Divide by
Divide by Multiply by

The order matters. Suppose a value was first multiplied by , then was subtracted:

To recover , undo the most recent operation first: add , then divide by . This is the reverse of the order used to evaluate the expression.

Worked example: a two-step equation

Solve:

The is the outermost operation affecting , so add to both sides:

Simplify:

Now is multiplied by . Divide both sides by :

Notice what did not happen: we did not “move across the equals sign and make it .” That phrase is a shortcut, but the actual legal operation was adding to each side.

The supplied Solving Equations Examples image shows this balancing method alongside a “function machine” interpretation. In the function-machine view, you retrace the operations acting on the variable in reverse, applying inverse operations.

Three one-variable linear equations solved two ways: the balancing method writes the same operation on each side of the equals sign, while the function-machine method reverses the operations that transformed the unknown into the final number.

A dependable workflow

For most beginner-level linear equations, use this order:

  1. Simplify each side if needed: distribute over parentheses and combine like terms.
  2. Put all variable terms on one side by adding or subtracting a variable term on both sides.
  3. Put constants on the other side by adding or subtracting a constant on both sides.
  4. Divide or multiply to make the coefficient of the variable equal to .
  5. Check by substituting your answer into the original equation.

Here is a concise reference that follows the same balanced-operation approach and adds examples involving variables on both sides and fractions.

Solving linear equations and linear inequalities | Lesson

Read the Khan Academy lesson for a second presentation of the balancing rule and several useful equation forms.

In “How do I solve linear equations?” and its “Types of linear equations” subsection, read the core principle and follow the two worked equations immediately below it. Then, in “Fractions and negative numbers,” read the fraction strategy. Focus on the operation performed on both sides at each line, rather than trying to memorize a collection of shortcuts.


Variables on both sides

Equations often contain the variable on both sides. This does not change the balancing rule; it only adds one cleanup step.

Solve:

We want the variable terms together. Subtract from both sides:

On the left, combine like terms:

Now remove by subtracting from both sides:

Finally, divide both sides by :

Check in the original equation:

The check succeeds.

A common point of confusion is the phrase “bring all the terms to the left.” Treat it as a planning statement, not a mathematical operation. In the example, “bringing to the left” specifically meant subtracting from both sides.


Parentheses: treat a grouped expression carefully

Parentheses change what a coefficient multiplies. For example,

means that multiplies the whole group .

Because the group is multiplied by , divide by first:

Then add to both sides:

You could also expand the parentheses using the distributive property:

However, when the grouped expression is the entire side of a simple equation, dividing first is usually shorter and less error-prone.

When parentheses appear alongside other terms, expanding can be necessary. For example, solve:

Distribute to both terms inside the parentheses:

Combine like terms:

Subtract from both sides:

The core idea remains unchanged: simplify first, then use equal operations on both sides until the variable is isolated.


Fractions and negative coefficients

Fractions can look intimidating, but the inverse-operation logic stays the same.

Solve:

First undo the addition by subtracting from both sides:

Now undo division by by multiplying both sides by :

A negative coefficient is also manageable. Solve:

Divide both sides by :

A quick substitution confirms it:

The two negatives multiply to a positive, so the equation is true.


Checking with Python: use a residual

In programming, an equation can be checked by calculating the difference between its left and right sides. This difference is often called a residual:

When the residual is , the proposed value satisfies the equation.

For the earlier equation

use Python:

def residual(x):
    left_side = 4 * x + 7
    right_side = x + 19
    return left_side - right_side

print(residual(4))
print(residual(3))

The first call returns 0, confirming that solves the equation. The second does not return 0, so is not a solution.

This idea will reappear in data science. A regression model is rarely able to make every residual exactly zero, so later you will measure how large the residuals are and minimize their overall size.


Two useful edge cases

Most equations in this lesson have one solution. Occasionally, after simplifying, the variable disappears.

Consider:

Subtract from both sides:

This is false, so there is no solution. No value of can make the original equation true.

Now consider:

Subtract from both sides:

This is always true, so every value of is a solution.

These cases are signals to stop: once the variable has disappeared, assess whether the remaining numerical statement is true or false.


Key takeaways

Solving a one-variable linear equation means finding a value that makes both sides equal.

  • Preserve equality by performing the same operation on both sides.
  • Isolate the variable using inverse operations.
  • Undo operations in reverse order: typically remove additions or subtractions before undoing multiplication or division.
  • When the variable occurs on both sides, use addition or subtraction to collect variable terms on one side.
  • Simplify carefully: combine like terms and distribute over parentheses when needed.
  • Always check a solution by substituting it into the original equation, or by verifying that its residual is .

Next, you will extend this same balancing logic to rearranging formulas to isolate a specified variable. Instead of finding a numerical value for , you will reshape an equation so that a chosen variable stands alone.

Can't find a good explanation? Sign up and we'll make it for you

Sign up