Home›Math›Algebra Calculator

Algebra Calculator — Linear and Quadratic, Solved Live

Solve linear equations (ax + b = c) and quadratic equations (ax² + bx + c = 0) with full step-by-step working and a live graph of the quadratic’s curve.

100% FreeNo sign-up neededInstant results

Your equation

(a)x + (b) = (c)
No eval anywhere — equations are solved with plain arithmetic. Complex roots are reported as “no real roots”.

🔒 All calculations happen in your browser — no data leaves your device.

Solution

Solution for x
x = 4
2x + 5 = 13
Discriminant (b² − 4ac)—
Roots typeone real root
Check: plug x back in2(4) + 5 = 13 ✓
Vertex (quadratic)—
12x + 5 = 13
22x = 13 − 5 = 8
3x = 8 ÷ 2 = 4
Values are rounded for display; the underlying arithmetic uses full floating-point precision.

The curve

For quadratics, this is your parabola with its roots and vertex marked. For linear equations, it is the straight line.

Your equation Roots (where y = 0)
Key takeaways
  • Linear equations are solved by isolating x: at the defaults, 2x + 5 = 13 gives 2x = 8, so x = 4 — and the calculator plugs the answer back in to check it.
  • For quadratics, the discriminant Δ = b² − 4ac decides the root type before any solving: positive means two real roots, zero one repeated root, negative none (the page’s own example x² − 5x + 6 = 0 has Δ = 1 and roots x = 2 and x = 3).
  • Every solution comes with step-by-step working and the curve drawn, with the roots marked on the graph.

Keep exploring

Three companion tools for harder math.

How it works

Three steps from equation to answer.

1

Pick the equation type

Linear (ax + b = c) or quadratic (ax² + bx + c = 0). The form swaps instantly.

2

Enter the coefficients

Type a, b, and c. The solution, check, and graph update with every keystroke.

3

Read the steps

Each solution shows its working line by line — including the discriminant for quadratics.

The math behind the solution

Linear equations are solved by isolating x: subtract b from both sides, then divide by a. Quadratic equations use the quadratic formula:

x = (−b ± √(b² − 4ac)) ÷ 2a

The discriminant (b² − 4ac) tells you what to expect: positive → two real roots, zero → one repeated root, negative → no real roots.

Worked examples:

EquationWorkingResult
2x + 5 = 132x = 8 → x = 4x = 4
3x − 7 = 23x = 9 → x = 3x = 3
x² − 5x + 6 = 0Δ = 25 − 24 = 1; x = (5 ± 1) ÷ 2x = 2, 3
x² + 2x + 5 = 0Δ = 4 − 20 = −16no real roots

Algebra equations

What an equation is, how linear and quadratic equations differ, and what “solve” really asks you to do.

Most people arrive here with the same job in hand: a line of symbols with an equals sign in the middle and one letter hiding in it. That line is one of the algebra equations — a statement that two expressions are equal, with an unknown value (the variable, usually x) to be found. An expression like 3x + 5 has no equals sign and nothing to solve; an equation like 3x + 5 = 20 is a claim, and solving it means finding the value of x that makes the claim true — here x = 5, because 3 × 5 + 5 = 20.

Two families fill almost all of school algebra. Linear equations contain x to the first power only — no x² term — and graph as straight lines: 2x + 5 = 13, solved above, is one. Quadratic equations contain an x² term and graph as parabolas: x² − 5x + 6 = 0 is one, and it has two solutions, x = 2 and x = 3. The solver at the top of this page handles both families from their coefficients: type a, b and c for the form you have, and it returns the solution with every step shown and the answer plugged back in as a check.

One habit separates reliable algebra from hopeful algebra: whatever you do to one side of an equation, you must do to the other. An equation is a balance. Subtract 5 from the left only and the balance tips — the two sides stop being equal and every line after that is built on a broken claim. Every method in this guide — solving, factoring, eliminating — is just that one rule applied patiently, and the check at the end (substituting your answer back into the original equation) is how you prove the balance held. I recommend running that check on every problem, including the ones in this guide; each worked example below ends with it.

Solve for x, step by step

The inverse-operation ladder: undo what was done to x, in reverse order, and check by substitution.

To solve for x is to get x alone on one side of the equals sign. The method never changes: look at what has been done to x, then undo each operation with its inverse — addition undone by subtraction, multiplication undone by division — working in reverse order, last operation first. This is the working the solve for x calculator above follows, and it scales from one-step problems to the hardest school equations. Four rungs of the ladder, each solved in full:

One step. x + 7 = 12. The 7 was added, so subtract 7 from both sides: x = 12 − 7 = 5. Check: 5 + 7 = 12 ✓.

Two steps. 3x − 5 = 16. Undo the subtraction first (the last operation applied): add 5 to both sides → 3x = 21. Then undo the multiplication: divide both sides by 3 → x = 7. Check: 3 × 7 − 5 = 21 − 5 = 16 ✓. Two inverse operations, no more, no less — a two step equations calculator problem is exactly this shape, and the order matters: dividing first would drag the −5 into fractions for no benefit.

Variables on both sides. 5x + 3 = 2x + 18. Collect the x terms on one side: subtract 2x from both sides → 3x + 3 = 18. Subtract 3 → 3x = 15. Divide by 3 → x = 5. Check both sides separately: 5 × 5 + 3 = 28, and 2 × 5 + 18 = 28 ✓ — the two sides meeting at the same number is the proof.

A fractions case. (2/3)x + 4 = 10. Subtract 4 → (2/3)x = 6. Undo the fraction by multiplying both sides by its reciprocal, 3/2: x = 6 × 3/2 = 9. Check: (2/3) × 9 = 6, and 6 + 4 = 10 ✓. The reciprocal trick is the whole of fraction equations: multiply by the flipped fraction and the coefficient becomes 1.

Notice what every rung shares: one operation per line, both sides treated identically, and a substitution check to close. Rush two operations into one line and errors hide; write them separately and the line where a mistake happens is the line you can see. Article 1 in the Related guides below takes this ladder further — brackets, negative coefficients, and solving for letters other than x.

The companion guide How to Solve for X (and Y) — Step by Step works the harder rungs — brackets on both sides, fraction coefficients and decimals, and solving for letters other than x in real formulas.

Factoring expressions, step by step

GCF first, then trinomials and difference of squares — every factorisation checked by expanding it back.

Factoring rewrites an expression as a product. Where simplifying tidies an expression up, factoring pulls it apart into brackets that multiply back to the original — and that reverse direction is exactly why it solves equations: if (x − 2)(x − 3) = 0, then one of the brackets must be zero, so x = 2 or x = 3. This section does the factoring calculator’s job in the open, with the working shown; every result below is verified by expanding the brackets back to the starting expression.

Step 1 — always take out the GCF first. The greatest common factor is the largest term dividing every part of the expression. For 6x² + 9x, both terms divide by 3x: 6x² + 9x = 3x(2x + 3). Expand back to check: 3x × 2x = 6x², 3x × 3 = 9x ✓. Skipping this step is the most common factoring error — trinomial methods below assume it is already done.

Step 2 — trinomials: find the pair. For x² + 5x + 6, you need two numbers that multiply to 6 (the constant) and add to 5 (the middle coefficient). The pair is 2 and 3: 2 × 3 = 6, 2 + 3 = 5. So x² + 5x + 6 = (x + 2)(x + 3). Expand back: x² + 3x + 2x + 6 = x² + 5x + 6 ✓. The sign rules ride along for free: a positive constant with a negative middle term means two negative numbers; a negative constant means one of each.

Step 3 — difference of squares. When the expression is one square minus another, it factors on sight: a² − b² = (a − b)(a + b). So x² − 25 = x² − 5² = (x − 5)(x + 5). Expand back: x² + 5x − 5x − 25 = x² − 25 ✓ — the middle terms cancel, which is the signature of this pattern.

When it will not factor. Some quadratics, like x² + 3x + 1, have no integer pair that multiplies to 1 and adds to 3 (the only candidate, 1 and 1, adds to 2). That says nothing is wrong — the quadratic formula in the section below still finds its (irrational) roots. Factoring is the fast lane, not the only road. One boundary worth stating plainly: this is expression factoring. Breaking a whole number like 60 into 2² × 3 × 5 is a different job, handled by the Factor Calculator — numbers there, expressions here. Article 3 in the Related guides teaches the two named classroom routines for trinomials — the X method and the box method — on harder examples.

The companion guide Factoring Quadratics — The Box Method and X Method, Worked teaches the two named classroom routines side by side on the same quadratics.

Factoring in depth: trinomials, grouping and special forms

The full factoring toolkit, one move at a time — every split below is checked by expanding it back.

What factoring is. Factoring is expansion read backwards. Expanding (x + 3)(x + 4) gives x² + 7x + 12; factoring starts from x² + 7x + 12 and recovers the brackets. Students search for this job under a dozen names — factoring calc included — but it is one move: rewrite a sum as a product. The product form earns its keep three ways. It exposes solutions: x² − 5x + 6 = (x − 2)(x − 3) says the equation x² − 5x + 6 = 0 is solved by x = 2 and x = 3, because a product is zero only when one of its factors is. It simplifies fractions: (x² − 9) ÷ (x − 3) collapses to x + 3 once the top is factored as (x − 3)(x + 3) (for x ≠ 3). And it reads graphs: the brackets of a factored quadratic name the points where its curve crosses the axis. Everything below is a technique for finding the brackets — and every technique ends with the same audit, expanding the answer back to the expression you started with.

GCF first, always — and what “factor completely” demands. Before any pattern-spotting, pull out the greatest common factor: the largest term dividing every part of the expression. 12x³ + 18x² shares 6x², so 12x³ + 18x² = 6x²(2x + 3). A searched homework string runs the same way: 8x² + 12x divides by 4x throughout, giving 4x(2x + 3) — the factor completely calculator habit, because it shrinks every coefficient before the harder methods start. Sometimes the GCF is the whole job, with a remainder that refuses to split further: 2x³ + 4x² − x = x(2x² + 4x − 1), and the bracket is finished — its discriminant is 24, not a perfect square, so no rational factor pair exists. Factor completely means keep going until nothing left can factor over the integers: 6x³ − 6x is not done at 6x(x² − 1), because x² − 1 is a difference of squares — completely factored it is 6x(x − 1)(x + 1). The same discipline finishes 12x² − 27 = 3(4x² − 9) = 3(2x − 3)(2x + 3), and even a quartic in disguise: x⁴ − 5x² + 4 = (x² − 1)(x² − 4) = (x − 1)(x + 1)(x − 2)(x + 2). Stopping one step early is the most common way a “factored” answer loses its last mark.

Trinomials with a = 1: the factor-pair hunt. A trinomial is a three-term polynomial, and x² + bx + c factors by finding two numbers that multiply to c and add to b. For x² − 2x − 15: multiply to −15, add to −2 — the pair is −5 and 3, so x² − 2x − 15 = (x − 5)(x + 3). The signs do the steering: c negative means the pair has one of each sign; c positive means both share the sign of b. Two searched examples run on the same hunt: x² + x − 42 needs a pair multiplying to −42 and adding to 1 — 7 and −6 — giving (x + 7)(x − 6); x² − 17x + 70 needs a pair multiplying to 70 and adding to −17 — both negative, −7 and −10 — giving (x − 7)(x − 10).

Trinomials with a ≠ 1: the X method. When the x² coefficient is not 1, inspection slows down and the X (or AC) method takes over — the routine an x method factoring calculator runs. Multiply a × c and hunt for a pair that multiplies to ac and adds to b; split the middle term by that pair; factor by grouping. For 2x² + 7x + 3: ac = 6, and 1 and 6 multiply to 6 and add to 7. Split: 2x² + x + 6x + 3 = x(2x + 1) + 3(2x + 1) = (2x + 1)(x + 3). The bigger searched strings submit to the same routine: 3x² + 25x + 42 has ac = 126 and the pair 7 and 18 — split into 3x² + 7x + 18x + 42 = x(3x + 7) + 6(3x + 7) = (3x + 7)(x + 6). And 5x² + 42x + 49 has ac = 245 and the pair 7 and 35: 5x² + 7x + 35x + 49 = x(5x + 7) + 7(5x + 7) = (5x + 7)(x + 7). Every factoring trinomials calculator, trinomial factoring calculator or factor trinomials calculator request, and every factoring quadratics calculator or quadratic factoring calculator variant of the same request, is answered by exactly these two routines — the pair hunt when a = 1, the X when it is not.

TrinomialThe huntFactored form
x² + 7x + 12pair ×12, adds to 7: 3 and 4(x + 3)(x + 4)
x² − 2x − 15pair ×−15, adds to −2: −5 and 3(x − 5)(x + 3)
x² + x − 42pair ×−42, adds to 1: 7 and −6(x + 7)(x − 6)
2x² + 7x + 3a × c = 6: 1 and 6(2x + 1)(x + 3)
3x² + 25x + 42a × c = 126: 7 and 18(3x + 7)(x + 6)
5x² + 42x + 49a × c = 245: 7 and 35(5x + 7)(x + 7)

Six trinomials, both routines. Every factored form here was verified by expanding it back to the trinomial in its row.

Perfect-square trinomials: the special case hiding inside the hunt. Some trinomials factor into a repeated bracket: x² + 6x + 9 = (x + 3)², because the pair hunt finds 3 and 3. Recognising them on sight is faster than hunting: the first and last terms are perfect squares (x² and 9 = 3²) and the middle term is twice the product of their roots (2 × x × 3 = 6x). x² − 10x + 25 = (x − 5)² and 4x² + 12x + 9 = (2x + 3)² pass the same test. The test also rejects impostors: 5x² + 42x + 49 looks square-flavoured (49 = 7²) but 5 is not a perfect square, and indeed it factors the ordinary X way, as (5x + 7)(x + 7) — a warning against pattern-matching on one term. The special-forms block below gives this family its full treatment.

Factoring by grouping: four terms, two pairs, one bracket. A four-term polynomial often factors by treating it as two pairs. Group the first two terms and the last two, factor each pair, and if the same bracket appears twice it factors out: x³ + 3x² + 2x + 6 = x²(x + 3) + 2(x + 3) = (x + 3)(x² + 2). A second run: 2x³ + 6x² + x + 3 = 2x²(x + 3) + 1(x + 3) = (x + 3)(2x² + 1). That shared bracket is the whole test — when it appears, the factoring by grouping calculator routine is done; when it does not, grouping in that order fails and the terms may need rearranging first. Honesty about the limit matters: x³ + 2x² + 3x + 4 defeats every pairing (x²(x + 2) + (3x + 4) shares nothing), and no rearrangement rescues it, because the cubic has no rational root and therefore no linear factor at all. Grouping is powerful exactly where a common bracket exists, and silent where none does.

Reverse FOIL is grouping read backwards. FOIL expands (x + 4)(x − 7) into x² − 3x − 28, multiplying First, Outer, Inner, Last. Run the film backwards — start from x² − 3x − 28 and recover (x + 4)(x − 7) — and you have what classrooms call reverse FOIL: not a separate method but the pair hunt (and, for a ≠ 1, the X method) wearing the expansion’s clothes. A reverse foil calculator request is answered by the same machinery above: find the pair whose product and sum rebuild the trinomial, and the brackets are the FOIL factors in reverse.

Special forms: squares and cubes. Three patterns factor on sight once recognised. Difference of squares: a² − b² = (a − b)(a + b) — x² − 16 = (x − 4)(x + 4), 4x² − 9 = (2x − 3)(2x + 3), 9x² − 25 = (3x − 5)(3x + 5). Its twin is a warning: a sum of squares does not factor over the real numbers at all, so x² + 4 is already finished (over the complex numbers it is (x − 2i)(x + 2i), which is why some tools report it as factorable and school courses do not). Perfect squares: a² ± 2ab + b² = (a ± b)² — the perfect square trinomial calculator check is three questions: is the first term a square, is the last term a square, is the middle exactly twice the product of their roots? Three yeses and the bracket writes itself. Cubes: a³ − b³ = (a − b)(a² + ab + b²) and a³ + b³ = (a + b)(a² − ab + b²) — so x³ − 8 = (x − 2)(x² + 2x + 4), x³ + 27 = (x + 3)(x² − 3x + 9), and 8x³ + 1 = (2x + 1)(4x² − 2x + 1). The quadratic brackets in the cube formulas do not factor further over the integers — their discriminants are negative — so a factored cube is a finished answer, not a step.

Solve by factoring: the zero-product property at work. Factoring earns its keep when an equation is set to zero: if a product is zero, one of its factors is zero. So a solve by factoring calculator run has three steps — move everything to one side, factor, set each factor to zero and solve the little equations. x² − x − 6 = 0 factors to (x − 3)(x + 2) = 0, so x = 3 or x = −2; both check by substitution (9 − 3 − 6 = 0, and 4 + 2 − 6 = 0). The searched strings behave identically: x² + x − 42 = 0 gives (x + 7)(x − 6) = 0 and x = −7 or 6; x² − 17x + 70 = 0 gives (x − 7)(x − 10) = 0 and x = 7 or 10. With a ≠ 1 the X method supplies the brackets first: 2x² + 21x + 49 = 0 factors to (2x + 7)(x + 7) = 0, so x = −7/2 or −7. One condition guards the whole method: the equation must be set to zero before factoring — a product equal to 5 says nothing about its factors, which is why rearranging to zero is step one and not a nicety.

Factored form ↔ standard form: converting both ways. Standard form lines a polynomial up by falling powers (x² + 2x − 24); factored form writes it as a product ((x + 6)(x − 4)). A factored form calculator conversion runs in both directions, and each direction has its own use. Standard → factored is the factoring of the blocks above: x² − 8x + 15 = (x − 3)(x − 5), and completely, 2x² − 18 = 2(x − 3)(x + 3). Factored → standard is expansion, the audit trail: (x − 4)(x + 6) = x² + 2x − 24, and with a leading coefficient, 3(x + 2)(x − 5) = 3x² − 9x − 30. A standard to factored form calculator habit worth stealing is to read the factored form for information before expanding it away: (x − 4)(x + 6) announces roots 4 and −6 and a y-intercept of −24 without a single line of working, because setting x = 0 in the brackets gives (−4)(6) = −24. Converting is never the goal; what each form reveals is.

StartDirectionResult
x² − 8x + 15standard → factored(x − 3)(x − 5)
2x² − 18standard → factored (completely)2(x − 3)(x + 3)
(x − 4)(x + 6)factored → standardx² + 2x − 24
3(x + 2)(x − 5)factored → standard3x² − 9x − 30

The same four conversions, both directions. Expansion checks every row in reverse.

Simplifying expressions and combining like terms

Like terms combine, unlike terms do not — the two rules behind every simplification.

Simplifying is the tidy-up half of algebra: rewrite an expression in its shortest equivalent form without changing its value. Read this section as a simplify calculator with the working visible — the rules are only two, and everything else is bookkeeping. Rule 1: like terms combine. Terms are “like” when their variable parts match exactly — same letters, same powers. 4x and −2x are like terms; 4x and 4x² are not; 4x and 4y are not. Rule 2: distribution before combining. A bracket multiplied by something must be opened first, multiplying every term inside.

Worked simplification. Simplify 4x + 3 − 2x + 7. Group the like terms: the x terms are 4x and −2x; the constants are 3 and 7. Combine each family: 4x − 2x = 2x, and 3 + 7 = 10. Result: 2x + 10. Nothing else can combine — an x term and a plain number are different species, and 2x + 10 is finished. This grouping is the whole of the combining like terms calculator task: scan, family by family, and never let a term jump families.

With brackets. Simplify 3(x + 4) − 2x. Distribute first: 3 × x = 3x and 3 × 4 = 12, giving 3x + 12 − 2x. Then combine the like terms: 3x − 2x = x. Result: x + 12. The order is not optional — combining before distributing is impossible here anyway (the x inside the bracket is locked until the bracket opens), and in longer expressions trying it is the classic route to a wrong answer.

Two traps to close with. First, a minus sign in front of a bracket distributes too: −(x − 5) becomes −x + 5, not −x − 5 — the sign flips every term inside. Second, powers are not like terms: 2x + 3x² cannot be merged into 5x-anything, however tempting the symmetry looks. Keep the families separate and a simplification can always be checked the same way as an equation — pick a value, say x = 2, and evaluate both versions: 4(2) + 3 − 2(2) + 7 = 14, and 2(2) + 10 = 14 ✓.

Linear equations and slope-intercept form

Reading y = mx + b at a glance, and one linear equation solved and checked in full.

A linear equation graphs as a straight line, and its friendliest written form is slope-intercept form: y = mx + b. The two numbers tell the whole story of the line. m is the slope — how steep the line is, measured as rise over run: for every 1 you move right, the line climbs m. b is the y-intercept — the height where the line crosses the vertical axis, the value of y when x = 0. Any linear equation calculator works in this form under the hood, because once an equation is rearranged into y = mx + b, both facts can be read off without any further work.

LineSlope (m)Y-intercept (b)How it runs
y = 2x + 323Climbs 2 for every 1 across
y = −3x + 1−31Falls 3 for every 1 across (negative slope runs downhill)
y = (1/2)x − 41/2−4Climbs 1 for every 2 across; crosses the axis below zero

Worked linear equation. Solve 4x − 8 = 12. Add 8 to both sides (undoing the subtraction): 4x = 20. Divide both sides by 4: x = 5. Check: 4 × 5 − 8 = 20 − 8 = 12 ✓. Read as a line, y = 4x − 8 has slope 4 and intercept −8 — and the solution x = 5 is the point where that line reaches the height y = 12, which is why solving and graphing are the same problem seen from two sides.

A slope note that pays off in exams: a horizontal line has slope 0 (y = 5 never climbs), and a vertical line has no defined slope at all (x = 3 cannot be written as y = mx + b). If your rearranged equation ends with x alone on one side and a constant on the other, you are looking at that vertical case — not at an error.

Quadratic equations: factoring and the formula

Two roads to the roots — factoring when it is quick, the quadratic formula always.

A quadratic equation has the shape ax² + bx + c = 0, and solving it means finding the roots — the x values where the parabola crosses the axis. Before solving anything, compute the discriminant, Δ = b² − 4ac: positive means two real roots, zero means one repeated root, negative means no real roots at all. It is a two-second forecast of what the solving will find, and the calculator above reports it for every quadratic you enter.

x = (−b ± √(b² − 4ac)) ÷ 2a

One quadratic, solved both ways. Take x² − 5x + 6 = 0. By factoring: find the pair that multiplies to 6 and adds to −5 — that is −2 and −3 — so x² − 5x + 6 = (x − 2)(x − 3) = 0, and a product is zero only when a factor is zero: x − 2 = 0 or x − 3 = 0, giving x = 2 or x = 3. By the formula: a = 1, b = −5, c = 6, so Δ = 25 − 24 = 1 (two real roots, as forecast), and x = (5 ± √1) ÷ 2 = (5 ± 1) ÷ 2, giving x = 6 ÷ 2 = 3 or x = 4 ÷ 2 = 2 — the same pair, as it must be.

Check by substitution, both roots, in the original equation: 2² − 5 × 2 + 6 = 4 − 10 + 6 = 0 ✓; 3² − 5 × 3 + 6 = 9 − 15 + 6 = 0 ✓. Two methods agreeing and both roots checking is as certain as school algebra gets.

Which road when? Try factoring first when the coefficients are small whole numbers — the pair hunt takes seconds and the answer arrives already checked by the expansion habit from the factoring section. Go straight to the formula when the pair hunt stalls, when coefficients are fractions or decimals, or when the discriminant is not a perfect square (roots will be irrational; the formula still hands them over exactly, in surd form if you keep the √). And when Δ is negative, stop: no real roots exist, and any “answer” a method produces from there is fiction.

Systems of equations: the elimination method

Add or subtract the equations so one variable cancels — then the other falls out.

A system is two equations sharing two unknowns, and a solution must satisfy both at once. The elimination method earns its name: line the equations up, then add or subtract them so that one variable’s terms cancel exactly, leaving a one-variable equation of the kind this page opened with. It is the method an elimination calculator runs, shown here at reading speed.

Worked system. Solve 2x + y = 10 and x − y = 2. Look at the y terms: +y in the first equation, −y in the second — they are set up to cancel if the equations are added. Adding left sides and right sides: (2x + y) + (x − y) = 10 + 2, so 3x = 12, and x = 4. Substitute x = 4 into either original — the first: 2 × 4 + y = 10, so y = 10 − 8 = 2. Check in both originals (a system check is only real when it covers both): 2 × 4 + 2 = 10 ✓, and 4 − 2 = 2 ✓.

Add or subtract? The rule is one line: if the target variable’s coefficients are opposites (+y and −y), add; if they are the same (+y and +y), subtract one equation from the other. When neither lines up, multiply one whole equation first — every term, both sides — until the coefficients match or oppose, then proceed. Multiplying is always legal (it rewrites the same claim in bigger numbers); forgetting to multiply the constant term is the step where systems usually break, so scale the entire line or none of it.

Functions, expressions and other variables

Evaluating f(x), rearranging formulas for any letter, and what the expression mode is for.

A function is a rule with a name: f(x) = 2x² − 3 says “square the input, double it, subtract 3”. Evaluating it is pure substitution — the function calculator task in its purest form. Find f(4): replace every x with 4, carefully, in brackets: f(4) = 2 × (4)² − 3 = 2 × 16 − 3 = 32 − 3 = 29. The brackets matter: at x = −2 the same rule gives 2 × (−2)² − 3 = 2 × 4 − 3 = 5, because the square swallows the minus sign — the single most-lost mark in function questions. Article 2 in the Related guides is a full workout of this skill.

The solver is set up for x, but algebra does not care which letter is the unknown — used the way this guide teaches, the same steps act as a variable calculator for any letter you name. To solve P = 2l + 2w for w: subtract 2l from both sides → P − 2l = 2w; divide both sides by 2 → w = (P − 2l) ÷ 2. Nothing about the method changed: undo the operations around w, in reverse order, exactly as with x. FAQ 4 below and Article 1 both practise this rearrangement on real formulas.

Finally, the expression mode idea behind this page’s expression calculator role: not every task has an equals sign. Simplifying 3(x + 4) − 2x or evaluating 2x² − 3 at x = 4 are expression jobs — no solution to find, just a value or a tidier form to produce — and the sections above cover both with the same discipline: one operation per line, and a numeric spot-check at the end.

The companion guide Evaluating Expressions and Functions works a full set of substitutions, traps included.

One solver, five jobs — with steps

What this page does for each kind of algebra task, and where each is taught.

One equation calculator, several distinct jobs. This page is an algebra calculator with steps, not just answers: every method below is worked line by line somewhere on this page, because a bare answer teaches nothing and cannot be checked. It is the algebra solver habit applied throughout — solve, then prove it by substitution.

The factoring job deserves its own sentence, because it is the one students name most. Used on an expression, this page is a factoring calculator with steps: the factoring sections below pull a polynomial apart bracket by bracket and expand it back to prove the split. Teachers and textbooks give that same job several names — a polynomial factoring calculator when the input is a polynomial, a factor the expression calculator when the worksheet instruction is “factor the expression”, a factor polynomial calculator when it is phrased as an order. The names differ; the moves — GCF first, then the pattern that fits — are identical, and they are taught in full in the two factoring sections.

JobExample shapeTaught in
Solve3x − 5 = 16 → x = 7Solve for x, step by step
Factorx² + 5x + 6 → (x + 2)(x + 3)Factoring expressions
Simplify4x + 3 − 2x + 7 → 2x + 10Simplifying expressions
Evaluatef(4) for f(x) = 2x² − 3 → 29Functions, expressions and other variables
System2x + y = 10, x − y = 2 → x = 4, y = 2Systems of equations

Work top to bottom on a new topic, or jump straight to the row that matches tonight’s homework — each section stands alone, and each ends with the check that makes its answers trustworthy.

Go deeper

The details that separate a rough guess from a trustworthy number.

The discriminant sits inside the square root of the quadratic formula, so its sign decides the roots:

  • Δ > 0: two distinct real roots — the parabola crosses the x-axis twice.
  • Δ = 0: one repeated root — the parabola just touches the x-axis at its vertex.
  • Δ < 0: no real roots — the parabola never reaches the x-axis; the roots are complex.

The calculator shows Δ and the roots type for every quadratic you enter.

Degenerate inputs are handled honestly:

  • Linear, a = 0, b = c: every x is a solution (e.g. 0x + 5 = 5).
  • Linear, a = 0, b ≠ c: no solution exists (e.g. 0x + 5 = 7).
  • Quadratic, a = 0: the equation is really linear — the calculator solves bx + c = 0 instead.

Frequently asked questions

Quick answers about this algebra calculator.

How do I factor a trinomial?

For x² + bx + c, find two numbers that multiply to c and add to b, then write them as brackets: x² + 5x + 6 needs 2 and 3, so it factors to (x + 2)(x + 3). If the x² coefficient is not 1, use the X method: multiply a × c, find the pair for that product, split the middle term, and factor by grouping.

What is the X method in factoring?

The X (or AC) method factors trinomials whose x² coefficient is not 1. Multiply a × c, find two numbers that multiply to that product and add to b, split the middle term with them, then group. For 2x² + 7x + 3: a × c = 6 and the pair is 1 and 6, so 2x² + x + 6x + 3 = x(2x + 1) + 3(2x + 1) = (2x + 1)(x + 3).

How do I factor by grouping?

Group a four-term polynomial into two pairs, factor each pair, and factor out the bracket they share. x³ + 3x² + 2x + 6 = x²(x + 3) + 2(x + 3) = (x + 3)(x² + 2). If no bracket is shared, rearrange the terms and try again; if no order produces a shared bracket, the polynomial has no factor of that kind.

What does “factor completely” mean?

It means keep factoring until every remaining factor is prime — no factor can be split further over the integers. 12x² − 27 is not completely factored at 3(4x² − 9), because 4x² − 9 is a difference of squares; completely factored, it is 3(2x − 3)(2x + 3). Stopping one step early is the classic lost mark.

How do I solve an equation by factoring?

Move everything to one side so the equation equals zero, factor that side, then set each factor to zero and solve. x² − 5x + 6 = 0 factors to (x − 2)(x − 3) = 0, so x = 2 or x = 3. The zero is essential: the method works because a product is zero only when one of its factors is.

What is factored form?

Factored form writes a polynomial as a product of its factors instead of a sum of terms: x² + 2x − 24 in standard form is (x + 6)(x − 4) in factored form. It is the more informative shape — for a quadratic it displays the roots directly, here x = −6 and x = 4.

How do I factor a perfect square trinomial?

Check three things: the first term is a perfect square, the last term is a perfect square, and the middle term is twice the product of their square roots. Then the answer is the sum or difference of the roots, squared: x² + 6x + 9 = (x + 3)² and 4x² − 12x + 9 = (2x − 3)². Fail any one check and it is an ordinary trinomial — use the pair hunt or the X method.

What is reverse FOIL?

FOIL run backwards. FOIL expands (x + 4)(x − 7) to x² − 3x − 28 by multiplying First, Outer, Inner and Last terms; reverse FOIL starts from the trinomial and recovers the brackets. It is not a separate technique — it is the factor-pair hunt (or the X method when a ≠ 1) named after the expansion it undoes.

When can a quadratic not be factored?

When no rational pair multiplies to a × c and adds to b — equivalently, when the discriminant b² − 4ac is not a perfect square. x² + 3x + 1 has discriminant 5, so it has no integer factor pair; its roots are real but irrational, (−3 ± √5) ÷ 2, and the quadratic formula in the solver above finds them. Not factorable over the integers never means not solvable.

How do I factor out the GCF?

Find the largest term dividing every part of the expression — the greatest number and the lowest power of each shared variable — and write it outside a bracket. 6x² + 9x divides by 3x throughout, giving 3x(2x + 3). Always do this first: smaller coefficients make every later method easier, and some expressions need nothing else.

More math tools for harder problems.

Go deeper on solving, evaluating and factoring — every step worked, every answer checked.

Disclaimer

This calculator is for information only. Solutions are exact arithmetic on the coefficients you enter; rounding is display-only. For graded coursework, always show your own working — a tool’s answer is not a substitute for understanding the method.

↑