Linear Equation

Solve for the value of x in any linear equation by rearranging to isolate x, finding the unique solution where the expression equals zero.

ax+b=0    x=baax + b = 0 \implies x = -\frac{b}{a}

Solve a problem with Linear Equation

Type the problem. The solver will use Linear Equation where Linear Equation is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Linear Equation takes
aa
bb
xx
Linear Equation
SymbolMeaning
aaThe coefficient multiplying xx (the number in front of the variable); if a=0a = 0, the formula does not work.
bbThe constant term added to or subtracted from the axax term; it determines where the equation crosses the x-axis.
xxThe unknown variable you are solving for; the solution tells you which value makes ax+b=0ax + b = 0 true.

When to use it

Use this when you need to find the single value that balances a linear equation with one variable.

Level

Usually taught in: Algebra I

Worked examples

1. Solve a linear equation with positive integers

Problem

Solve 3x+6=03x + 6 = 0 for xx.
  1. 3x+6=03x + 6 = 0

    Start with the equation in the form ax+b=0ax + b = 0.

  2. 3x=63x = -6

    Subtract 66 from both sides to isolate the term with xx.

  3. x=2x = -2

    Divide both sides by a=3a = 3 to find the value of xx.

Answer: x=2x = -2

This is a straightforward application of the formula: identify a=3a = 3 and b=6b = 6, subtract the constant, then divide by the coefficient to find x=63=2x = -\frac{6}{3} = -2.

2. Solve a linear equation with negative coefficients and fractions

Problem

Solve 4x+5=0-4x + 5 = 0 for xx.
  1. 4x+5=0-4x + 5 = 0

    Start with the equation where a=4a = -4 and b=5b = 5.

  2. 4x=5-4x = -5

    Subtract 55 from both sides to move the constant term.

  3. x=54x = \frac{-5}{-4}

    Divide both sides by a=4a = -4.

  4. x=54x = \frac{5}{4}

    Simplify by canceling the negatives; 54=54\frac{-5}{-4} = \frac{5}{4}.

Answer: x=54x = \frac{5}{4}

Handling negative coefficients requires care when dividing: a negative divided by a negative is positive. The result is a fraction, which is expected when the constant does not divide evenly by the coefficient.

3. Solve a word problem about breaking even at a bake sale

Problem

At a school bake sale, a club's profit from selling cupcakes is given by P=3x12P = 3x - 12, where xx is the number of cupcakes sold. How many cupcakes must they sell to break even (profit = 0)?
  1. 3x12=03x - 12 = 0

    Set up the equation by replacing PP with 00.

  2. 3x=123x = 12

    Add 1212 to both sides to isolate the term with xx.

  3. x=4x = 4

    Divide both sides by 33 to find the number of cupcakes needed.

Answer: x=4x = 4

In real contexts like profit, the solution has practical meaning: the club needs to sell 4 cupcakes just to break even. This illustrates why solving linear equations matters beyond pure algebra.

Common mistakes

Where Linear Equation usually goes wrong
Answer came out wrong
Writing x=a+b=3+6=9x = a + b = 3 + 6 = 9 for the equation 3x+6=03x + 6 = 0.
Apply the correct formula: x=ba=63=2x = -\frac{b}{a} = -\frac{6}{3} = -2.
When solving 2x+8=0-2x + 8 = 0, writing x=4x = -4 instead of x=4x = 4.
Simplify x=82x = -\frac{8}{-2} by canceling the negatives: 82=4\frac{8}{2} = 4.
Stopping at 5x=155x = -15 as the final answer instead of solving for xx.
Continue by dividing both sides by 55: x=155=3x = \frac{-15}{5} = -3.
The mistakeWhy it is wrongThe fix
Writing x=a+b=3+6=9x = a + b = 3 + 6 = 9 for the equation 3x+6=03x + 6 = 0.Confusing the formula x=bax = -\frac{b}{a} with simple addition of the coefficients.Apply the correct formula: x=ba=63=2x = -\frac{b}{a} = -\frac{6}{3} = -2.
When solving 2x+8=0-2x + 8 = 0, writing x=4x = -4 instead of x=4x = 4.Failing to recognize that dividing a negative by a negative yields a positive: 82=82=4-\frac{8}{-2} = \frac{8}{2} = 4.Simplify x=82x = -\frac{8}{-2} by canceling the negatives: 82=4\frac{8}{2} = 4.
Stopping at 5x=155x = -15 as the final answer instead of solving for xx.Forgetting that the equation is not solved until the variable xx stands alone without any coefficient.Continue by dividing both sides by 55: x=155=3x = \frac{-15}{5} = -3.

Tips and when to use something else

  • Make sure the equation is in the form ax+b=0ax + b = 0 before applying the formula; if it is not (e.g., 3x2=73x - 2 = 7), rearrange it first using Order of Operations or the Distributive Property.
  • Check your answer by plugging it back into the original equation; ax+bax + b should equal zero.
  • If you see variables on both sides of the equation, use Two-Step Equations to move all terms with xx to one side and all constants to the other before solving.
  • For equations involving absolute values, inequalities, or systems, you will need other methods like Absolute Value Inequalities or Solving by Elimination; this formula only works for simple linear equations equal to zero.

Frequently asked questions

What does aa have to be in a linear equation?
aa (the coefficient of xx) must be any non-zero number. If a=0a = 0, the equation is no longer truly linear, and the formula x=bax = -\frac{b}{a} fails because you cannot divide by zero.
Why do we subtract bb before dividing by aa?
When you start with ax+b=0ax + b = 0, the goal is to isolate xx. First, subtract bb from both sides to get ax=bax = -b (this is where the negative sign comes from). Then divide by aa to find x=bax = -\frac{b}{a}.
Does a linear equation always have exactly one solution?
Yes, every linear equation of the form ax+b=0ax + b = 0 (with a0a \neq 0) has exactly one solution. If you find zero or infinitely many solutions, the original equation might not be truly linear or might have special structure.
Should I always use the formula x=bax = -\frac{b}{a} or is solving step-by-step okay?
Both methods work and give the same answer. Use the formula when you can quickly identify aa and bb. Use step-by-step when learning, when the equation is not quite in standard form, or when you want to understand each stage of the solution.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18