Algebraic Expression Simplifier

Simplify Algebraic Expression P(x)

Enter a polynomial in x. The tool expands special products, multiplies terms, and combines like terms step-by-step.

The calculator above expands brackets, collects like terms, and simplifies algebraic expressions while listing each transformation.

Formulas used

(a + b)² = a² + 2ab + b²
(a − b)² = a² − 2ab + b²
a² − b² = (a − b)(a + b)
  • Like terms have the same variables raised to the same powers.
  • Expand products first, then combine like terms.

Worked example

Simplify (x + 2)² − (x − 1)(x + 1):

x² + 4x + 4 − (x² − 1) = 4x + 5

Enter the same values in the calculator above to see every step of the solution.

Worked examples by problem type (easy to hard)

Each example below covers one type of simplification problem, ordered from the easiest to the hardest. Type the expression shown under each example into the calculator above to compare every step.

Example 1. Combining like terms (easy)

Simplify A = 5x² − 3x + 2 − 2x² + 7x − 6.

There are no brackets, so group the terms with the same power of x and add their coefficients.

A = (5x² − 2x²) + (−3x + 7x) + (2 − 6)
A = 3x² + 4x − 4

Input: 5x^2 - 3x + 2 - 2x^2 + 7x - 6

Example 2. Multiplying a monomial by a polynomial

Simplify B = 3x(2x − 5) − 2x(3x − 4).

Multiply the monomial by each term inside the brackets: multiply the coefficients and add the exponents.

3x(2x − 5) = 6x² − 15x
2x(3x − 4) = 6x² − 8x
B = 6x² − 15x − 6x² + 8x = −7x

The minus sign in front of the second product changes both signs: −(6x² − 8x) = −6x² + 8x.

Input: 3x(2x - 5) - 2x(3x - 4)

Example 3. Multiplying two polynomials

Simplify C = (x + 2)(x² − 3x + 1).

Multiply each term of the first bracket by each term of the second: 2 × 3 = 6 partial products.

C = x³ − 3x² + x + 2x² − 6x + 2
C = x³ − x² − 5x + 2

Input: (x + 2)(x^2 - 3x + 1)

Example 4. Square of a sum or a difference

Simplify D = (3x − 2)² − 9x(x − 1).

(3x − 2)² = 9x² − 12x + 4
9x(x − 1) = 9x² − 9x
D = −3x + 4

Remember to square the coefficient as well: (3x)² = 9x², not 3x². If a problem then asks for the value of x that makes D = 0, solve −3x + 4 = 0 with the linear equation calculator.

Input: (3x - 2)^2 - 9x(x - 1)

Example 5. Difference of two squares: a value that does not depend on x

Show that E = (x − 5)(x + 5) − (x + 3)(x − 3) does not depend on x.

E = (x² − 25) − (x² − 9) = −16

After simplifying, no x is left, so E = −16 for every value of x. This is how you prove that an expression does not depend on the variable.

Input: (x - 5)(x + 5) - (x + 3)(x - 3)

Example 6. Cube of a sum or a difference

Simplify F = (x + 1)³ − (x − 1)³.

(x + 1)³ = x³ + 3x² + 3x + 1
(x − 1)³ = x³ − 3x² + 3x − 1
F = 6x² + 2

The terms x³ and 3x cancel; the terms 3x² and 1 double. For higher powers, the coefficients 1, 3, 3, 1 come from Pascal’s triangle; see the binomial expansion calculator.

Input: (x + 1)^3 - (x - 1)^3

Example 7. Sum and difference of two cubes

Simplify G = (x + 2)(x² − 2x + 4) − (x − 1)(x² + x + 1).

Recognize the two factored forms: (a + b)(a² − ab + b²) = a³ + b³ with a = x, b = 2, and (a − b)(a² + ab + b²) = a³ − b³ with a = x, b = 1.

G = (x³ + 8) − (x³ − 1) = 9

The calculator multiplies the brackets term by term, so its solution is longer, but it reaches the same answer 9.

Input: (x + 2)(x^2 - 2x + 4) - (x - 1)(x^2 + x + 1)

Example 8. Simplify, then evaluate (hard)

Evaluate H = (2x − 1)² − (x + 2)(x − 2) − 3x(x − 1) at x = 2026.

Substituting 2026 straight away means squaring large numbers. Simplify first:

(2x − 1)² = 4x² − 4x + 1, (x + 2)(x − 2) = x² − 4, 3x(x − 1) = 3x² − 3x
H = −x + 5
x = 2026: H = −2021

Input: (2x - 1)^2 - (x + 2)(x - 2) - 3x(x - 1)

🎯 Practice quiz: simplifying algebraic expressions

Ten multiple-choice questions with four options each, built on the sections above: like terms, combining like terms, removing brackets after a minus sign, multiplying a monomial or a polynomial, the square of a difference, the difference of two squares, the cube of a sum, the sum of two cubes, and simplifying before evaluating. Pick an answer: the correct option turns green, a wrong one turns red, and the worked solution appears right below with a ⚠️ Traps box explaining why the wrong options are tempting. You can paste any expression from a question into the calculator above to check every step.

1️⃣ Like terms Question 1. Which pair of monomials are like terms:

2️⃣ Combining like terms Question 2. Simplify 4x² − 3x + 5 − x² + 3x − 8:

3️⃣ Removing brackets after a minus sign Question 3. Simplify 2x − (3x − 5):

4️⃣ Monomial times polynomial Question 4. The product −2x(3x² − x + 4) equals:

5️⃣ Square of a difference Question 5. Expand (2x − 3)²:

6️⃣ Difference of two squares Question 6. Simplify (3x + 1)(3x − 1) − 9x²:

7️⃣ Polynomial times polynomial Question 7. In the simplified form of (x − 2)(x² + 3x − 1), the coefficient of x is:

8️⃣ Cube of a sum Question 8. Expand (x + 2)³:

9️⃣ Sum of two cubes Question 9. The value of P = (x + 3)(x² − 3x + 9) − x³ is:

🔟 Simplify, then evaluate Question 10. The value of Q = (x − 1)² − (x + 2)(x − 2) + 2x at x = 2026 is:

How to use the calculator

  1. Type the expression, for example (x + 2)^2 − (x − 1)(x + 1).
  2. Press the calculate button. The result appears instantly.
  3. Read the step-by-step solution, rendered with KaTeX, to check your own work.

🔗 Related calculators